mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-17 10:18:39 +00:00
load cost centers with date limit
This commit is contained in:
parent
7ce25fdea1
commit
f05d0a4b72
|
|
@ -146,12 +146,16 @@ final class Importer extends ImporterAbstract
|
||||||
public function importCostCenter(\DateTime $start, \DateTime $end) : void
|
public function importCostCenter(\DateTime $start, \DateTime $end) : void
|
||||||
{
|
{
|
||||||
DataMapperAbstract::setConnection($this->remote);
|
DataMapperAbstract::setConnection($this->remote);
|
||||||
$costCenters = GSDCostCenterMapper::getAll();
|
$query = GSDCostCenterMapper::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'));
|
||||||
|
|
||||||
|
$costCenters = GSDCostCenterMapper::getByQuery($query);
|
||||||
|
|
||||||
$obj = new CostCenter();
|
|
||||||
DataMapperAbstract::setConnection($this->local);
|
DataMapperAbstract::setConnection($this->local);
|
||||||
|
|
||||||
foreach ($costCenters as $cc) {
|
foreach ($costCenters as $cc) {
|
||||||
|
$obj = new CostCenter();
|
||||||
$obj->setCostCenter((int) $cc->getCostCenter());
|
$obj->setCostCenter((int) $cc->getCostCenter());
|
||||||
$obj->setCostCenterName($cc->getDescription());
|
$obj->setCostCenterName($cc->getDescription());
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user