X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fap.pl;h=9c71519c0a254ed72e0564e4822fa2096970d881;hb=f5ab83507b71d551147835d84ec8317afd2842e9;hp=b0ab9905c6d11eec3eba6d4c363cbad912afab5f;hpb=c3c5403ce5f3cdccd51120537b6e01021f1ec712;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index b0ab9905c..9c71519c0 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -93,9 +93,6 @@ sub add { sub edit { $lxdebug->enter_sub(); - # show history button - $form->{javascript} = qq||; - #/show hhistory button $form->{title} = "Edit"; @@ -319,6 +316,9 @@ sub form_header { }; //--> |; + # show history button + $form->{javascript} .= qq||; + #/show hhistory button # set option selected foreach $item (qw(vendor currency department)) { @@ -455,7 +455,7 @@ selectvendor } | } # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { @@ -484,6 +484,8 @@ selectvendor } | qq|
| . $locale->text('Vendor') . qq| | -$vendor | +$vendor | @@ -880,11 +882,11 @@ sub form_footer { # button for saving history if($form->{id} ne "") { print qq| - |; } # /button for saving history print " @@ -991,7 +993,7 @@ sub update { sub post_payment { $lxdebug->enter_sub(); for $i (1 .. $form->{paidaccounts}) { - if ($form->{"paid_$i"}) { + if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) { $datepaid = $form->datetonum($form->{"datepaid_$i"}, \%myconfig); $form->isblank("datepaid_$i", $locale->text('Payment date missing!')); @@ -1029,9 +1031,17 @@ sub post { $closedto = $form->datetonum($form->{closedto}, \%myconfig); $transdate = $form->datetonum($form->{transdate}, \%myconfig); + $form->error($locale->text('Cannot post transaction for a closed period!')) if ($transdate <= $closedto); + + my $zero_amount_posting = 1; + for $i (1 .. $form->{rowcount}) { + if ($form->parse_amount(\%myconfig, $form->{"amount_$i"})) { + $zero_amount_posting = 0; + last; + } + } - $form->error($locale->text('Cannot post transaction for a closed period!')) - if ($transdate <= $closedto); + $form->error($locale->text('Zero amount posting!')) if $zero_amount_posting; $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) if ($form->{currency} ne $form->{defaultcurrency}); @@ -1204,7 +1214,7 @@ sub search { $form->{title} = $locale->text('AP Transactions'); # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { @@ -1456,9 +1466,11 @@ sub ap_transactions { } @columns = - qw(transdate id invnumber ordnumber name netamount tax amount paid datepaid + qw(transdate id type invnumber ordnumber name netamount tax amount paid datepaid due duedate notes employee globalprojectnumber); + $form->{"l_type"} = "Y"; + foreach $item (@columns) { if ($form->{"l_$item"} eq "Y") { push @column_index, $item; @@ -1482,6 +1494,8 @@ sub ap_transactions { qq|| . $locale->text('Date') . qq| | |; + $column_header{type} = + "" . $locale->text('Type') . " | "; $column_header{duedate} = qq|| . $locale->text('Due Date') @@ -1596,6 +1610,10 @@ sub ap_transactions { $subtotaldue += ($ap->{amount} - $ap->{paid}); $column_data{transdate} = " | $ap->{transdate} | "; + $column_data{type} = "" . + ($ap->{invoice} ? $locale->text("Invoice (one letter abbreviation)") : + $locale->text("AP Transaction (abbreviation)")) + . " | "; $column_data{duedate} = "$ap->{duedate} | "; $column_data{datepaid} = "$ap->{datepaid} | ";
---|