invoices amount

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Agnes_C
    Junior Member
    • Jun 2024
    • 16

    invoices amount

    good morning,
    I think I'm so stupid sometimes!
    I just want to calculate a sum!

    I have an ACCOUNT entity and an INVOICES entity, both linked.

    I want to put the total amount of invoices in € in a field.

    I've managed to enter the number of invoices, this one is ok, but not the corresponding amount:
    THIS IS OK : numberOfInvoices= record\count('Invoices', 'accountId=', id, 'status!=', 'cancelled');

    I tried this but it doesn't work (amountConverted is the field with all the amounts per invoice):
    THIS IS NOT OK : amountOfInvoices = record\sumRelated('Invoices', 'accountId=', id, 'amountConverted',);

    do you know why?
    thank you very much
  • lazovic
    Super Moderator
    • Jan 2022
    • 810

    #2
    Hi Agnes_C,

    Please try to use the following formula script:
    Code:
    amountOfInvoices = entity\sumRelated('invoices', 'amountConverted');

    Please note that invoices is the name of the link between the account and the invoices; you can see this on the screenshot:

    Click image for larger version

Name:	image.png
Views:	55
Size:	22.6 KB
ID:	112125

    Comment

    • Agnes_C
      Junior Member
      • Jun 2024
      • 16

      #3
      thanks a lot !!!
      I had done a lot of tests and indeed my problem was just the way I wrote invoices ! ?‍♀️ ?



      Comment

      Working...