X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Far.pl;h=28c8efbab54d4f6a9a6d062cd63177e0e5db48c8;hb=c23e2dfa11947598925712a78d8bd9066d87900e;hp=e299d90a9254144f922ab20c022fbf0575dbff2c;hpb=6c7fdf43ade0e2e5cc82eca47eeb850424b896b1;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index e299d90a9..28c8efbab 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -140,6 +140,12 @@ sub display_form { $main::lxdebug->leave_sub(); } +sub _retrieve_invoice_object { + return undef if !$::form->{id}; + return $::form->{invoice_obj} if $::form->{invoice_obj} && $::form->{invoice_obj}->id == $::form->{id}; + return SL::DB::Invoice->new(id => $::form->{id})->load; +} + sub create_links { $main::lxdebug->enter_sub(); @@ -150,7 +156,7 @@ sub create_links { my %myconfig = %main::myconfig; $form->create_links("AR", \%myconfig, "customer"); - $form->{invoice_obj} = $form->{id} ? SL::DB::Invoice->new(id => $form->{id})->load : undef; + $form->{invoice_obj} = _retrieve_invoice_object(); my %saved; if (!$params{dont_save}) { @@ -218,6 +224,8 @@ sub form_header { my $locale = $main::locale; my $cgi = $::request->{cgi}; + $form->{invoice_obj} = _retrieve_invoice_object(); + my ($title, $readonly, $exchangerate, $rows); my ($notes, $department, $customer, $employee, $amount, $project); my ($ARselected); @@ -608,6 +616,7 @@ sub post_payment { my %myconfig = %main::myconfig; my $locale = $main::locale; + $form->mtime_ischanged('ar'); $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); my $invdate = $form->datetonum($form->{transdate}, \%myconfig); @@ -664,6 +673,8 @@ sub post { my ($inline) = @_; + $form->mtime_ischanged('ar'); + my ($datepaid); # check if there is an invoice number, invoice and due date @@ -922,7 +933,7 @@ sub ar_transactions { @columns = qw(transdate id type invnumber ordnumber cusordnumber name netamount tax amount paid datepaid due duedate transaction_description notes salesman employee shippingpoint shipvia - marge_total marge_percent globalprojectnumber customernumber country ustid taxzone payment_terms charts customertype direct_debit); + marge_total marge_percent globalprojectnumber customernumber country ustid taxzone payment_terms charts customertype direct_debit dunning_description); my $ct_cvar_configs = CVar->get_configs('module' => 'CT'); my @ct_includeable_custom_variables = grep { $_->{includeable} } @{ $ct_cvar_configs }; @@ -969,6 +980,7 @@ sub ar_transactions { 'charts' => { 'text' => $locale->text('Buchungskonto'), }, 'customertype' => { 'text' => $locale->text('Customer type'), }, 'direct_debit' => { 'text' => $locale->text('direct debit'), }, + dunning_description => { 'text' => $locale->text('Dunning level'), }, %column_defs_cvars, );