diff --git a/Layout/default/Address/Form.php b/Layout/default/Address/Form.php index 7acab0f5c..bca16447d 100644 --- a/Layout/default/Address/Form.php +++ b/Layout/default/Address/Form.php @@ -268,6 +268,28 @@ + +
+ +
+ + Standard: Tage +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+

diff --git a/Layout/default/Address/View.php b/Layout/default/Address/View.php index d981e117f..f5e0b04cc 100644 --- a/Layout/default/Address/View.php +++ b/Layout/default/Address/View.php @@ -160,6 +160,15 @@ Verrechnungskonto fibu_account_number?> + + Zahlungsziel + fibu_payment_due) ? $address->fibu_payment_due." Tage" : ""?> + + Skontotage + fibu_payment_skonto?> + + Skonto % + fibu_payment_skonto_rate) ? $address->fibu_payment_skonto_rate." %" : ""?> Lieferantenkonto fibu_supplier_number?> diff --git a/Layout/default/Address/bmd_export.csv.php b/Layout/default/Address/bmd_export.csv.php index 2c38122a1..4bbed0620 100644 --- a/Layout/default/Address/bmd_export.csv.php +++ b/Layout/default/Address/bmd_export.csv.php @@ -1,5 +1,5 @@ setReturnValue(["header" => $header]); foreach($addresses as $a): diff --git a/application/Address/Address.php b/application/Address/Address.php index 63d4d0a14..ca8376f34 100644 --- a/application/Address/Address.php +++ b/application/Address/Address.php @@ -578,9 +578,9 @@ class Address extends mfBaseModel { $a["fibu_supplier_skonto_rate"] = $address->fibu_supplier_skonto_rate; $a["fibu_supplier_paymentblock"] = $address->fibu_supplier_paymentblock; } else { - $a["fibu_supplier_due"] = ""; - $a["fibu_supplier_skonto"] = ""; - $a["fibu_supplier_skonto_rate"] = ""; + $a["fibu_supplier_due"] = (is_numeric($address->fibu_payment_due)) ? $address->fibu_payment_due : TT_ADDRESS_DEFAULT_PAYMENT_DUE; + $a["fibu_supplier_skonto"] = $address->fibu_payment_skonto; + $a["fibu_supplier_skonto_rate"] = $address->fibu_payment_skonto_rate; $a["fibu_supplier_paymentblock"] = ""; } $a["street"] = $address->street; diff --git a/application/Address/AddressController.php b/application/Address/AddressController.php index cfa9bf50a..cec2e41c0 100644 --- a/application/Address/AddressController.php +++ b/application/Address/AddressController.php @@ -303,6 +303,10 @@ class AddressController extends mfBaseController { $data['fibu_supplier_paymentblock'] = 0; } + $data['fibu_payment_due'] = ($r->fibu_payment_due) ? trim($r->fibu_payment_due) : null; + $data['fibu_payment_skonto'] = ($r->fibu_payment_skonto) ? trim($r->fibu_payment_skonto) : null; + $data['fibu_payment_skonto_rate'] = ($r->fibu_payment_skonto_rate) ? trim($r->fibu_payment_skonto_rate) : null; + $data['fibu_supplier_due'] = ($r->fibu_supplier_due) ? trim($r->fibu_supplier_due) : null; $data['fibu_supplier_skonto'] = ($r->fibu_supplier_skonto) ? trim($r->fibu_supplier_skonto) : null; $data['fibu_supplier_skonto_rate'] = ($r->fibu_supplier_skonto_rate) ? trim($r->fibu_supplier_skonto_rate) : null; diff --git a/application/Address/AddressModel.php b/application/Address/AddressModel.php index 0d4f9a10c..2a036e121 100644 --- a/application/Address/AddressModel.php +++ b/application/Address/AddressModel.php @@ -4,6 +4,9 @@ class AddressModel { public $parent_id; public $customer_number; public $fibu_account_number; + public $fibu_payment_due; + public $fibu_payment_skonto; + public $fibu_payment_skonto_rate; public $fibu_supplier_number; public $fibu_supplier_due; public $fibu_supplier_skonto; diff --git a/application/Invoice/InvoiceController.php b/application/Invoice/InvoiceController.php index 1abf4783f..be0b2d6f2 100644 --- a/application/Invoice/InvoiceController.php +++ b/application/Invoice/InvoiceController.php @@ -483,6 +483,9 @@ class InvoiceController extends mfBaseController { $invoice_data["billingaddress_id"] = $billingaddress_id; $invoice_data["customer_number"] = $bill->customer_number; $invoice_data["fibu_account_number"] = $bill->fibu_account_number; + $invoice_data["fibu_payment_due"] = $bill->fibu_payment_due; + $invoice_data["fibu_payment_skonto"] = $bill->fibu_payment_skonto; + $invoice_data["fibu_payment_skonto_rate"] = $bill->fibu_payment_skonto_rate; $invoice_data["sepa_date"] = $bill->sepa_date; @@ -674,7 +677,7 @@ class InvoiceController extends mfBaseController { $type = "credit"; } - $csv_header = "\u{FEFF}satzart;konto;gkonto;belegnr;belegdatum;buchsymbol;buchcode;prozent;steuercode;betrag;steuer;text;kost;"; + $csv_header = "\u{FEFF}satzart;konto;gkonto;belegnr;belegdatum;zziel;skontopz;skontotage;buchsymbol;buchcode;prozent;steuercode;betrag;steuer;text;kost;"; if($type == "credit") { $csv_header .= "extbelegnr"; @@ -797,6 +800,9 @@ class InvoiceController extends mfBaseController { $csv_out .= $invoice->fibu_cost_account.";"; $csv_out .= $invoice->invoice_number.";"; $csv_out .= date("d.m.Y", $invoice->invoice_date).";"; + $csv_out .= ($invoice->fibu_payment_due === null) ? ";" : $invoice->fibu_payment_due.";"; + $csv_out .= ($invoice->fibu_payment_skonto) ? $invoice->fibu_payment_skonto.";" : ";"; + $csv_out .= ($invoice->fibu_payment_skonto_rate) ? $invoice->fibu_payment_skonto_rate.";" : ";"; $csv_out .= $buchsymbol.";"; $csv_out .= $buchcode.";"; $csv_out .= $vatrate.";"; diff --git a/application/Invoice/InvoiceModel.php b/application/Invoice/InvoiceModel.php index 5449b1d22..040378897 100644 --- a/application/Invoice/InvoiceModel.php +++ b/application/Invoice/InvoiceModel.php @@ -7,6 +7,9 @@ class InvoiceModel { public $billingaddress_id; public $customer_number; public $fibu_account_number; + public $fibu_payment_due; + public $fibu_payment_skonto; + public $fibu_payment_skonto_rate; public $sepa_date; public $sepa_id; public $sepa_last_date; diff --git a/db/migrations/20250708151354_address_add_payment_due.php b/db/migrations/20250708151354_address_add_payment_due.php new file mode 100644 index 000000000..0107f49ec --- /dev/null +++ b/db/migrations/20250708151354_address_add_payment_due.php @@ -0,0 +1,49 @@ +getEnvironment() == "thetool") { + $address = $this->table("Address"); + $address->addColumn("fibu_payment_due", "integer", ["null" => true, "default" => null, "after" => "fibu_account_number"]); + $address->addColumn("fibu_payment_skonto", "integer", ["null" => true, "default" => null, "after" => "fibu_payment_due"]); + $address->addColumn("fibu_payment_skonto_rate", "integer", ["null" => true, "default" => null, "after" => "fibu_payment_skonto"]); + $address->update(); + + $invoice = $this->table("Invoice"); + $invoice->addColumn("fibu_payment_due", "integer", ["null" => true, "default" => null, "after" => "fibu_account_number"]); + $invoice->addColumn("fibu_payment_skonto", "integer", ["null" => false, "default" => 0, "after" => "fibu_payment_due"]); + $invoice->addColumn("fibu_payment_skonto_rate", "integer", ["null" => false, "default" => 0, "after" => "fibu_payment_skonto"]); + $invoice->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $address = $this->table("Address"); + $address->removeColumn("fibu_payment_skonto_rate"); + $address->removeColumn("fibu_payment_skonto"); + $address->removeColumn("fibu_payment_due"); + $address->update(); + + $invoice = $this->table("Invoice"); + $invoice->removeColumn("fibu_payment_skonto_rate"); + $invoice->removeColumn("fibu_payment_skonto"); + $invoice->removeColumn("fibu_payment_due"); + $invoice->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +}