sellprice_pg pricegroup_old price_old price_new unit_old ordnumber donumber
transdate longdescription basefactor marge_total marge_percent
marge_price_factor lastcost price_factor_id partnotes
- stock_out stock_in has_sernumber reqdate);
+ stock_out stock_in has_sernumber reqdate orderitems_id);
my $ic_cvar_configs = CVar->get_configs(module => 'IC');
push @flds, map { "ic_cvar_$_->{name}" } @{ $ic_cvar_configs };
_check_io_auth();
+ # we are coming from *_order and convert to quotation
+ # it seems that quotation is only called if we have a existing order
+ if ($form->{type} =~ /(sales|purchase)_order/) {
+ delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"};
+ }
if ($form->{second_run}) {
$form->{print_and_post} = 0;
}
$form->{saveasnew} = 1;
map { delete $form->{$_} } qw(printed emailed queued delivered closed);
+ delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"};
# Let kivitendo assign a new order number if the user hasn't changed the
# previous one. If it has been changed manually then use it as-is.
# reset
map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal delivered ordnumber);
+ delete $form->{"orderitems_id_$_"} for 1 .. $form->{"rowcount"};
# if purchase_order was generated from sales_order, use lastcost_$i as sellprice_$i
# also reset discounts
for my $i (1 .. $form->{rowcount}) {
$form->{"sellprice_${i}"} = $form->{"lastcost_${i}"};
$form->{"discount_${i}"} = 0;
+ delete $form->{"orderitems_id_$_"};
};
};