Fix meta transaction undef error

This commit is contained in:
Tom Bloor 2019-07-14 16:05:35 +01:00
parent 7d862290d3
commit 39aa2d2083
No known key found for this signature in database
GPG key ID: 4657C7EBE42CC5CC

View file

@ -55,9 +55,16 @@ sub post_transaction_list_purchases {
seller => $_->seller->name, seller => $_->seller->name,
value => $_->value / 100000, value => $_->value / 100000,
purchase_time => $c->format_iso_datetime($_->purchase_time), purchase_time => $c->format_iso_datetime($_->purchase_time),
( $_->meta ? (
net_value => $_->meta->net_value / 100000, net_value => $_->meta->net_value / 100000,
sales_tax_value => $_->meta->sales_tax_value / 100000, sales_tax_value => $_->meta->sales_tax_value / 100000,
gross_value => $_->meta->gross_value / 100000, gross_value => $_->meta->gross_value / 100000,
) : (
net_value => undef,
sales_tax_value => undef,
gross_value => undef,
)),
}} $transactions->all }} $transactions->all
); );