Added sepa date

This commit is contained in:
Frank Schubert
2024-02-06 20:47:44 +01:00
parent e9937f2df8
commit 38ec49ddb3
10 changed files with 309 additions and 1 deletions

View File

@@ -243,6 +243,8 @@ class AddressController extends mfBaseController {
$data['uid'] = trim($r->uid);
if($this->me->can("Fibu")) {
$data["sepa_date"] = ($r->sepa_date) ? Layout::dateToInt($r->sepa_date) : null;
$data['fibu_account_number'] = ($r->fibu_account_number) ? trim($r->fibu_account_number) : null;
$data['fibu_supplier_number'] = ($r->fibu_supplier_number) ? trim($r->fibu_supplier_number) : null;
if($r->fibu_primary_account) {
@@ -283,6 +285,13 @@ class AddressController extends mfBaseController {
if($r->billing_type == "sepa") {
$data['billing_type'] = "sepa";
if(!$r->sepa_date) {
if($mode == "add" || ($mode == "edit" && !$address->sepa_date)) {
$data['sepa_date'] = date('U');
}
} else {
$data['sepa_date'] = $r->sepa_date;
}
} else {
$data['billing_type'] = "invoice";
}