From d2297ab0a9272ebc7925821751b8f6ad92d3d382 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Thu, 18 Jan 2024 20:10:22 +0100 Subject: [PATCH] Address::syncToFibuMerge() knows about > 900000 customer numbers now --- Layout/default/Address/View.php | 12 +++++++++--- application/Address/Address.php | 11 ++++++++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Layout/default/Address/View.php b/Layout/default/Address/View.php index f62321c14..409d928da 100644 --- a/Layout/default/Address/View.php +++ b/Layout/default/Address/View.php @@ -123,14 +123,20 @@ Ist primäres Verrechnungskonto fibu_primary_account) ? "" : ""?> - FIBU Verrechnungskonto + Verrechnungskonto fibu_account_number?> - FIBU Lieferanten Konto + Lieferantenkonto fibu_supplier_number?> - FIBU Lieferanten Zahlungsziel + Zahlungsziel Lieferant fibu_supplier_due?> + + Lieferant Skontotage + fibu_supplier_skonto?> + + Lieferant Skonto % + fibu_supplier_skonto_rate?>

Zusatzdaten

diff --git a/application/Address/Address.php b/application/Address/Address.php index 69c141bbb..076608425 100644 --- a/application/Address/Address.php +++ b/application/Address/Address.php @@ -69,12 +69,17 @@ class Address extends mfBaseModel { $me->loadMe(); if($this->fibu_account_number) { - $fibumerge = XinonFibuMergeModel::getFirst(["old_custnum" => $this->customer_number]); + $old_custnum = $this->customer_number; + if($old_custnum > 900000) { + $old_custnum -= 900000; + } + + $fibumerge = XinonFibuMergeModel::getFirst(["old_custnum" => $old_custnum]); if(!$fibumerge) { // create fibu merge $fibumerge = XinonFibuMergeModel::create([ "source" => "t", - "old_custnum" => $this->customer_number, + "old_custnum" => $old_custnum, "new_custnum" => $this->fibu_account_number, "name" => ($this->company) ? $this->company : $this->lastname, "vorname" => ($this->company) ? "" : $this->firstname, @@ -87,7 +92,7 @@ class Address extends mfBaseModel { $fibumerge->save(); return true; } - + if($fibumerge->new_custnum != $this->fibu_account_number) { $fibumerge->new_custnum = $this->fibu_account_number; $fibumerge->save();