Revision 50133d13
Von Sven Schöling vor fast 11 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
80 | 80 |
|
81 | 81 |
my $vc = $form->{vc} eq "customer" ? "customer" : "vendor"; |
82 | 82 |
|
83 |
my %billed_amount; |
|
84 |
my %billed_netamount; |
|
85 |
if ($form->{l_remaining_amount} || $form->{l_remaining_netamount}) { |
|
86 |
$query = <<''; |
|
87 |
SELECT from_id, ar.amount, ar.netamount FROM ( |
|
88 |
SELECT from_id, to_id |
|
89 |
FROM record_links |
|
90 |
WHERE from_table = 'oe' AND to_table = 'ar' |
|
91 |
UNION |
|
92 |
SELECT rl1.from_id, rl2.to_id |
|
93 |
FROM record_links rl1 |
|
94 |
LEFT JOIN record_links rl2 ON (rl1.to_table = rl2.from_table AND rl1.to_id = rl2.from_id) |
|
95 |
WHERE rl1.from_table = 'oe' AND rl2.to_table = 'ar' |
|
96 |
) rl |
|
97 |
LEFT JOIN ar ON ar.id = rl.to_id |
|
98 |
|
|
99 |
for my $ref (@{ selectall_hashref_query($form, $dbh, $query) }) { |
|
100 |
$billed_amount{ $ref->{from_id}} += $ref->{amount}; |
|
101 |
$billed_netamount{$ref->{from_id}} += $ref->{netamount}; |
|
102 |
} |
|
103 |
} |
|
104 |
|
|
83 | 105 |
$query = |
84 | 106 |
qq|SELECT o.id, o.ordnumber, o.transdate, o.reqdate, | . |
85 | 107 |
qq| o.amount, ct.${vc}number, ct.name, o.netamount, o.${vc}_id, o.globalproject_id, | . |
... | ... | |
249 | 271 |
my %id = (); |
250 | 272 |
$form->{OE} = []; |
251 | 273 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { |
274 |
$ref->{billed_amount} = $billed_amount{$ref->{id}}; |
|
275 |
$ref->{billed_netamount} = $billed_netamount{$ref->{id}}; |
|
276 |
$ref->{remaining_amount} = $ref->{amount} - $ref->{billed_amount}; |
|
277 |
$ref->{remaining_netamount} = $ref->{netamount} - $ref->{billed_netamount}; |
|
252 | 278 |
$ref->{exchangerate} = 1 unless $ref->{exchangerate}; |
253 | 279 |
push @{ $form->{OE} }, $ref if $ref->{id} != $id{ $ref->{id} }; |
254 | 280 |
$id{ $ref->{id} } = $ref->{id}; |
bin/mozilla/oe.pl | ||
---|---|---|
790 | 790 |
"cusordnumber", "customernumber", |
791 | 791 |
"name", "netamount", |
792 | 792 |
"tax", "amount", |
793 |
"remaining_netamount", "remaining_amount", |
|
793 | 794 |
"curr", "employee", |
794 | 795 |
"salesman", |
795 | 796 |
"shipvia", "globalprojectnumber", |
... | ... | |
857 | 858 |
'netamount' => { 'text' => $locale->text('Amount'), }, |
858 | 859 |
'tax' => { 'text' => $locale->text('Tax'), }, |
859 | 860 |
'amount' => { 'text' => $locale->text('Total'), }, |
861 |
'remaining_amount' => { 'text' => $locale->text('Remaining Amount'), }, |
|
862 |
'remaining_netamount' => { 'text' => $locale->text('Remaining Net Amount'), }, |
|
860 | 863 |
'curr' => { 'text' => $locale->text('Curr'), }, |
861 | 864 |
'employee' => { 'text' => $locale->text('Employee'), }, |
862 | 865 |
'salesman' => { 'text' => $locale->text('Salesman'), }, |
... | ... | |
880 | 883 |
$column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir"; |
881 | 884 |
} |
882 | 885 |
|
883 |
my %column_alignment = map { $_ => 'right' } qw(netamount tax amount curr); |
|
886 |
my %column_alignment = map { $_ => 'right' } qw(netamount tax amount curr remaining_amount remaining_netamount);
|
|
884 | 887 |
|
885 | 888 |
$form->{"l_type"} = "Y"; |
886 | 889 |
map { $column_defs{$_}->{visible} = $form->{"l_${_}"} ? 1 : 0 } @columns; |
... | ... | |
942 | 945 |
# escape callback for href |
943 | 946 |
my $callback = $form->escape($href); |
944 | 947 |
|
945 |
my @subtotal_columns = qw(netamount amount marge_total marge_percent); |
|
948 |
my @subtotal_columns = qw(netamount amount marge_total marge_percent remaining_amount remaining_netamount);
|
|
946 | 949 |
|
947 | 950 |
my %totals = map { $_ => 0 } @subtotal_columns; |
948 | 951 |
my %subtotals = map { $_ => 0 } @subtotal_columns; |
... | ... | |
965 | 968 |
$subtotals{marge_percent} = $subtotals{netamount} ? ($subtotals{marge_total} * 100 / $subtotals{netamount}) : 0; |
966 | 969 |
$totals{marge_percent} = $totals{netamount} ? ($totals{marge_total} * 100 / $totals{netamount} ) : 0; |
967 | 970 |
|
968 |
map { $oe->{$_} = $form->format_amount(\%myconfig, $oe->{$_}, 2) } qw(netamount tax amount marge_total marge_percent); |
|
971 |
map { $oe->{$_} = $form->format_amount(\%myconfig, $oe->{$_}, 2) } qw(netamount tax amount marge_total marge_percent remaining_amount remaining_netamount);
|
|
969 | 972 |
|
970 | 973 |
my $row = { }; |
971 | 974 |
|
locale/de/all | ||
---|---|---|
923 | 923 |
'Ertrag' => 'Ertrag', |
924 | 924 |
'Ertrag prozentual' => 'Ertrag prozentual', |
925 | 925 |
'Escape character' => 'Escape-Zeichen', |
926 |
'Etikett' => '', |
|
926 | 927 |
'EuR' => 'EuR', |
927 | 928 |
'Everyone can log in.' => 'Alle können sich anmelden.', |
928 | 929 |
'Exact' => 'Genau', |
... | ... | |
1515 | 1516 |
'PRINTED' => 'Gedruckt', |
1516 | 1517 |
'Package name' => 'Paketname', |
1517 | 1518 |
'Packing Lists' => 'Lieferschein', |
1519 |
'Packliste' => '', |
|
1518 | 1520 |
'Page' => 'Seite', |
1519 | 1521 |
'Page #1/#2' => 'Seite #1/#2', |
1520 | 1522 |
'Paid' => 'bezahlt', |
... | ... | |
1536 | 1538 |
'Parts must have an entry type.' => 'Waren müssen eine Buchungsgruppe haben.', |
1537 | 1539 |
'Parts with existing part numbers' => 'Artikel mit existierender Artikelnummer', |
1538 | 1540 |
'Parts, services and assemblies' => 'Waren, Dienstleistungen und Erzeugnisse', |
1541 |
'Partsedit' => '', |
|
1539 | 1542 |
'Partsgroup (database ID)' => 'Warengruppe (Datenbank-ID)', |
1540 | 1543 |
'Partsgroup (name)' => 'Warengruppe (Name)', |
1541 | 1544 |
'Password' => 'Passwort', |
... | ... | |
1744 | 1747 |
'Reference missing!' => 'Referenz fehlt!', |
1745 | 1748 |
'Release From Stock' => 'Lagerausgang', |
1746 | 1749 |
'Remaining' => 'Rest', |
1750 |
'Remaining Amount' => 'abzurechnender Betrag', |
|
1751 |
'Remaining Net Amount' => 'abzurechnender Nettobetrag', |
|
1747 | 1752 |
'Remittance information prefix' => 'Verwendungszweckvorbelegung (Präfix)', |
1748 | 1753 |
'Removal' => 'Entnahme', |
1749 | 1754 |
'Removal from Warehouse' => 'Lagerentnahme', |
templates/webpages/oe/search.html | ||
---|---|---|
250 | 250 |
<label for="l_salesman">[% 'Salesman' | $T8 %]</label> |
251 | 251 |
</td> |
252 | 252 |
</tr> |
253 |
<tr> |
|
254 |
<td> |
|
255 |
<input name="l_remaining_amount" id="l_remaining_amount" class="checkbox" type="checkbox" value="Y"> |
|
256 |
<label for="l_remaining_amount">[% 'Remaining Amount' | $T8 %]</label> |
|
257 |
</td> |
|
258 |
<td> |
|
259 |
<input name="l_remaining_netamount" id="l_remaining_netamount" class="checkbox" type="checkbox" value="Y"> |
|
260 |
<label for="l_remaining_netamount">[% 'Remaining Net Amount' | $T8 %]</label> |
|
261 |
</td> |
|
262 |
</tr> |
|
253 | 263 |
<tr> |
254 | 264 |
<td colspan=4 align=left><b>[% HTML.escape(vclabel) %]</td> |
255 | 265 |
</tr> |
Auch abrufbar als: Unified diff
Offene Restbeträge optional in Auftragsbericht anzeigen