#Eranga-invoice

1 messages ยท Page 1 of 1 (latest)

fiery pilotBOT
low pebble
#

Eranga-invoice

#

What do you want to differentiate? Both are in different line items and they have indicated the difference. Could you share the use case?

ebon sun
#

Let's say I like to get the amount in Unused time on... invoice item. How can I find it from the invoice items array I receive from the upcoming invoice response?

#

I'm not sure it is good to rely on the description to do the filtering because it might come in a different language for different customers maybe

low pebble
#

There's no straight forward to do it. One possible way I can think of is to check the amount and proration field.

  • If amount is negative and proration is true, then it's an unused line item
  • If amount is positive and proration is true, then it's a remaining line item
ebon sun
#

Give me a sec to process your message ๐Ÿ˜…

#

That is a good strategy. The amount would always be negative for Unused time on... invoice item, right? Or is there any chance that it could get a positive value as well?

#

amount in the line items would not take the credit amount of the customer as well, right?

low pebble
#

The amount would always be negative for Unused time on... invoice item, right? Or is there any chance that it could get a positive value as well?
If the user has paid and it's unused, it's expected to be negative value

ebon sun
#

The user will definitely have paid earlier.

#

So I guess this will always be negative

#

I believe this is good for me. Thank you for your help @low pebble

#

Have a nice day ๐Ÿฅ‚

low pebble
#

No problem! Happy to help ๐Ÿ˜„