Aufträge speichern: Warnung bzgl. existierender wiederkehrender Rechnungen gefixt
authorMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 31 Jan 2018 13:55:36 +0000 (14:55 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 31 Jan 2018 13:56:13 +0000 (14:56 +0100)
Behebt #341.

bin/mozilla/oe.pl

index c1ecf19..2a57dca 100644 (file)
@@ -297,14 +297,14 @@ sub setup_oe_action_bar {
   my $form   = $::form;
 
   my $has_active_periodic_invoice;
-  if ($params{obj}) {
+  if ($params{oe_obj}) {
     $has_active_periodic_invoice =
-         $params{obj}->is_type('sales_order')
-      && $params{obj}->periodic_invoices_config
-      && $params{obj}->periodic_invoices_config->active
-      && (   !$params{obj}->periodic_invoices_config->end_date
-          || ($params{obj}->periodic_invoices_config->end_date > DateTime->today_local))
-      && $params{obj}->periodic_invoices_config->get_previous_billed_period_start_date;
+         $params{oe_obj}->is_type('sales_order')
+      && $params{oe_obj}->periodic_invoices_config
+      && $params{oe_obj}->periodic_invoices_config->active
+      && (   !$params{oe_obj}->periodic_invoices_config->end_date
+          || ($params{oe_obj}->periodic_invoices_config->end_date > DateTime->today_local))
+      && $params{oe_obj}->periodic_invoices_config->get_previous_billed_period_start_date;
   }
 
   my $allow_invoice      = $params{is_req_quo}
@@ -622,7 +622,11 @@ sub form_header {
     is_pur_ord   => scalar($form->{type} =~ /purchase_order$/),
   );
 
-  setup_oe_action_bar(%type_check_vars);
+  setup_oe_action_bar(
+    %type_check_vars,
+    oe_obj => $TMPL_VAR->{oe_obj},
+    vc_obj => $TMPL_VAR->{vc_obj},
+  );
 
   $form->header;
   if ($form->{CFDD_shipto} && $form->{CFDD_shipto_id} ) {