X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/da734ed492c5fb8fb34fab10d13721918d25cae1..d707f7ac60b9dbe7da50d733db1e73eae84952f7:/bin/mozilla/oe.pl diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 2c613a896..2a90fc6df 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1967,6 +1967,53 @@ sub poso { $lxdebug->leave_sub(); } +sub delivery_order { + $lxdebug->enter_sub(); + + if ($form->{type} =~ /^sales/) { + $auth->assert('sales_delivery_order_edit'); + + $form->{vc} = 'customer'; + $form->{type} = 'sales_delivery_order'; + + } else { + $auth->assert('purchase_delivery_order_edit'); + + $form->{vc} = 'vendor'; + $form->{type} = 'purchase_delivery_order'; + } + + require "bin/mozilla/do.pl"; + + $form->{cp_id} *= 1; + $form->{transdate} = $form->current_date(\%myconfig); + delete $form->{duedate}; + + $form->{closed} = 0; + + $form->{old_employee_id} = $form->{employee_id}; + $form->{old_salesman_id} = $form->{salesman_id}; + + # reset + map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued creditlimit creditremaining discount tradediscount oldinvtotal); + + for $i (1 .. $form->{rowcount}) { + map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice basefactor); + } + + my %old_values = map { $_ => $form->{$_} } qw(customer_id oldcustomer customer vendor_id oldvendor vendor); + + order_links(); + + prepare_order(); + + map { $form->{$_} = $old_values{$_} if ($old_values{$_}) } keys %old_values; + + update(); + + $lxdebug->leave_sub(); +} + sub e_mail { $lxdebug->enter_sub(); @@ -2003,6 +2050,8 @@ sub display_form { check_oe_access(); + retrieve_partunits() if ($form->{type} =~ /_delivery_order$/); + $form->{"taxaccounts"} =~ s/\s*$//; $form->{"taxaccounts"} =~ s/^\s*//; foreach my $accno (split(/\s*/, $form->{"taxaccounts"})) {