X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fap.pl;h=9c71519c0a254ed72e0564e4822fa2096970d881;hb=7d03f2419db86592947fc2526a21c2bf34aa97d0;hp=22fc65cfa284951bcd1f1e50d9ecc2bae312a959;hpb=8cef58b276ce4005c0e2ada350fecd5d7a103e89;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 22fc65cfa..9c71519c0 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -35,7 +35,7 @@ use SL::AP; use SL::IR; use SL::PE; -require "$form->{path}/arap.pl"; +require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; require "bin/mozilla/drafts.pl"; @@ -79,7 +79,7 @@ sub add { $form->{title} = "Add"; $form->{callback} = - "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" + "$form->{script}?action=add&login=$form->{login}&password=$form->{password}" unless $form->{callback}; AP->get_transdate(\%myconfig, $form); @@ -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,18 +455,18 @@ selectvendor } | } # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { # with JavaScript Calendar $button1 = qq| -
| . $locale->text('Vendor') . qq| | -$vendor | +$vendor | @@ -776,12 +778,12 @@ $jsscript |; $column_data{"paid_$i"} = - qq|{"paid_$i"} onBlur=\"check_right_number_format(this)\"> | |; + qq||; $column_data{"AP_paid_$i"} = qq| | ${selectAP_paid} | |; $column_data{"exchangerate_$i"} = qq|$exchangerate | |; $column_data{"datepaid_$i"} = - qq|{"datepaid_$i"} onBlur=\"check_right_date_format(this)\"> + qq| | |; $column_data{"source_$i"} = qq| | |; @@ -826,7 +828,6 @@ sub form_footer { -{path}> {login}> {password}> | @@ -881,11 +882,11 @@ sub form_footer { # button for saving history if($form->{id} ne "") { print qq| - |; } # /button for saving history print " @@ -992,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!')); @@ -1030,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}); @@ -1205,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}) { @@ -1366,7 +1375,6 @@ $jsscript | | . $locale->text('Date') . qq| | |; + $column_header{type} = + "" . $locale->text('Type') . " | "; $column_header{duedate} = qq|| . $locale->text('Due Date') @@ -1598,13 +1610,17 @@ 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} | "; $module = ($ap->{invoice}) ? "ir.pl" : $form->{script}; $column_data{invnumber} = - qq|$ap->{invnumber} | |; + qq|$ap->{invnumber} | |; $column_data{id} = "$ap->{id} | "; $column_data{ordnumber} = "$ap->{ordnumber} | "; $column_data{name} = "$ap->{name} | "; @@ -1673,7 +1689,6 @@ sub ap_transactions { -{path}> {login}> {password}>
---|