X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/f6158a03b132c6e4c8534752c64d17b3e4805c33..98b64fe1e380c232428d63cea0eb5f44b1d1a2c3:/bin/mozilla/io.pl diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 5da2dbe59..3a77b09a0 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -604,7 +604,7 @@ sub item_selected { my @new_fields = qw(id partnumber description sellprice listprice inventory_accno - income_accno expense_accno bin unit weight assembly taxaccounts + income_accno expense_accno bin unit weight part_type taxaccounts partsgroup formel longdescription not_discountable partnotes lastcost price_factor_id price_factor); @@ -889,6 +889,21 @@ sub order { $form->{old_salesman_id} = $form->{salesman_id}; delete $form->{$_} foreach (qw(printed emailed queued)); + + # When creating a new sales order from a saved sales invoice, reset id, + # ordnumber, transdate and deliverydate as we are creating a new order. This + # workflow is probably mainly used as a template mechanism for creating new + # orders from existing invoices, so we probably don't want to link the items. + # Is this order function called anywhere else? + # The worksflows in oe already call sales_order and purchase_order in oe, not + # this general function which now only seems to be called from saved sales + # invoices + # Why is ordnumber set to invnumber above, does this ever make sense? + + if ( $form->{script} eq 'is.pl' && $form->{type} eq 'invoice' ) { + delete $form->{$_} foreach (qw(ordnumber id transdate deliverydate)); + }; + my $buysell; if ($form->{script} eq 'ir.pl' || $form->{type} eq 'request_quotation') { $form->{title} = $locale->text('Add Purchase Order'); @@ -1952,6 +1967,7 @@ sub _make_record_item { } sub _make_record { + Form::disconnect_standard_dbh; my $class = { sales_order => 'Order', purchase_order => 'Order',