@@ -603,11 +607,17 @@ $jsscript
$selectAR_amount = $selectAR_amount_unquoted;
$selectAR_amount =~
s/option value=\"$form->{"AR_amount_$i"}\"/option value=\"$form->{"AR_amount_$i"}\" selected/;
- $tax = $taxchart;
- $tax_selected = $form->{"taxchart_$i"};
- $tax =~ s/value=\"$tax_selected\"/value=\"$tax_selected\" selected/;
- $tax =
- qq| | | |;
+
+ $tax = qq|| .
+ $cgi->popup_menu('-name' => "taxchart_$i",
+ '-id' => "taxchart_$i",
+ '-style' => 'width:200px',
+ '-tabindex' => ($i + 10 + (($i - 1) * 8)),
+ '-values' => \@taxchart_values,
+ '-labels' => \%taxchart_labels,
+ '-default' => $form->{"taxchart_$i"})
+ . qq| | |;
+
$korrektur_checked = ($form->{"korrektur_$i"} ? 'checked' : '');
my $projectnumber =
@@ -789,6 +799,10 @@ sub form_footer {
{path}>
{login}>
{password}>
+|
+. $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}])
+. $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}])
+. qq|
|;
@@ -822,7 +836,9 @@ sub form_footer {
} else {
if ($transdate > $closedto) {
print qq||;
+ . $locale->text('Post') . qq|"> | .
+ NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'),
+ '-class' => 'submit'));
}
}
@@ -855,24 +871,8 @@ sub update {
my $display = shift;
- # if ($display) {
- # goto TAXCALC;
- # }
-
$form->{invtotal} = 0;
- # $form->{selectAR_amount} = $form->{AR_amount};
- # $form->{selectAR_amount} =~
- # s/value=\"$form->{AR_amountselected}\"/value=\"$form->{AR_amountselected}\" selected/;
-
- ($AR_amountaccno, $AR_amounttaxkey) =
- split(/--/, $form->{AR_amountselected});
- $form->{selecttaxchart} = $form->{taxchart};
- $form->{selecttaxchart} =~
- s/value=\"$AR_amounttaxkey--([^\"]*)\"/value=\"$AR_amounttaxkey--$1\" selected/;
-
- $form->{rate} = $1;
-
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
qw(exchangerate creditlimit creditremaining);
@@ -1032,11 +1032,9 @@ sub post {
}
my ($creditaccno, $credittaxkey) = split /--/, $form->{AR_amountselected};
- my ($taxkey, $NULL) = split /--/, $form->{taxchartselected};
my ($receivablesaccno, $payablestaxkey) = split /--/, $form->{ARselected};
$form->{AR}{amount_1} = $creditaccno;
$form->{AR}{receivables} = $receivablesaccno;
- $form->{taxkey} = $taxkey;
$form->{invnumber} = $form->update_defaults(\%myconfig, "invnumber")
unless $form->{invnumber};
@@ -1049,6 +1047,7 @@ sub post {
$form->save_history($form->dbconnect(\%myconfig));
}
# /saving the history
+ remove_draft() if $form->{remove_draft};
$form->redirect($locale->text('Transaction posted!'));
}
$form->error($locale->text('Cannot post transaction!'));