Revision 8f3f4aa6
Von Jan Büren vor fast 10 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
136 | 136 |
my $is_purchase = (first { $_ eq $form->{type} } qw(request_quotation purchase_order purchase_delivery_order)) || ($form->{script} eq 'ir.pl'); |
137 | 137 |
my $show_min_order_qty = first { $_ eq $form->{type} } qw(request_quotation purchase_order); |
138 | 138 |
my $is_delivery_order = $form->{type} =~ /_delivery_order$/; |
139 |
my $is_quotation = $form->{type} =~ /_quotation$/; |
|
140 |
my $is_invoice = $form->{type} =~ /invoice/; |
|
139 | 141 |
my $is_s_p_order = (first { $_ eq $form->{type} } qw(sales_order purchase_order)); |
140 | 142 |
|
141 | 143 |
if ($is_delivery_order) { |
... | ... | |
432 | 434 |
# / calculate onhand |
433 | 435 |
|
434 | 436 |
my @hidden_vars; |
435 |
|
|
436 |
if ($is_delivery_order) { |
|
437 |
# add hidden ids for persistent (item|invoice)_ids and previous (converted_from*) ids |
|
438 |
if ($is_quotation) { |
|
439 |
push @hidden_vars, qw(orderitems_id); |
|
440 |
} |
|
441 |
if ($is_s_p_order) { |
|
442 |
push @hidden_vars, qw(orderitems_id converted_from_quotation_orderitems_id); |
|
443 |
} |
|
444 |
if ($is_invoice) { |
|
445 |
push @hidden_vars, qw(invoice_id converted_from_quotation_orderitems_id converted_from_order_orderitems_id |
|
446 |
converted_from_delivery_order_items_id); |
|
447 |
} |
|
448 |
if ($is_delivery_order) { |
|
437 | 449 |
map { $form->{"${_}_${i}"} = $form->format_amount(\%myconfig, $form->{"${_}_${i}"}) } qw(sellprice discount lastcost); |
438 | 450 |
push @hidden_vars, grep { defined $form->{"${_}_${i}"} } qw(sellprice discount not_discountable price_factor_id lastcost); |
439 | 451 |
push @hidden_vars, "stock_${stock_in_out}_sum_qty", "stock_${stock_in_out}"; |
440 |
push @hidden_vars, qw(delivery_order_items_id); |
|
452 |
push @hidden_vars, qw(delivery_order_items_id converted_from_order_orderitems_id);
|
|
441 | 453 |
} |
442 | 454 |
|
443 | 455 |
my @HIDDENS = map { value => $_}, ( |
444 | 456 |
$cgi->hidden("-name" => "unit_old_$i", "-value" => $form->{"selected_unit_$i"}), |
445 | 457 |
$cgi->hidden("-name" => "price_new_$i", "-value" => $form->format_amount(\%myconfig, $form->{"price_new_$i"})), |
446 | 458 |
map { ($cgi->hidden("-name" => $_, "-id" => $_, "-value" => $form->{$_})); } map { $_."_$i" } |
447 |
(qw(orderitems_id bo price_old id inventory_accno bin partsgroup partnotes active_price_source active_discount_source
|
|
459 |
(qw(bo price_old id inventory_accno bin partsgroup partnotes active_price_source active_discount_source |
|
448 | 460 |
income_accno expense_accno listprice assembly taxaccounts ordnumber donumber transdate cusordnumber |
449 | 461 |
longdescription basefactor marge_absolut marge_percent marge_price_factor weight), @hidden_vars) |
450 | 462 |
); |
... | ... | |
727 | 739 |
transdate longdescription basefactor marge_total marge_percent |
728 | 740 |
marge_price_factor lastcost price_factor_id partnotes |
729 | 741 |
stock_out stock_in has_sernumber reqdate orderitems_id |
730 |
active_price_source active_discount_source delivery_order_items_id); |
|
742 |
active_price_source active_discount_source delivery_order_items_id |
|
743 |
invoice_id converted_from_quotation_orderitems_id |
|
744 |
converted_from_order_orderitems_id converted_from_delivery_order_items_id); |
|
731 | 745 |
|
732 | 746 |
my $ic_cvar_configs = CVar->get_configs(module => 'IC'); |
733 | 747 |
push @flds, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs }; |
Auch abrufbar als: Unified diff
display_row item_ids je nach beleg hinzufügen
zusätzlich is_quotation und is_invoice als status hinzugefügt.
je nach status entsprechend beleg-id (orderitems, delivery_order_items, invoice)
hinzugefügt und den vorgänger (converted_from_(do|oe|quo|)_items_id).
Entsprechend konsequent orderitems_id aus den generellen hidden für rows entfernt,
somit entfällt das Löschen der orderitems_id für Konvertierung von oe -> do|invoice