WIP Billing/Invoice 02.06.2024
This commit is contained in:
@@ -107,8 +107,9 @@ class BillingController extends mfBaseController {
|
||||
$now_year = date("Y");
|
||||
$now_month = date("m");
|
||||
$now_day = date("d");
|
||||
$now_year = 2024;
|
||||
$now_month = 7;
|
||||
//$now_year = 2024;
|
||||
//$now_month = 6;
|
||||
$now_day = 3; // XXX for debugging only, must be removed
|
||||
|
||||
// XXX only for 1st Billing after IVT Import
|
||||
//$yearly_not_before = new DateTime("$now_year-$now_month-01");
|
||||
@@ -123,7 +124,7 @@ class BillingController extends mfBaseController {
|
||||
|
||||
$this->log->notice(__METHOD__.": $del Billing records deleted");
|
||||
//$stop = false;
|
||||
foreach(ContractModel::search(["finish_date<" => mktime(0,0,0,$now_month, $now_day, $now_year), "cancel_date" => null]) as $contract) {
|
||||
foreach(ContractModel::search(["finish_date<" => mktime(0,1,0,$now_month, $now_day, $now_year), "cancel_date" => null]) as $contract) {
|
||||
//while(!$stop) {
|
||||
//$stop = true;
|
||||
//$contract = new Contract(1475);
|
||||
@@ -238,8 +239,10 @@ class BillingController extends mfBaseController {
|
||||
}
|
||||
|
||||
if($create_date->format("Y") == $finish_year && $create_date->format("m") == $finish_month) {
|
||||
// this is the finish month, so set day back to day of finish_date
|
||||
$create_date->setDate($finish_year, $finish_month, $finish_day);
|
||||
// this is the finish month, so set day back to day of finish_date, unless billing_period is more than 1 month
|
||||
if($contract->billing_period == 1) {
|
||||
$create_date->setDate($finish_year, $finish_month, $finish_day);
|
||||
}
|
||||
$last_create_date = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ class BillingModel {
|
||||
public $price;
|
||||
public $price_setup;
|
||||
public $vatrate;
|
||||
public $billing_period;
|
||||
|
||||
public $create_by;
|
||||
public $edit_by;
|
||||
|
||||
Reference in New Issue
Block a user