Home Forums Support Importing invoice data via CSV

This topic contains 6 replies, has 3 voices, and was last updated by  superkaybee 3 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #20455

    superkaybee
    Participant

    Hi, I’ve been testing importing invoice data from CSV files. I’ve got it mostly working but have 2 questions that I’m wondering about.

    1. When an invoice is created upon import, the status is set to “Sent”. Is there a way to have that set to “Draft” instead?

    2. Is there a way to set additional fields in the CSV import. For example, the overall discount & tax rate for an invoice.

    I’m running v4.5.11 self-hosted and am happy to modify the source code to make these changes — I just can’t seem to locate the correct sections.

    Any direction would be greatly appreciated — extremely happy with InvoiceNinja overall!!

    Thanks.

    #20456

    braddcadd
    Participant

    Hey superkeybee, Will you need to import invoices regularly or is this a one time event (in theory at least)? If one time event, have you tried to change the field in the database from “Sent” to “Draft”? phpmyadmin will make this easier if you are not a database person.

    #20457

    superkaybee
    Participant

    Yes it will be a regular process so I would prefer to have the status set upon import rather than updating the database. DB update would be easy enough, just another step in a process that we’re trying to streamline.

    #20458

    Hillel Coren
    Keymaster

    Do NOT manually update the database. We cache data for performance, it will cause the client balance to be incorrect.

    1 and 2 aren’t supported with the CSV import but should be possible using an integrator such as Zapier or Integromat.

    #20459

    superkaybee
    Participant

    Thanks for the info Hillel. Item 1 is the most important to us at the momemt — is there a place in the InvoiceNinja code that sets the status of an imported invoice to “Sent” that we could easily flip to “Draft” in our self-hosted environment? The CSV import process has everything we need and I would hate to have to bring in a separate integrator service just for this one field. Thanks for any assistance that you can provide.

    #20460

    Hillel Coren
    Keymaster

    https://github.com/invoiceninja/invoiceninja/blob/master/app/Services/ImportService.php#L445

    I haven’t tested commenting out this code, in may cause problems if the invoices are imported as paid.

    #20461

    superkaybee
    Participant

    Thanks Hillel, commenting that out does seem to allow us to import invoices and they show as “Draft”. We don’t expect to ever need to import invoices with a status other than Draft so this should work. Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.

Posted in: