X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/fe7ad402666bbe38d97710852bda2bebb28322ee..d53cd96129bd8a2ac1f5bb5a34f88e87d723d751:/bin/mozilla/io.pl diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index ce7580987..4b6cf26c7 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -60,6 +60,7 @@ use SL::DB::AuthUser; use SL::DB::Contact; use SL::DB::Currency; use SL::DB::Customer; +use SL::DB::DeliveryOrder::TypeData qw(); use SL::DB::Default; use SL::DB::Language; use SL::DB::Printer; @@ -1205,6 +1206,15 @@ sub print_form { if ($form->{formname} eq "invoice") { $form->{label} = $locale->text('Invoice'); } + + if ($form->{formname} eq "invoice_for_advance_payment") { + $form->{label} = $locale->text('Invoice for Advance Payment'); + } + + if ($form->{formname} eq "final_invoice") { + $form->{label} = $locale->text('Final Invoice'); + } + if ($form->{formname} eq 'sales_order') { $inv = "ord"; $due = "req"; @@ -1302,7 +1312,7 @@ sub print_form { } $form->{TEMPLATE_DRIVER_OPTIONS} = { }; - if (any { $form->{type} eq $_ } qw(sales_quotation sales_order sales_delivery_order invoice request_quotation purchase_order purchase_delivery_order credit_note)) { + if (any { $form->{type} eq $_ } qw(sales_quotation sales_order sales_delivery_order invoice invoice_for_advance_payment final_invoice request_quotation purchase_order purchase_delivery_order credit_note)) { $form->{TEMPLATE_DRIVER_OPTIONS}->{variable_content_types} = $form->get_variable_content_types(); } @@ -1886,6 +1896,7 @@ sub _make_record_item { request_quotation => 'OrderItem', invoice => 'InvoiceItem', invoice_for_advance_payment => 'InvoiceItem', + final_invoice => 'InvoiceItem', credit_note => 'InvoiceItem', purchase_invoice => 'InvoiceItem', purchase_delivery_order => 'DeliveryOrderItem', @@ -2008,7 +2019,10 @@ sub _make_record { } $obj->items(@items) if @items; - $obj->is_sales(!!$obj->customer_id) if $class eq 'SL::DB::DeliveryOrder'; + + if ($class eq 'SL::DB::DeliveryOrder' && !$obj->order_type) { + $obj->order_type(SL::DB::DeliveryOrder::TypeData::validate_type($::form->{type})); + } if ($class eq 'SL::DB::Invoice') { my $paid = $factor *