Importing Data with Custom Fields

I’m trying to import around 500 clients via csv and i can do that fine no problem with the pre-existing fields in the clients sections but hitting an issue with custom fields.

I have added a Custom Field called ‘Contact Name’ in the clients part and it has given the column name as ‘client_custom_contact_name’ so that’s what i’ve put in my csv as another column and most of the records have something in this.

When i import the data, it fails returning this information:


A PHP Error was encountered

Severity: Warning

Message: Invalid argument supplied for foreach()

Filename: models/mdl_import.php

Line Number: 414

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /customers/2/8/4/viehome.co.uk/httpd.www/accounts/system/core/Exceptions.php:185)

Filename: helpers/url_helper.php

Line Number: 542

If i leave out this column from the csv, all the clients import fine with no problems.

Apologies if i’m doing something wrong which is really obvious, but can anyone help at all?

Thanks,

Mace95

Not possible at the moment, see https://github.com/InvoicePlane/InvoicePlane/issues/31 for more details.

Yes this would be a great function. Unfortunately there are some input fields missing in the customer section which have to be added as custom fields.

In general it would not be a bad idea to add at least the following fields by default:

  • bank account details (BIC/IBAN in Germany)
  • tax number of client
  • company name / name of contact person in company
  • customer id

I agree with xnetworks, about some more custom fields but at least the standard

VAT ID:
Taxes Code:

are the minimum goal to make it functional

I’m autoquoting myself.

vat_id & tax_code are simply importing modifing \application\modules\import\models\mdl_import.php

adding after ‘client_web’,

        'client_vat_id',
        'client_tax_code',

So the code block becomes:

    'clients.csv' => array(
        'client_name',
        'client_address_1',
        'client_address_2',
        'client_city',
        'client_state',
        'client_zip',
        'client_country',
        'client_phone',
        'client_fax',
        'client_mobile',
        'client_email',
        'client_web',
        'client_vat_id',
        'client_tax_code',
        'client_active'
    ),

I hope that should be helpful.

Obviously the clients.csv columns must be modified reflecting this change.