datetime is jsonserializable, didn't know that :)

This commit is contained in:
Dennis Eichhorn 2019-12-29 14:18:46 +01:00
parent 3fb7684a58
commit 0ed30bbcc3
5 changed files with 108 additions and 74 deletions

View File

@ -238,6 +238,20 @@ final class Importer extends ImporterAbstract
{ {
} }
/**
* Import articles
*
* @param \DateTime $start Start time (inclusive)
* @param \DateTime $end End time (inclusive)
*
* @return void
*
* @since 1.0.0
*/
public function importArticle(\DateTime $start, \DateTime $end) : void
{
}
/** /**
* Import invoices * Import invoices
* *

View File

@ -182,7 +182,7 @@ final class GSDCostCenter implements \JsonSerializable
return [ return [
'id' => $this->id, 'id' => $this->id,
'createdBy' => $this->createdBy, 'createdBy' => $this->createdBy,
'createdAt' => $this->createdAt->format('Y-m-d H:i:s'), 'createdAt' => $this->createdAt,
'description' => $this->description, 'description' => $this->description,
'costcenter' => $this->costCenter, 'costcenter' => $this->costCenter,
]; ];

View File

@ -182,7 +182,7 @@ final class GSDCostObject implements \JsonSerializable
return [ return [
'id' => $this->id, 'id' => $this->id,
'createdBy' => $this->createdBy, 'createdBy' => $this->createdBy,
'createdAt' => $this->createdAt->format('Y-m-d H:i:s'), 'createdAt' => $this->createdAt,
'description' => $this->description, 'description' => $this->description,
'costObject' => $this->costObject, 'costObject' => $this->costObject,
]; ];

View File

@ -13,12 +13,15 @@
declare(strict_types=1); declare(strict_types=1);
return [ return [
'Accounts' => 'Accounts', 'Assets' => 'Assets',
'Articles' => 'Articles', 'Accounts' => 'Accounts',
'Articles' => 'Articles',
'CostCenters' => 'Cost Centers', 'CostCenters' => 'Cost Centers',
'CostObjects' => 'Cost Objects', 'CostObjects' => 'Cost Objects',
'Customers' => 'Customers', 'Customers' => 'Customers',
'Invoices' => 'Invoices', 'Invoices' => 'Invoices',
'Options' => 'Options', 'Options' => 'Options',
'Suppliers' => 'Suppliers', 'Postings' => 'Postings',
'Stocks' => 'Stocks',
'Suppliers' => 'Suppliers',
]; ];

View File

@ -1,67 +1,84 @@
<div class="row"> <div class="row">
<div class="col-xs-12 col-md-6"> <div class="col-xs-12 col-md-6">
<section class="box wf-100"> <section class="box wf-100">
<header><h1><?= $this->getHtml('Import') ?> - GSD</h1></header> <header><h1><?= $this->getHtml('Import') ?> - GSD</h1></header>
<div class="inner"> <div class="inner">
<form id="fImport" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/exchange/import/profile?{?}&exchange=GSD&csrf={$CSRF}'); ?>"> <form id="fImport" method="POST" action="<?= \phpOMS\Uri\UriFactory::build('{/api}admin/exchange/import/profile?{?}&exchange=GSD&csrf={$CSRF}'); ?>">
<table class="layout wf-100" style="table-layout: fixed"> <table class="layout wf-100" style="table-layout: fixed">
<tbody> <tbody>
<tr><td><label for="iHost"><?= $this->getHtml('Host') ?></label> <tr><td><label for="iHost"><?= $this->getHtml('Host') ?></label>
<tr><td><input type="text" id="iHost" name="host" placeholder="&#xf040; <?= $this->getHtml('Host') ?>" required><input type="hidden" id="iDb" name="db" value="<?= \phpOMS\DataStorage\Database\DatabaseType::SQLSRV; ?>" required> <tr><td><input type="text" id="iHost" name="host" placeholder="&#xf040; <?= $this->getHtml('Host') ?>" required><input type="hidden" id="iDb" name="db" value="<?= \phpOMS\DataStorage\Database\DatabaseType::SQLSRV; ?>" required>
<tr><td><label for="iPort"><?= $this->getHtml('Port') ?></label> <tr><td><label for="iPort"><?= $this->getHtml('Port') ?></label>
<tr><td><input type="text" id="iPort" name="port" value="1433" required> <tr><td><input type="text" id="iPort" name="port" value="1433" required>
<tr><td><label for="iDatabase"><?= $this->getHtml('Database') ?></label> <tr><td><label for="iDatabase"><?= $this->getHtml('Database') ?></label>
<tr><td><input type="text" id="iDatabase" name="database" placeholder="&#xf040; <?= $this->getHtml('Database') ?>" required> <tr><td><input type="text" id="iDatabase" name="database" placeholder="&#xf040; <?= $this->getHtml('Database') ?>" required>
<tr><td><label for="iLogin"><?= $this->getHtml('Login') ?></label> <tr><td><label for="iLogin"><?= $this->getHtml('Login') ?></label>
<tr><td><input type="text" id="iLogin" name="login" placeholder="&#xf040; <?= $this->getHtml('Login') ?>" required> <tr><td><input type="text" id="iLogin" name="login" placeholder="&#xf040; <?= $this->getHtml('Login') ?>" required>
<tr><td><label for="iPassword"><?= $this->getHtml('Password') ?></label> <tr><td><label for="iPassword"><?= $this->getHtml('Password') ?></label>
<tr><td><input type="password" id="iPassword" name="password" placeholder="&#xf040; <?= $this->getHtml('Password') ?>" required> <tr><td><input type="password" id="iPassword" name="password" placeholder="&#xf040; <?= $this->getHtml('Password') ?>" required>
<tr><td><label for="iStart"><?= $this->getHtml('Start') ?></label> <tr><td><label for="iStart"><?= $this->getHtml('Start') ?></label>
<tr><td><input type="datetime-local" id="iStart" name="start" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>"> <tr><td><input type="datetime-local" id="iStart" name="start" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>">
<tr><td><label for="iEnd"><?= $this->getHtml('End') ?></label> <tr><td><label for="iEnd"><?= $this->getHtml('End') ?></label>
<tr><td><input type="datetime-local" id="iEnd" name="end" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>"> <tr><td><input type="datetime-local" id="iEnd" name="end" value="<?= $this->printHtml((new \DateTime('NOW'))->format('Y-m-d\TH:i:s')); ?>">
<tr><td><?= $this->getHtml('Options') ?> <tr><td><?= $this->getHtml('Options') ?>
<tr><td> <tr><td>
<span class="checkbox"> <table class="layout wf-100"><tr><td>
<input id="iCustomers" name="customers" type="checkbox" value="1"> <span class="checkbox">
<label for="iCustomers"><?= $lang['Customers']; ?></label> <input id="iCustomers" name="customers" type="checkbox" value="1">
</span> <label for="iCustomers"><?= $lang['Customers']; ?></label>
<tr><td> </span>
<span class="checkbox"> <td>
<input id="iSuppliers" name="suppliers" type="checkbox" value="1"> <span class="checkbox">
<label for="iSuppliers"><?= $lang['Suppliers']; ?></label> <input id="iInvoices" name="invoices" type="checkbox" value="1">
</span> <label for="iInvoices"><?= $lang['Invoices']; ?></label>
<tr><td> </span>
<span class="checkbox"> <tr><td>
<input id="iAccounts" name="accounts" type="checkbox" value="1"> <span class="checkbox">
<label for="iAccounts"><?= $lang['Accounts']; ?></label> <input id="iSuppliers" name="suppliers" type="checkbox" value="1">
</span> <label for="iSuppliers"><?= $lang['Suppliers']; ?></label>
<tr><td> </span>
<span class="checkbox"> <td>
<input id="iCostCenters" name="costcenters" type="checkbox" value="1"> <span class="checkbox">
<label for="iCostCenters"><?= $lang['CostCenters']; ?></label> <input id="iStocks" name="stocks" type="checkbox" value="1">
</span> <label for="iStocks"><?= $lang['Stocks']; ?></label>
<tr><td> </span>
<span class="checkbox"> <tr><td>
<input id="iCostObjects" name="costobjects" type="checkbox" value="1"> <span class="checkbox">
<label for="iCostObjects"><?= $lang['CostObjects']; ?></label> <input id="iAccounts" name="accounts" type="checkbox" value="1">
</span> <label for="iAccounts"><?= $lang['Accounts']; ?></label>
<tr><td> </span>
<span class="checkbox"> <td>
<input id="iArticles" name="articles" type="checkbox" value="1"> <span class="checkbox">
<label for="iArticles"><?= $lang['Articles']; ?></label> <input id="iAssets" name="assets" type="checkbox" value="1">
</span> <label for="iAssets"><?= $lang['Assets']; ?></label>
<tr><td> </span>
<span class="checkbox"> <tr><td>
<input id="iInvoices" name="invoices" type="checkbox" value="1"> <span class="checkbox">
<label for="iInvoices"><?= $lang['Invoices']; ?></label> <input id="iCostCenters" name="costcenters" type="checkbox" value="1">
</span> <label for="iCostCenters"><?= $lang['CostCenters']; ?></label>
<tr><td> </span>
<input type="submit" value="<?= $this->getHtml('Import'); ?>"> <td>
</table> <span class="checkbox">
</form> <input id="iPostings" name="postings" type="checkbox" value="1">
</div> <label for="iPostings"><?= $lang['Postings']; ?></label>
</section> </span>
</div> <tr><td>
<span class="checkbox">
<input id="iCostObjects" name="costobjects" type="checkbox" value="1">
<label for="iCostObjects"><?= $lang['CostObjects']; ?></label>
</span>
<tr><td>
<span class="checkbox">
<input id="iArticles" name="articles" type="checkbox" value="1">
<label for="iArticles"><?= $lang['Articles']; ?></label>
</span>
</table>
<tr><td>
<input type="submit" value="<?= $this->getHtml('Import'); ?>">
</table>
</form>
</div>
</section>
</div>
</div> </div>