Home Forums Support Formatting 'unit price'

This topic contains 5 replies, has 2 voices, and was last updated by  Hillel Coren 2 weeks, 1 day ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #17177

    didumir
    Participant

    Hi,

    after installing a self hosted system and being able to connect to the system
    with the api, I found one minor issue.

    In the invoices (pdf) the field ‘unit cost’ is displayed with 4 decimal places, the field ‘line total’ with 2 decimal places.

    how can i please get the field ‘unit cost’ displayed with 2 decimal places in the pdf version, too?

    Thanks in advance!

    #17195

    Hillel Coren
    Keymaster

    What value are you using for the unit cost? The PDF should match the input.

    #17200

    didumir
    Participant

    Thanks! The value is a php-float with 5 decimal places handed over with an api call:

    The (partial) json-string is
    invoice_items”:[{“product_key”:”PKey1″,”note”:”xxx”,”cost”:”44.53782″,”qty”:”1″},{“PKey2″:”pk2″,”notes”:”note”,”cost”:2.47899,”qty”:1}]

    The PDF shows `
    Unit Cost QTY Line Total
    44.5378 1 44.54
    2.479 1 2,48
    `

    #17201

    Hillel Coren
    Keymaster

    To show it as 2 decimals on the PDF you’d need to round the values before sending the API request or change the source code.

    #17202

    didumir
    Participant

    Thanks, ’rounding on sender-side’ is something that i had already tried resulting in rounding errors in the total of the invoice.
    Do you have any pointer where to look at the source-code exactly?

    BTW: great piece of software anyway 😉

    #17203

    Hillel Coren
    Keymaster
Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

Posted in: