]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Controller/Order.pm
DATEV/CSV check_encoding, sollte wirklich das encoding checken
[mfinanz.git] / SL / Controller / Order.pm
index 8ee73f9c8fb0addeaf6e532719a3cd7026100a62..b3477b2e3d2652d1575f6173c29205c9b2ebfd9f 100644 (file)
@@ -594,6 +594,7 @@ sub action_customer_vendor_changed {
   $self->js
     ->replaceWith('#order_cp_id',            $self->build_contact_select)
     ->replaceWith('#order_shipto_id',        $self->build_shipto_select)
+    ->replaceWith('#business_info_row',      $self->build_business_info_row)
     ->val(        '#order_taxzone_id',       $self->order->taxzone_id)
     ->val(        '#order_taxincluded',      $self->order->taxincluded)
     ->val(        '#order_payment_id',       $self->order->payment_id)
@@ -1016,6 +1017,14 @@ sub build_shipto_select {
   );
 }
 
+# render the info line for business
+#
+# Needed, if customer/vendor changed.
+sub build_business_info_row
+{
+  $_[0]->p->render('order/tabs/_business_info_row', SELF => $_[0]);
+}
+
 # build the rows for displaying taxes
 #
 # Called if amounts where recalculated and redisplayed.
@@ -1423,13 +1432,15 @@ sub _setup_edit_action_bar {
         ],
         action => [
           t8('Sales Order'),
-          submit  => [ '#order_form', { action => "Order/sales_order" } ],
-          only_if => (any { $self->type eq $_ } (_sales_quotation_type())),
+          submit   => [ '#order_form', { action => "Order/sales_order" } ],
+          only_if  => (any { $self->type eq $_ } (_sales_quotation_type())),
+          disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
         ],
         action => [
           t8('Purchase Order'),
-          submit  => [ '#order_form', { action => "Order/purchase_order" } ],
-          only_if   => (any { $self->type eq $_ } (_request_quotation_type())),
+          submit   => [ '#order_form', { action => "Order/purchase_order" } ],
+          only_if  => (any { $self->type eq $_ } (_request_quotation_type())),
+          disabled => !$self->order->id ? t8('This object has not been saved yet.') : undef,
         ],
       ], # end of combobox "Workflow"
 
@@ -1693,6 +1704,10 @@ reused from generic code.
 
 =over 4
 
+=item * C<template/webpages/order/tabs/_business_info_row.html>
+
+For displaying information on business type
+
 =item * C<template/webpages/order/tabs/_item_input.html>
 
 The input line for items