mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-15 17:28:41 +00:00
use times for cost objects NO_CI
This commit is contained in:
parent
f05d0a4b72
commit
e3dea0c20a
|
|
@ -176,16 +176,20 @@ final class Importer extends ImporterAbstract
|
||||||
public function importCostObject(\DateTime $start, \DateTime $end) : void
|
public function importCostObject(\DateTime $start, \DateTime $end) : void
|
||||||
{
|
{
|
||||||
DataMapperAbstract::setConnection($this->remote);
|
DataMapperAbstract::setConnection($this->remote);
|
||||||
$costObjects = GSDCostObjectMapper::getAll();
|
$query = GSDCostObjectMapper::getQuery();
|
||||||
|
$query->where('row_create_time', '=>', $start->format('Y-m-d H:i:s'))
|
||||||
|
->andWhere('row_create_time', '<=', $end->format('Y-m-d H:i:s'));
|
||||||
|
|
||||||
|
$costObjects = GSDCostObjectMapper::getByQuery($query);
|
||||||
|
|
||||||
$obj = new CostObject();
|
|
||||||
DataMapperAbstract::setConnection($this->local);
|
DataMapperAbstract::setConnection($this->local);
|
||||||
|
|
||||||
foreach ($costObjects as $co) {
|
foreach ($costObjects as $cc) {
|
||||||
|
$obj = new CostCenter();
|
||||||
$obj->setCostObject((int) $co->getCostObject());
|
$obj->setCostObject((int) $co->getCostObject());
|
||||||
$obj->setCostObjectName($co->getDescription());
|
$obj->setCostObjectName($co->getDescription());
|
||||||
|
|
||||||
CostObjectMapper::create($obj);
|
CostCenterMapper::create($obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user