#estevanjantsk -invoice

1 messages · Page 1 of 1 (latest)

alpine trail
#

do you have an example of an Invoice in_xxx that you updated that way through the API?

oak glacier
#

yes

#

wait a sec

#

in_1LcolpCJhVNaesyVe0k0gWu1

alpine trail
#

days_until_due is not an actual field on the Invoice object. It's a parameter and the idea is it's a 'shortcut' and has the effect of setting due_date to a relevant timestamp

#

as for why due_date is null here, not sure yet, looking

oak glacier
#

yep that's what I was thinking and that makes sense. But the null tho

#

thanks karl

alpine trail
#

ah it's because the invoice is still draft

#

the date is only set when the invoice is finalized, and then the due_date becomes "time invoice was finalized + 7 days".

#

does that help @oak glacier ?

oak glacier
alpine trail
#

yep. And then when you finalize the invoice the value would get used. Do you see otherwise when you test?

oak glacier
#

hmm

#

in the dashboard even thought the invoice is still in draft mode

alpine trail
#

not sure I follow the question. Do you expect to not be able to see the draft invoice for some reason?

oak glacier
#

I will try to explain

#

I have this invoice X in draft mode. If I update this invoice X via api with days_until_due to 14 days. I will get due_date null (as you said because the invoice is in draft mode). But if I go to de dashboard to the invoice X page the invoice is in draft BUT I can see the due data as 14 days

#

so basically in the interface I get the due_date but via api I don't get the same data (because looks like I have to change the invoice status to finalised)

alpine trail
#

yeah the dashboard and the API are different really

oak glacier
#

🥺

alpine trail
#

why is it a problem exactly?

oak glacier
#

because I've been working in this webapp where I can create invoice

#

and edit them while they are on draft mode

alpine trail
#

are you saying that if you update days_until_due to 7 in the API then open the editor in the dashboard it says 14 like in your screenshot?

oak glacier
#

but when I change the due_date

#

I get null

alpine trail
oak glacier
#

So I can't see the current state of the due_date

alpine trail
#

I can see how that's annoying but it's not something that's likely to change unfortunately

oak glacier
#

No worries. All good Karl! I will see what I can do

#

thanks so much for you help