Tweaks to IVT Import

This commit is contained in:
Frank Schubert
2024-07-07 18:03:33 +02:00
parent 3a0ebb3bf4
commit 0913f367ec
2 changed files with 5 additions and 7 deletions

View File

@@ -26,6 +26,7 @@ class Admin_IvtContractImport {
* WHERE `cid` = 1840;
*/
$this->static_ivt_order_match = [
9 => false,
17245 => 3946, // lugitsch 1840
16704 => 3342,
16703 => 3342,
@@ -204,26 +205,23 @@ class Admin_IvtContractImport {
$contract_data['edit_by'] = 1;
$finish_date = new DateTime($ivt_contract->lastdate);
$finish_date->modify("first day of this month");
switch($ip->interval) {
case 0:
$contract_data['billing_period'] = 1;
//$finish_date->modify("+1 month");
$finish_date->modify("+1 month");
break;
case 1:
$contract_data['billing_period'] = 12;
//$finish_date->modify("+1 year");
$contract_data["billing_delay"] = 12;
break;
}
$order_date = new DateTime($ivt_contract->created);
$order_date->setTime(2,0,0);
$finish_date->modify("first day of this month");
$finish_date->setTime(2,0,0);
//$finish_date->modify("+1 month"); // XXX for debugging only; must be removed
//$finish_date->setDate($finish_date->format("Y"), $finish_date->format("m"), 1);
//$finish_date->modify("+1 hours");
$contract_data['order_date'] = $order_date->getTimestamp();
$contract_data['finish_date'] = $finish_date->getTimestamp();

View File

@@ -181,7 +181,7 @@ class Admin_IvtCreditImport {
$finish_date = new DateTime($cust_cred->lastdate);
$finish_date->modify("first day of this month");
$finish_date->setTime(2,0,0);
//$finish_date->modify("+ 1 month"); // XXX for debugging only; must be removed
$finish_date->modify("+ 1 month"); // XXX For import, because july was not invoiced in IVT
//$finish_date->setDate($finish_date->format("Y"), $finish_date->format("m"), 1);
$data["orderproduct_id"] = null;