X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fap.pl;h=f8822930908a67562cb7bc5b491a32d0fc3cb464;hb=1163cee7d5cfe9355a9d231ac544ce0943623d77;hp=070748b1ae50842460fb0c218d972636a5b5676e;hpb=58265754620f2c93d858a062eadfd3e16812099c;p=kivitendo-erp.git diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 070748b1a..f88229309 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -427,7 +427,7 @@ selectvendor } |
| . $locale->text('Vendor') . qq| | -$vendor | +$vendor | @@ -638,7 +638,7 @@ $jsscript $column_data{AP_paid} = "" . $locale->text('Account') . " | "; $column_data{source} = "" . $locale->text('Source') . " | "; $column_data{memo} = "" . $locale->text('Memo') . " | "; - $column_data{paid_project_id} = "" . $locale->text('Project Number') . " | "; + $column_data{paid_project_id} = "" . $locale->text('Project Number') . " | "; print "||||
---|---|---|---|---|---|---|---|---|---|---|---|
$exchangerate | |; $column_data{"datepaid_$i"} = qq|- | |; + |; $column_data{"source_$i"} = qq||; $column_data{"memo_$i"} = @@ -800,10 +800,9 @@ $follow_ups_block |; } - # ToDO: - insert a global check for stornos, so that a storno is only possible a limited time after saving it print qq| | - if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap', $form->{id})); + if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ap') && !IS->is_storno(\%myconfig, $form, 'ap', $form->{id}) && (($total_paid == 0) || ($total_paid eq ""))); print qq| @@ -819,8 +818,8 @@ $follow_ups_block print qq| |; } # /button for saving history - # mark_as_paid button - if($form->{id} ne "") { + # mark_as_paid button + if($form->{id} ne "") { print qq| |; } # /mark_as_paid button @@ -839,7 +838,7 @@ sub mark_as_paid { $auth->assert('general_ledger'); - &mark_as_paid_common(\%myconfig,"ap"); + &mark_as_paid_common(\%myconfig,"ap"); $lxdebug->leave_sub(); } @@ -853,10 +852,12 @@ sub update { $form->{invtotal} = 0; + delete @{ $form }{ grep { m/^tax_\d+$/ } keys %{ $form } }; + map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) } qw(exchangerate creditlimit creditremaining); - @flds = qw(amount AP_amount projectnumber oldprojectnumber project_id); + @flds = qw(amount AP_amount projectnumber oldprojectnumber project_id taxchart); $count = 0; for $i (1 .. $form->{rowcount}) { $form->{"amount_$i"} = @@ -890,9 +891,16 @@ sub update { $form->{exchangerate} = $form->{forex} if $form->{forex}; $form->{invdate} = $form->{transdate}; - $save_AP = $form->{AP}; - &check_name("vendor"); - $form->{AP} = $save_AP; + my %saved_variables = map +( $_ => $form->{$_} ), qw(AP AP_amount_1 taxchart_1); + + my $vendor_changed = &check_name("vendor"); + + $form->{AP} = $saved_variables{AP}; + if ($saved_variables{AP_amount_1} =~ m/.--./) { + map { $form->{$_} = $saved_variables{$_} } qw(AP_amount_1 taxchart_1); + } else { + delete $form->{taxchart_1}; + } $form->{rowcount} = $count + 1; @@ -920,7 +928,7 @@ sub update { $form->{oldtotalpaid} = $totalpaid; # notes - $form->{notes} = $form->{intnotes}; + $form->{notes} = $form->{intnotes} if $vendor_changed; &display_form; @@ -1034,7 +1042,7 @@ sub post { $form->{addition} = "POSTED"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history + # /saving the history remove_draft() if $form->{remove_draft}; $form->redirect($locale->text('Transaction posted!')); } @@ -1055,7 +1063,7 @@ sub post_as_new { $form->{addition} = "POSTED AS NEW"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history + # /saving the history &post; $lxdebug->leave_sub(); @@ -1128,7 +1136,7 @@ sub yes { $form->{addition} = "DELETED"; $form->save_history($form->dbconnect(\%myconfig)); } - # /saving the history + # /saving the history $form->redirect($locale->text('Transaction deleted!')); } $form->error($locale->text('Cannot delete transaction!')); @@ -1318,6 +1326,25 @@ sub search { | | . $locale->text('Project Number') . qq| | ||||||||
| . $locale->text('Vendor') . qq| | +|||||||||||
+ | | . $locale->text('Vendor Number') . qq| | ++ | | . $locale->text('Country') . qq| | ++ | | . $locale->text('USt-IdNr.') . qq| | ++ | | . $locale->text('Steuersatz') . qq| | +||||
+ | | . $locale->text('Payment Terms') . qq| | ++ | | . $locale->text('Buchungskonto') . qq| | +