auto generate fibu_num for billingaddresses
This commit is contained in:
26
scripts/contract/generate-fibu_account_nums.php
Normal file
26
scripts/contract/generate-fibu_account_nums.php
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/php
|
||||
<?php
|
||||
|
||||
//require 'vendor/autoload.php';
|
||||
require("../../config/config.php");
|
||||
|
||||
define('FRONKDB_SQLDEBUG',false);
|
||||
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
|
||||
|
||||
require_once(LIBDIR."/mvcfronk/mfRouter/mfRouter.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseModel.php");
|
||||
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseController.php");
|
||||
|
||||
$me = new User(1);
|
||||
|
||||
foreach(ContractModel::searchActive([]) as $contract) {
|
||||
if($contract->billingaddress_id) {
|
||||
$contract->billingaddress->generateFibuAccountNumber();
|
||||
}
|
||||
}
|
||||
|
||||
foreach(OrderModel::getAll() as $order) {
|
||||
if($order->billingaddress_id) {
|
||||
$order->billingaddress->generateFibuAccountNumber();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user