Unable to Import invoices.csv and invoice_items.csv

Dear all,

I am trying to import invoices following the instructions in wiki.
Version of invoiceplane: 1.5.3

First problem: the file “invoice_items.csv” does not show up in the import data page. The files “invoices.csv” and “invoice_items.csv” have been uploaded “/uploads/import” folder

Second problem:
When I try to import the file “invoices.csv” I got the following warnings and errors:

I thank in advance for any support given.


A PHP Error was encountered

Severity: Notice

Message: Undefined property: CI::$mdl_invoice_groups

Filename: core/Model.php

Line Number: 77

Backtrace:

File: /application/modules/invoices/models/Mdl_invoices.php
Line: 210
Function: __get

File: /application/modules/import/models/Mdl_import.php
Line: 232
Function: create

File: /application/modules/import/controllers/Import.php
Line: 86
Function: import_invoices

File: /index.php
Line: 327
Function: require_once
A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /vendor/codeigniter/framework/system/core/Exceptions.php:271)

Filename: core/Common.php

Line Number: 564

Backtrace:
An uncaught Exception was encountered

Type: Error

Message: Call to a member function where() on null

Filename: /application/modules/invoices/models/Mdl_invoices.php

Line Number: 210

Backtrace:

File: /application/modules/import/models/Mdl_import.php
Line: 232
Function: create

File: /application/modules/import/controllers/Import.php
Line: 86
Function: import_invoices

File: /index.php
Line: 327
Function: require_once

Importing is broken in 1.5.3. The dev knows about this and is working on it.

Thanks.

I report here a status update:

First problem solved. My filename was wrong (blank space at the beginning).

The import of the file “invoices.csv” breaks at the second line of the data with the error messages posted above. The first line is correctly imported.
The import of the “invoice_items.csv” seems to work. The items are added into the first imported invoice without error messages.

Commenting below lines starting at 211 in mdl_invoices works.

$invgroup = $this->mdl_invoice_groups->where(‘invoice_group_id’, $invoice_group)->get()->row();
if (preg_match("/sumex/i", $invgroup->invoice_group_name)) {
If the Invoice Group includes “Sumex”, make the invoice a Sumex one
$db_array = array(
‘sumex_invoice’ => $invoice_id
);
$this->db->insert(‘ip_invoice_sumex’, $db_array);
}