X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/cd274d3f3c0600fedf42cca0830179cbeb81a535..187c4ee192da9281f42800e6ac8ae08f23d9a9d6:/SL/DB/Order.pm diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index cff772a5d..dc4bbebd8 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -310,6 +310,8 @@ sub new_from { { from => 'purchase_order', to => 'purchase_order', abbr => 'popo' }, { from => 'sales_order', to => 'purchase_order', abbr => 'sopo' }, { from => 'purchase_order', to => 'sales_order', abbr => 'poso' }, + { from => 'sales_order', to => 'sales_quotation', abbr => 'sosq' }, + { from => 'purchase_order', to => 'request_quotation', abbr => 'porq' }, ); my $from_to = (grep { $_->{from} eq $source->type && $_->{to} eq $destination_type} @from_tos)[0]; croak("Cannot convert from '" . $source->type . "' to '" . $destination_type . "'") if !$from_to; @@ -354,6 +356,11 @@ sub new_from { if ( $is_abbr_any->(qw(soso)) ) { $args{periodic_invoices_config} = $source->periodic_invoices_config->clone_and_reset if $source->periodic_invoices_config; } + if ( $is_abbr_any->(qw(sosq porq)) ) { + $args{ordnumber} = undef; + $args{quonumber} = undef; + $args{reqdate} = DateTime->today_local->next_workday(); + } # Custom shipto addresses (the ones specific to the sales/purchase # record and not to the customer/vendor) are only linked from