From f46afb13bacfe1d838cb4a7a5b5b58e8145ff4b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 7 Jan 2014 18:13:05 +0100 Subject: [PATCH] =?utf8?q?Bugfix=20zu=20manuelle=20Lieferadresse=20im=20Au?= =?utf8?q?ftrag=20wird=20nicht=20in=20wiederkehrende=20Rechung=20=C3=BCber?= =?utf8?q?nommen=20closes=20#2296?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/BackgroundJob/CreatePeriodicInvoices.pm | 12 ++++++++++++ SL/DB/Shipto.pm | 1 + doc/changelog | 2 ++ 3 files changed, 15 insertions(+) diff --git a/SL/BackgroundJob/CreatePeriodicInvoices.pm b/SL/BackgroundJob/CreatePeriodicInvoices.pm index 0817ae6c6..fa5d64935 100644 --- a/SL/BackgroundJob/CreatePeriodicInvoices.pm +++ b/SL/BackgroundJob/CreatePeriodicInvoices.pm @@ -142,6 +142,18 @@ sub _create_periodic_invoice { $invoice->post(ar_id => $config->ar_chart_id) || die; + # like $form->add_shipto, but we don't need to check for a manual exception, + # because we can already assume this (otherwise no shipto_id from order) + if ($order->shipto_id) { + + my $shipto_oe = SL::DB::Manager::Shipto->find_by(shipto_id => $order->shipto_id); + my $shipto_ar = $shipto_oe->clone_and_reset; + + $shipto_ar->module('AR'); # alter module OE -> AR + $shipto_ar->trans_id($invoice->id); # alter trans_id -> new id from invoice + $shipto_ar->save; + } + $order->link_to_record($invoice); SL::DB::PeriodicInvoice->new(config_id => $config->id, diff --git a/SL/DB/Shipto.pm b/SL/DB/Shipto.pm index 8795a1b50..1b174c011 100644 --- a/SL/DB/Shipto.pm +++ b/SL/DB/Shipto.pm @@ -3,6 +3,7 @@ package SL::DB::Shipto; use strict; use SL::DB::MetaSetup::Shipto; +use Rose::DB::Object::Helpers qw(clone_and_reset clone); our @SHIPTO_VARIABLES = qw(shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptoemail shiptodepartment_1 shiptodepartment_2); diff --git a/doc/changelog b/doc/changelog index 240b18347..126877b7a 100644 --- a/doc/changelog +++ b/doc/changelog @@ -108,6 +108,8 @@ Bugfixes: - Stornierte Rechnungen (sowohl die Stornorechnung als auch das Storno nicht Buchen oder Löschen, egal was in der Mandantenkonfiguration steht) - Wiederkehrende Rechnung mit Steuer inklusive buchen Erlöse falsch (Bug 2314) + - manuelle Lieferadresse im Auftrag wird nicht in wiederkehrende Rechung übernommen (Bug 2296) + 2012-12-10 - Release 3.0.0 -- 2.20.1