Revision fa8921ca
Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt
bin/mozilla/ic.pl | ||
---|---|---|
1685 | 1685 |
); |
1686 | 1686 |
|
1687 | 1687 |
map { $column_defs{$_}->{visible} = $form->{"l_$_"} ? 1 : 0 } @columns; |
1688 |
|
|
1689 |
my %column_alignment = map { $_ => 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal); |
|
1688 |
map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal); |
|
1690 | 1689 |
|
1691 | 1690 |
my @hidden_variables = (qw(l_subtotal l_linetotal searchitems itemstatus bom), @itemstatus_keys, @callback_keys, map { "l_$_" } @columns); |
1692 | 1691 |
my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables); |
... | ... | |
1729 | 1728 |
my %subtotals = map { $_ => 0 } ('onhand', @subtotal_columns); |
1730 | 1729 |
my %totals = map { $_ => 0 } @subtotal_columns; |
1731 | 1730 |
my $idx = 0; |
1731 |
my $same_item = $form->{parts}->[0]->{ $form->{sort} } if (scalar @{ $form->{parts} }); |
|
1732 | 1732 |
|
1733 | 1733 |
foreach my $ref (@{ $form->{parts} }) { |
1734 |
my $row = { }; |
|
1735 |
|
|
1736 |
foreach (@columns) { |
|
1737 |
$row->{$_} = { |
|
1738 |
'align' => $column_alignment{$_}, |
|
1739 |
'data' => $ref->{$_}, |
|
1740 |
}; |
|
1741 |
} |
|
1734 |
my $row = { map { $_ => { 'data' => $ref->{$_} } } @columns }; |
|
1742 | 1735 |
|
1743 | 1736 |
$ref->{exchangerate} = 1 unless $ref->{exchangerate}; |
1744 | 1737 |
$ref->{sellprice} *= $ref->{exchangerate}; |
... | ... | |
1795 | 1788 |
|
1796 | 1789 |
if (($form->{l_subtotal} eq 'Y') && |
1797 | 1790 |
(!$next_ref || |
1798 |
(!$next_ref->{assemblyitem} && ($ref->{$form->{sort}} ne $next_ref->{$form->{sort}})))) {
|
|
1799 |
my $row = { map { $_ => { 'class' => 'listsubtotal', 'align' => 'right' } } @columns };
|
|
1791 |
(!$next_ref->{assemblyitem} && ($same_item ne $next_ref->{ $form->{sort} })))) {
|
|
1792 |
my $row = { map { $_ => { 'class' => 'listsubtotal', } } @columns }; |
|
1800 | 1793 |
|
1801 | 1794 |
if (($form->{searchitems} ne 'assembly') || !$form->{bom}) { |
1802 | 1795 |
$row->{onhand}->{data} = $form->format_amount(\%myconfig, $subtotals{onhand}); |
... | ... | |
1806 | 1799 |
map { $subtotals{$_} = 0 } ('onhand', @subtotal_columns); |
1807 | 1800 |
|
1808 | 1801 |
$report->add_data($row); |
1802 |
|
|
1803 |
$same_item = $next_ref->{ $form->{sort} }; |
|
1809 | 1804 |
} |
1810 | 1805 |
|
1811 | 1806 |
$idx++; |
1812 | 1807 |
} |
1813 | 1808 |
|
1814 | 1809 |
if ($form->{"l_linetotal"}) { |
1815 |
my $row = { map { $_ => { 'class' => 'listtotal', 'align' => 'right' } } @columns };
|
|
1810 |
my $row = { map { $_ => { 'class' => 'listtotal', } } @columns }; |
|
1816 | 1811 |
|
1817 | 1812 |
map { $row->{"linetotal$_"}->{data} = $form->format_amount(\%myconfig, $totals{$_}, 2) } @subtotal_columns; |
1818 | 1813 |
|
Auch abrufbar als: Unified diff
Standard-Alignment von ReportGenerator benutzen.