Revision 289ea7d7
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
bin/mozilla/ar.pl | ||
---|---|---|
171 | 171 |
# build the popup menus |
172 | 172 |
$form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked"; |
173 | 173 |
|
174 |
map { |
|
175 |
$tax .= |
|
176 |
qq|<option value=\"$_->{id}--$_->{rate}\">$_->{taxdescription} | |
|
177 |
. ($_->{rate} * 100) . qq| %| |
|
178 |
} @{ $form->{TAX} }; |
|
179 |
$form->{taxchart} = $tax; |
|
180 |
$form->{selecttaxchart} = $tax; |
|
181 |
|
|
182 | 174 |
# forex |
183 | 175 |
$form->{forex} = $form->{exchangerate}; |
184 | 176 |
$exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1; |
... | ... | |
271 | 263 |
/<option value=\"($form->{acc_trans}{$key}->[$i-1]->{accno}--[^\"]*)\">$form->{acc_trans}{$key}->[$i-1]->{accno}--${q_description}<\/option>\n/; |
272 | 264 |
$form->{"${key}_$k"} = $1; |
273 | 265 |
if ($akey eq 'amount') { |
274 |
$form->{"taxchart_$k"} = $form->{taxchart}; |
|
275 |
$form->{"taxchart_$k"} =~ |
|
276 |
/<option value=\"($form->{acc_trans}{$key}->[$i-1]->{id}--[^\"]*)/; |
|
277 |
$form->{"taxchart_$k"} = $1; |
|
266 |
$form->{"taxchart_$k"} = $form->{acc_trans}{$key}->[$i-1]->{id} . |
|
267 |
"--" . $form->{acc_trans}{$key}->[$i-1]->{rate}; |
|
278 | 268 |
} |
279 | 269 |
} |
280 | 270 |
} |
... | ... | |
362 | 352 |
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; |
363 | 353 |
} |
364 | 354 |
$selectAR_amount_unquoted = $form->{selectAR_amount}; |
365 |
$taxchart = $form->{taxchart}; |
|
366 | 355 |
map { $form->{$_} =~ s/\"/"/g } |
367 |
qw(AR_amount selectAR_amount AR taxchart);
|
|
356 |
qw(AR_amount selectAR_amount AR); |
|
368 | 357 |
|
369 | 358 |
# format amounts |
370 | 359 |
$form->{exchangerate} = |
... | ... | |
443 | 432 |
|
444 | 433 |
$form->get_lists("projects" => { "key" => "ALL_PROJECTS", |
445 | 434 |
"all" => 0, |
446 |
"old_id" => \@old_project_ids }); |
|
435 |
"old_id" => \@old_project_ids }, |
|
436 |
"taxcharts" => "ALL_TAXCHARTS"); |
|
447 | 437 |
|
448 | 438 |
my %project_labels = (); |
449 | 439 |
my @project_values = (""); |
... | ... | |
452 | 442 |
$project_labels{$item->{"id"}} = $item->{"projectnumber"}; |
453 | 443 |
} |
454 | 444 |
|
445 |
my %taxchart_labels = (); |
|
446 |
my @taxchart_values = (); |
|
447 |
foreach my $item (@{ $form->{ALL_TAXCHARTS} }) { |
|
448 |
my $key = Q($item->{id}) . "--" . Q($item->{rate}); |
|
449 |
$taxchart_init = $key if ($taxchart_init eq $item->{taxkey}); |
|
450 |
push(@taxchart_values, $key); |
|
451 |
$taxchart_labels{$key} = H($item->{taxdescription}) . " " . |
|
452 |
H($item->{rate} * 100) . ' %'; |
|
453 |
} |
|
454 |
|
|
455 | 455 |
$form->{fokus} = "arledger.customer"; |
456 | 456 |
|
457 | 457 |
# use JavaScript Calendar or not |
... | ... | |
575 | 575 |
$jsscript |
576 | 576 |
<input type=hidden name=selectAR_amount value="$form->{selectAR_amount}"> |
577 | 577 |
<input type=hidden name=AR_amount value="$form->{AR_amount}"> |
578 |
<input type=hidden name=taxchart value="$form->{taxchart}"> |
|
579 | 578 |
<input type=hidden name=rowcount value=$form->{rowcount}> |
580 | 579 |
<tr> |
581 | 580 |
<td> |
... | ... | |
608 | 607 |
$selectAR_amount = $selectAR_amount_unquoted; |
609 | 608 |
$selectAR_amount =~ |
610 | 609 |
s/option value=\"$form->{"AR_amount_$i"}\"/option value=\"$form->{"AR_amount_$i"}\" selected/; |
611 |
$tax = $taxchart; |
|
612 |
$tax_selected = $form->{"taxchart_$i"}; |
|
613 |
$tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/; |
|
614 |
$tax = |
|
615 |
qq|<td><select id="taxchart_$i" name="taxchart_$i" style="width:200px">$tax</select></td>|; |
|
610 |
|
|
611 |
$tax = qq|<td>| . |
|
612 |
$cgi->popup_menu('-name' => "taxchart_$i", |
|
613 |
'-id' => "taxchart_$i", |
|
614 |
'-style' => 'width:200px', |
|
615 |
'-tabindex' => ($i + 10 + (($i - 1) * 8)), |
|
616 |
'-values' => \@taxchart_values, |
|
617 |
'-labels' => \%taxchart_labels, |
|
618 |
'-default' => $form->{"taxchart_$i"}) |
|
619 |
. qq|</td>|; |
|
620 |
|
|
616 | 621 |
$korrektur_checked = ($form->{"korrektur_$i"} ? 'checked' : ''); |
617 | 622 |
|
618 | 623 |
my $projectnumber = |
... | ... | |
866 | 871 |
|
867 | 872 |
my $display = shift; |
868 | 873 |
|
869 |
# if ($display) { |
|
870 |
# goto TAXCALC; |
|
871 |
# } |
|
872 |
|
|
873 | 874 |
$form->{invtotal} = 0; |
874 | 875 |
|
875 |
# $form->{selectAR_amount} = $form->{AR_amount}; |
|
876 |
# $form->{selectAR_amount} =~ |
|
877 |
# s/value=\"$form->{AR_amountselected}\"/value=\"$form->{AR_amountselected}\" selected/; |
|
878 |
|
|
879 |
($AR_amountaccno, $AR_amounttaxkey) = |
|
880 |
split(/--/, $form->{AR_amountselected}); |
|
881 |
$form->{selecttaxchart} = $form->{taxchart}; |
|
882 |
$form->{selecttaxchart} =~ |
|
883 |
s/value=\"$AR_amounttaxkey--([^\"]*)\"/value=\"$AR_amounttaxkey--$1\" selected/; |
|
884 |
|
|
885 |
$form->{rate} = $1; |
|
886 |
|
|
887 | 876 |
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } |
888 | 877 |
qw(exchangerate creditlimit creditremaining); |
889 | 878 |
|
... | ... | |
1043 | 1032 |
} |
1044 | 1033 |
|
1045 | 1034 |
my ($creditaccno, $credittaxkey) = split /--/, $form->{AR_amountselected}; |
1046 |
my ($taxkey, $NULL) = split /--/, $form->{taxchartselected}; |
|
1047 | 1035 |
my ($receivablesaccno, $payablestaxkey) = split /--/, $form->{ARselected}; |
1048 | 1036 |
$form->{AR}{amount_1} = $creditaccno; |
1049 | 1037 |
$form->{AR}{receivables} = $receivablesaccno; |
1050 |
$form->{taxkey} = $taxkey; |
|
1051 | 1038 |
|
1052 | 1039 |
$form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber") |
1053 | 1040 |
unless $form->{invnumber}; |
Auch abrufbar als: Unified diff
Debitorenrechnungen: Drop-Down-Box für Steuerschlüssel bei jedem Formularaufruf aus der Datenbank aufbauen und nicht mehr in versteckten Form-Feldern mitschleppen.