X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=d218ff6abced12df33ae5033f82973d887b42de8;hb=f5ab83507b71d551147835d84ec8317afd2842e9;hp=da33886a12e23d10b012e8775b6ddd919c30b36d;hpb=3c5e4df9e938a8f2c9b045774bda00095b976e49;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index da33886a1..d218ff6ab 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -471,7 +471,7 @@ selectcustomer}| $form->{fokus} = "arledger.customer"; # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { @@ -500,6 +500,10 @@ selectcustomer}| qq||; } + $form->{javascript} .= + qq|| . + qq||; + $form->header; $onload = qq|focus()|; $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; @@ -530,7 +534,7 @@ selectcustomer}| - + @@ -1015,7 +1019,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!')); @@ -1052,9 +1056,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); - $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('Zero amount posting!')) if $zero_amount_posting; $form->isblank("exchangerate", $locale->text('Exchangerate missing!')) if ($form->{currency} ne $form->{defaultcurrency}); @@ -1224,7 +1236,7 @@ sub search { $form->{javascript} .= qq||; # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { @@ -1295,6 +1307,10 @@ sub search { + + + + @@ -1371,6 +1387,8 @@ sub search { + +
| . $locale->text('Customer') . qq|$customer$customer | . $locale->text('Order Number') . qq|
| . $locale->text('Transaction description') . qq|
| . $locale->text('Notes') . qq| | . $locale->text('Subtotal') . qq| | . $locale->text('Project Number') . qq|| . $locale->text('Transaction description') . qq|
@@ -1446,6 +1464,12 @@ sub ar_transactions { $option .= "\n
" if $option; $option .= $locale->text('Notes') . " : $form->{notes}"; } + if ($form->{transaction_description}) { + $callback .= "&transaction_description=" . $form->escape($form->{transaction_description}, 1); + $href .= "&transaction_description=" . $form->escape($form->{transaction_description}); + $option .= "\n
" if $option; + $option .= $locale->text('Transaction description') . " : $form->{transaction_description}"; + } if ($form->{transdatefrom}) { $callback .= "&transdatefrom=$form->{transdatefrom}"; @@ -1482,7 +1506,7 @@ sub ar_transactions { @columns = qw(transdate id type invnumber ordnumber name netamount tax amount paid - datepaid due duedate notes employee shippingpoint shipvia + datepaid due duedate transaction_description notes employee shippingpoint shipvia globalprojectnumber); $form->{"l_type"} = "Y"; @@ -1558,6 +1582,8 @@ sub ar_transactions { . ""; $column_header{globalprojectnumber} = qq|| . $locale->text('Project Number') . qq||; + $column_header{transaction_description} = + "" . $locale->text('Transaction description') . ""; $form->{title} = $locale->text('AR Transactions'); @@ -1644,8 +1670,13 @@ sub ar_transactions { $column_data{invnumber} = "{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ar->{invnumber}"; + + my $is_storno = $ar->{storno} && ($ar->{invnumber} =~ /^Storno zu/); + my $has_storno = $ar->{storno} && !$is_storno; + $column_data{type} = "" . - ($ar->{storno} ? $locale->text("Storno (one letter abbreviation)") : + ($has_storno ? $locale->text("Invoice with Storno (abbreviation)") : + $is_storno ? $locale->text("Storno (one letter abbreviation)") : $ar->{amount} < 0 ? $locale->text("Credit note (one letter abbreviation)") : $ar->{invoice} ? $locale->text("Invoice (one letter abbreviation)") : $locale->text("AR Transaction (abbreviation)")) @@ -1659,6 +1690,8 @@ sub ar_transactions { $column_data{employee} = "$ar->{employee} "; $column_data{globalprojectnumber} = "" . H($ar->{globalprojectnumber}) . ""; + $column_data{transaction_description} = + "" . H($ar->{transaction_description}) . ""; $i++; $i %= 2;