mirror of
https://github.com/Karaka-Management/oms-Exchange.git
synced 2026-02-15 17:28:41 +00:00
style fixes and time recording app draft
This commit is contained in:
parent
765d542bc2
commit
1165f9abc7
|
|
@ -19,6 +19,8 @@ use Modules\Exchange\Models\InterfaceManagerMapper;
|
||||||
use phpOMS\Message\NotificationLevel;
|
use phpOMS\Message\NotificationLevel;
|
||||||
use phpOMS\Message\RequestAbstract;
|
use phpOMS\Message\RequestAbstract;
|
||||||
use phpOMS\Message\ResponseAbstract;
|
use phpOMS\Message\ResponseAbstract;
|
||||||
|
use Modules\Media\Models\UploadFile;
|
||||||
|
use phpOMS\System\File\Local\Directory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exchange controller class.
|
* Exchange controller class.
|
||||||
|
|
@ -83,6 +85,8 @@ final class ApiController extends Controller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Directory::delete(__DIR__ . '/../tmp/');
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,5 +121,12 @@ final class ApiController extends Controller
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public function apiExchangeUpload(RequestAbstract $request, ResponseAbstract $response, $data = null): void
|
public function apiExchangeUpload(RequestAbstract $request, ResponseAbstract $response, $data = null): void
|
||||||
{ }
|
{
|
||||||
|
Directory::delete(__DIR__ . '/../tmp/');
|
||||||
|
|
||||||
|
$upload = new UploadFile();
|
||||||
|
$upload->setOutputDir(__DIR__ . '/../tmp/');
|
||||||
|
|
||||||
|
$upload->upload($request->getFiles());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,18 @@ use phpOMS\Views\View;
|
||||||
final class BackendController extends Controller
|
final class BackendController extends Controller
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Routing end-point for application behaviour.
|
||||||
|
*
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
* @param ResponseAbstract $response Response
|
||||||
|
* @param mixed $data Generic data
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
public function viewExchangeDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
public function viewExchangeDashboard(RequestAbstract $request, ResponseAbstract $response, $data = null) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app, $request, $response);
|
$view = new View($this->app, $request, $response);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Orange Management
|
* Orange Management
|
||||||
*
|
*
|
||||||
|
|
@ -26,6 +25,7 @@ use Modules\Exchange\Models\ImporterAbstract;
|
||||||
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
use phpOMS\DataStorage\Database\Connection\ConnectionFactory;
|
||||||
use phpOMS\DataStorage\Database\DatabaseStatus;
|
use phpOMS\DataStorage\Database\DatabaseStatus;
|
||||||
use phpOMS\Message\RequestAbstract;
|
use phpOMS\Message\RequestAbstract;
|
||||||
|
use Modules\ClientManagement\Models\ClientMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OMS import class
|
* OMS import class
|
||||||
|
|
@ -52,6 +52,7 @@ final class Importer extends ImporterAbstract
|
||||||
$end = new \DateTime($request->getData('end') ?? 'now');
|
$end = new \DateTime($request->getData('end') ?? 'now');
|
||||||
|
|
||||||
$type = (int) ($request->getData('type') ?? 0);
|
$type = (int) ($request->getData('type') ?? 0);
|
||||||
|
$source = (int) ($request->getData('source') ?? 0);
|
||||||
|
|
||||||
if ($type === ExchangeType::CUSTOMER) {
|
if ($type === ExchangeType::CUSTOMER) {
|
||||||
$this->importCustomer($start, $end);
|
$this->importCustomer($start, $end);
|
||||||
|
|
@ -151,7 +152,38 @@ final class Importer extends ImporterAbstract
|
||||||
*/
|
*/
|
||||||
public function importCustomer(\DateTime $start, \DateTime $end): void
|
public function importCustomer(\DateTime $start, \DateTime $end): void
|
||||||
{
|
{
|
||||||
|
$euTIN = CustomerIdTypeMapper::getByType(CustomerIdType::EU_TIN);
|
||||||
|
$gerTIN = CustomerIdTypeMapper::getByType(CustomerIdType::GER_TIN);
|
||||||
|
|
||||||
|
while (($line = \fgetcsv($this->remote)) !== false) {
|
||||||
|
$customer = new Client();
|
||||||
|
|
||||||
|
$customer->setNumber($line[0]);
|
||||||
|
$customer->getProfile()->getAccount()->setName1($line[1]);
|
||||||
|
$customer->getProfile()->getAccount()->setName2($line[2]);
|
||||||
|
$customer->getProfile()->getAccount()->setName3($line[3]);
|
||||||
|
//$customer->addEmail(EmailType::BUSINESS, $line[4]);
|
||||||
|
//$customer->addPhone(PhoneType::BUSINESS, $line[5]);
|
||||||
|
//$customer->addWebsite(PhoneType::BUSINESS, $line[5]);
|
||||||
|
|
||||||
|
$address = new Address();
|
||||||
|
$customer->setDefaultDeliveryAddress($address);
|
||||||
|
$customer->setDefaultInvoiceAddress($address);
|
||||||
|
|
||||||
|
$customer->setDefaultPaymentTerms(new PaymentTerms());
|
||||||
|
$customer->setCreditLimit($line[12]);
|
||||||
|
$customer->setStatus($line[9]);
|
||||||
|
$customer->setInfo($line[9]);
|
||||||
|
$customer->setAdvertisementMaterial($line[13]);
|
||||||
|
$customer->setSalesRep();
|
||||||
|
$customer->setType();
|
||||||
|
$customer->addPartner();
|
||||||
|
|
||||||
|
$customer->addId($euTIN, $line[10]);
|
||||||
|
$customer->addId($gerTIN, $line[11]);
|
||||||
|
|
||||||
|
ClientMapper::create($customer);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
*
|
*
|
||||||
* PHP Version 7.4
|
* PHP Version 7.4
|
||||||
*
|
*
|
||||||
* @package Modules\Exchange
|
* @package Modules\Exchange\Models
|
||||||
* @copyright Dennis Eichhorn
|
* @copyright Dennis Eichhorn
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
|
|
@ -21,7 +21,7 @@ use phpOMS\Stdlib\Base\Enum;
|
||||||
/**
|
/**
|
||||||
* Exchange status enum.
|
* Exchange status enum.
|
||||||
*
|
*
|
||||||
* @package Modules\Exchange
|
* @package Modules\Exchange\Models
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @link https://orange-management.org
|
* @link https://orange-management.org
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* PHP Version 7.4
|
* PHP Version 7.4
|
||||||
*
|
*
|
||||||
* @package Modules\Exchange
|
* @package Modules\Exchange\Models
|
||||||
* @copyright Dennis Eichhorn
|
* @copyright Dennis Eichhorn
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
|
|
@ -19,7 +19,7 @@ use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||||
/**
|
/**
|
||||||
* Mapper class.
|
* Mapper class.
|
||||||
*
|
*
|
||||||
* @package Modules\Exchange
|
* @package Modules\Exchange\Models
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @link https://orange-management.org
|
* @link https://orange-management.org
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* PHP Version 7.4
|
* PHP Version 7.4
|
||||||
*
|
*
|
||||||
* @package Modules\Exchange
|
* @package Modules\Exchange\Models
|
||||||
* @copyright Dennis Eichhorn
|
* @copyright Dennis Eichhorn
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @version 1.0.0
|
* @version 1.0.0
|
||||||
|
|
@ -19,7 +19,7 @@ use phpOMS\Stdlib\Base\Enum;
|
||||||
/**
|
/**
|
||||||
* Permision state enum.
|
* Permision state enum.
|
||||||
*
|
*
|
||||||
* @package Modules\Exchange
|
* @package Modules\Exchange\Models
|
||||||
* @license OMS License 1.0
|
* @license OMS License 1.0
|
||||||
* @link https://orange-management.org
|
* @link https://orange-management.org
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user