<% use Mojo::JSON qw/decode_json/; my @model = grep { $_->{'uuid'} eq $app->{'model'} } @{$models}; my $model = $model[0]; %> <% if ($app->{'movement'} ne 'transfer') { %> <% my $add = $app->{'data'}->{$app->{'movement'}}; %> <% if ( scalar keys %{$add} == 0 ) { $add = { &subs::random_string_creator(7) => $app }; } %> <% foreach my $adder ( keys %{$add} ) { %> <% next if $adder eq 'totals'; %> <% my $ad = $add->{$adder}; %>
Movement: <%= &subs::format_name($app->{'movement'}) %>
Account: <%= &subs::format_name($app->{'account'}) %>
{'item'}) { %> Item: <%= &subs::format_name($model->{'name'} || $ad->{'item'}) %>
<% } %> <% if ($ad->{'manufacturer'}) { %> Manufacturer: <%= &subs::format_name($ad->{'manufacturer'}) %>
<% } %> <% if ($app->{'vendor'}) { %> Vendor: <%= &subs::format_name($app->{'vendor'}) %>
<% } %> <% if ($ad->{'packaging'}) { %> Packaging: <%= &subs::format_name($ad->{'packaging'}) %>
<% } %> State: <%= &subs::format_name($ad->{'state'}) %>
Quantity: <%= $ad->{'quantity'} %>
<% if ($ad->{'unit'} ne $ad->{'app'}) { %> Unit: <%= $ad->{'unit'} %>
<% } %> Tax: <%= &subs::price_formatter($ad->{'tax'} || 0.00) %>
<% if ($ad->{'aux'} && $ad->{'aux'} != 0) { %> Aux: <%= &subs::price_formatter($ad->{'aux'} || 0.00) %>
Aux Desc: <%= $ad->{'aux_description'} %>
<% } %> <% if ($ad->{'quantity'} > 1) { %>
AmountTaxAuxTotal
<%= &subs::price_formatter($ad->{'amount'} / $ad->{'quantity'}) %> <%= &subs::price_formatter($ad->{'tax'} / $ad->{'quantity'}) %> <%= &subs::price_formatter($ad->{'aux'} / $ad->{'quantity'}) %> <%= &subs::price_formatter($ad->{'total'} / $ad->{'quantity'}) %>
<% } %> Amount: <%= &subs::price_formatter($ad->{'amount'}) %>
Total <%= &subs::price_formatter($ad->{'total'} || 0.00) %>
<% } %> <% if ($app->{'documentation'}) { %> Note: <%= $app->{'documentation'} %>
<% } %> <% } %>