X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=af47235a933f49ecc395998042a480781e280d9e;hb=15f549fdb43fba2d99817c659533dfa02638bf27;hp=4e494cdc5bb53632f823131b39ca68c1034dfa76;hpb=081a4f9736f3bc345872be8f61632cbed4a8d9b3;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 4e494cdc5..af47235a9 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -37,6 +37,8 @@ use SL::PE; use Data::Dumper; require "$form->{path}/arap.pl"; +require "bin/mozilla/common.pl"; +require "bin/mozilla/drafts.pl"; 1; @@ -73,19 +75,31 @@ require "$form->{path}/arap.pl"; sub add { $lxdebug->enter_sub(); + return $lxdebug->leave_sub() if (load_draft_maybe()); + + # saving the history + if(!exists $form->{addition} && ($form->{id} ne "")) { + $form->{addition} = "ADDED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + $form->{title} = "Add"; $form->{callback} = "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" unless $form->{callback}; &create_links; + AR->get_transdate(\%myconfig, $form); &display_form; - $lxdebug->leave_sub(); } sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button $form->{title} = "Edit"; @@ -111,15 +125,17 @@ sub create_links { $duedate = $form->{duedate}; $taxincluded = $form->{taxincluded}; - + my $id = $form->{id}; IS->get_customer(\%myconfig, \%$form); + $form->{taxincluded} = $taxincluded; + $form->{id} = $id; $form->{duedate} = $duedate if $duedate; $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}"; $form->{rowcount} = 1; # currencies - @curr = split /:/, $form->{currencies}; + @curr = split(/:/, $form->{currencies}); chomp $curr[0]; $form->{defaultcurrency} = $curr[0]; @@ -157,7 +173,7 @@ sub create_links { map { $tax .= - qq|\n"; } else { $form->{"select$key"} .= - "\n"; + "\n"; } } @@ -200,6 +216,7 @@ sub create_links { $form->{"forex_$j"} = $form->{"exchangerate_$i"} = $form->{acc_trans}{$key}->[$i - 1]->{exchangerate}; $form->{"AR_paid_$j"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}"; + $form->{"paid_project_id_$j"} = $form->{acc_trans}{$key}->[$i - 1]->{project_id}; $form->{paidaccounts}++; } else { @@ -249,14 +266,14 @@ sub create_links { "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; $form->{"${key}_$i"} = "$form->{acc_trans}{$key}->[$i-1]->{accno}--$form->{acc_trans}{$key}->[$i-1]->{description}"; + my $q_description = quotemeta($form->{acc_trans}{$key}->[$i-1]->{description}); $form->{"select${key}"} =~ - /