X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=d218ff6abced12df33ae5033f82973d887b42de8;hb=7d03f2419db86592947fc2526a21c2bf34aa97d0;hp=05c541b6163564258601d55b5092ba986923d1cf;hpb=a0f6a00c1db8152633841777a95f5420b56b42ee;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 05c541b61..d218ff6ab 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -36,7 +36,7 @@ use SL::IS; use SL::PE; use Data::Dumper; -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 { # saving the history if(!exists $form->{addition} && ($form->{id} ne "")) { - $form->{snumber} = qq|invnumber_| . $form->{invnumber}; + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "ADDED"; $form->save_history($form->dbconnect(\%myconfig)); } @@ -87,7 +87,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}; AR->get_transdate(\%myconfig, $form); @@ -471,18 +471,18 @@ selectcustomer}| $form->{fokus} = "arledger.customer"; # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { # with JavaScript Calendar $button1 = qq| -
| . $locale->text('Customer') . qq| | -$customer | +$customer | @@ -790,12 +794,12 @@ $jsscript |; $column_data{paid} = - qq|{"paid_$i"} onBlur=\"check_right_number_format(this)\"> | |; + qq||; $column_data{AR_paid} = qq| | ${selectAR_paid} | |; $column_data{exchangerate} = qq|$exchangerate | |; $column_data{datepaid} = - qq|{"datepaid_$i"} onBlur=\"check_right_date_format(this)\"> + qq| | |; $column_data{source} = qq| | |; @@ -843,7 +847,6 @@ sub form_footer { -{path}> {login}> {password}> | @@ -899,7 +902,7 @@ sub form_footer { } if ($form->{menubar}) { - require "$form->{path}/menu.pl"; + require "bin/mozilla/menu.pl"; &menubar; } # button for saving history @@ -1016,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!')); @@ -1053,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}); @@ -1093,7 +1104,7 @@ sub post { if (AR->post_transaction(\%myconfig, \%$form)) { # saving the history if(!exists $form->{addition} && $form->{id} ne "") { - $form->{snumber} = qq|invnumber_| . $form->{invnumber}; + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "POSTED"; $form->save_history($form->dbconnect(\%myconfig)); } @@ -1112,7 +1123,7 @@ sub post_as_new { $form->{postasnew} = 1; # saving the history if(!exists $form->{addition} && $form->{id} ne "") { - $form->{snumber} = qq|invnumber_| . $form->{invnumber}; + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "POSTED AS NEW"; $form->save_history($form->dbconnect(\%myconfig)); } @@ -1177,7 +1188,7 @@ sub yes { if (AR->delete_transaction(\%myconfig, \%$form, $spool)) { # saving the history if(!exists $form->{addition}) { - $form->{snumber} = qq|invnumber_| . $form->{invnumber}; + $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "DELETED"; $form->save_history($form->dbconnect(\%myconfig)); } @@ -1225,7 +1236,7 @@ sub search { $form->{javascript} .= qq||; # use JavaScript Calendar or not - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { @@ -1296,6 +1307,10 @@ sub search { | | . $locale->text('Order Number') . qq| | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| . $locale->text('Transaction description') . qq| | ++ | ||||||||||||||||
| . $locale->text('Notes') . qq| | @@ -1372,6 +1387,8 @@ sub search { | | . $locale->text('Subtotal') . qq| | | . $locale->text('Project Number') . qq| | ++ | | . $locale->text('Transaction description') . qq| |