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";
}

View File

@@ -8,6 +8,7 @@ class AddressModel {
public $fibu_supplier_due;
public $fibu_supplier_skonto;
public $fibu_supplier_skonto_rate;
public $fibu_supplier_paymentblock;
public $fibu_primary_account;
public $spin;
public $company;
@@ -28,6 +29,7 @@ class AddressModel {
public $bank_account_owner;
public $bank_account_iban;
public $bank_account_bic;
public $sepa_date;
public $allow_contact;
public $allow_spin;
@@ -365,6 +367,14 @@ class AddressModel {
}
}
if(array_key_exists("billing_type", $filter)) {
$billing_type = FronkDB::singleton()->escape($filter["billing_type"]);
if($billing_type) {
$where .= " AND billing_type='$billing_type'";
}
}
/*
* Address Type
*/