mirror of
https://github.com/Karaka-Management/oms-SupplierManagement.git
synced 2026-01-11 17:28:41 +00:00
bug fixes / dbmapper fixes
This commit is contained in:
parent
960c5219bf
commit
3cba69b447
|
|
@ -144,6 +144,7 @@ final class ApiController extends Controller
|
|||
*/
|
||||
public function apiContactElementCreate(RequestAbstract $request, ResponseAbstract $response, $data = null) : void
|
||||
{
|
||||
/** @var \Modules\Profile\Controller\ApiController $profileModule */
|
||||
$profileModule = $this->app->moduleManager->get('Profile');
|
||||
|
||||
if (!empty($val = $profileModule->validateContactElementCreate($request))) {
|
||||
|
|
|
|||
|
|
@ -14,11 +14,11 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\SupplierManagement\Controller;
|
||||
|
||||
use Modules\Billing\Models\BillTypeL11n;
|
||||
use Modules\Billing\Models\PurchaseBillMapper;
|
||||
use Modules\SupplierManagement\Models\SupplierMapper;
|
||||
use phpOMS\Asset\AssetType;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\DataStorage\Database\Query\OrderType;
|
||||
use phpOMS\Localization\Money;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
|
|
@ -54,10 +54,13 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/SupplierManagement/Theme/Backend/supplier-list');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003202001, $request, $response));
|
||||
|
||||
$supplier = SupplierMapper::with('notes', models: null)
|
||||
::with('contactElements', models: null)
|
||||
//::with('type', 'backend_image', models: [Media::class]) // @todo: it would be nicer if I coult say files:type or files/type and remove the models parameter?
|
||||
::getAfterPivot(0, null, 25);
|
||||
$supplier = SupplierMapper::getAll()
|
||||
->with('profile')
|
||||
->with('profile/account')
|
||||
->with('profile/image')
|
||||
->with('mainAddress')
|
||||
->limit(25)
|
||||
->execute();
|
||||
|
||||
$view->addData('supplier', $supplier);
|
||||
|
||||
|
|
@ -108,10 +111,15 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/SupplierManagement/Theme/Backend/supplier-profile');
|
||||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1003202001, $request, $response));
|
||||
|
||||
$supplier = SupplierMapper
|
||||
::with('files', limit: 5)::orderBy('createdAt', 'ASC')
|
||||
::with('notes', limit: 5)::orderBy('id', 'ASC')
|
||||
::get((int) $request->getData('id'));
|
||||
$supplier = SupplierMapper::get()
|
||||
->with('profile')
|
||||
->with('profile/account')
|
||||
->with('contactElements')
|
||||
->with('mainAddress')
|
||||
->with('files')->limit(5, 'files')->sort('files/id', OrderType::DESC)
|
||||
->with('notes')->limit(5, 'files')->sort('notes/id', OrderType::DESC)
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->execute();
|
||||
|
||||
$view->setData('supplier', $supplier);
|
||||
|
||||
|
|
@ -120,7 +128,7 @@ final class BackendController extends Controller
|
|||
$ytd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->getId(), new SmartDateTime('Y-01-01'), new SmartDateTime('now'));
|
||||
$mtd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->getId(), new SmartDateTime('Y-m-01'), new SmartDateTime('now'));
|
||||
$lastOrder = PurchaseBillMapper::getLastOrderDateBySupplierId($supplier->getId());
|
||||
$newestInvoices = PurchaseBillMapper::with('language', $response->getLanguage(), [BillTypeL11n::class])::getNewestSupplierInvoices($supplier->getId(), 5);
|
||||
$newestInvoices = PurchaseBillMapper::getAll()->with('supplier')->where('supplier', $supplier->getId())->sort('id', OrderType::DESC)->limit(5)->execute();
|
||||
$monthlyPurchaseCosts = PurchaseBillMapper::getSupplierMonthlyPurchaseCosts($supplier->getId(), (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now'));
|
||||
} else {
|
||||
$ytd = new Money();
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ use Modules\Admin\Models\Address;
|
|||
use Modules\Admin\Models\NullAddress;
|
||||
use Modules\Editor\Models\EditorDoc;
|
||||
use Modules\Media\Models\Media;
|
||||
use Modules\Media\Models\NullMedia;
|
||||
use Modules\Profile\Models\ContactElement;
|
||||
use Modules\Profile\Models\NullContactElement;
|
||||
use Modules\Profile\Models\Profile;
|
||||
|
|
@ -304,6 +305,26 @@ class Supplier
|
|||
return $files;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all media files by type
|
||||
*
|
||||
* @param int $type Media type
|
||||
*
|
||||
* @return Media
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getFileByType(int $type) : Media
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if ($file->type === $type) {
|
||||
return $file;
|
||||
}
|
||||
}
|
||||
|
||||
return new NullMedia();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ final class SupplierAttributeMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'suppliermgmt_supplier_attr_id' => ['name' => 'suppliermgmt_supplier_attr_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_supplier_attr_supplier' => ['name' => 'suppliermgmt_supplier_attr_supplier', 'type' => 'int', 'internal' => 'supplier'],
|
||||
'suppliermgmt_supplier_attr_type' => ['name' => 'suppliermgmt_supplier_attr_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'suppliermgmt_supplier_attr_value' => ['name' => 'suppliermgmt_supplier_attr_value', 'type' => 'int', 'internal' => 'value'],
|
||||
'suppliermgmt_supplier_attr_id' => ['name' => 'suppliermgmt_supplier_attr_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_supplier_attr_supplier' => ['name' => 'suppliermgmt_supplier_attr_supplier', 'type' => 'int', 'internal' => 'supplier'],
|
||||
'suppliermgmt_supplier_attr_type' => ['name' => 'suppliermgmt_supplier_attr_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'suppliermgmt_supplier_attr_value' => ['name' => 'suppliermgmt_supplier_attr_value', 'type' => 'int', 'internal' => 'value'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -47,12 +47,12 @@ final class SupplierAttributeMapper extends DataMapperFactory
|
|||
*/
|
||||
public const OWNS_ONE = [
|
||||
'type' => [
|
||||
'mapper' => SupplierAttributeTypeMapper::class,
|
||||
'external' => 'suppliermgmt_supplier_attr_type',
|
||||
'mapper' => SupplierAttributeTypeMapper::class,
|
||||
'external' => 'suppliermgmt_supplier_attr_type',
|
||||
],
|
||||
'value' => [
|
||||
'mapper' => SupplierAttributeValueMapper::class,
|
||||
'external' => 'suppliermgmt_supplier_attr_value',
|
||||
'mapper' => SupplierAttributeValueMapper::class,
|
||||
'external' => 'suppliermgmt_supplier_attr_value',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ final class SupplierAttributeTypeL11nMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'suppliermgmt_attr_type_l11n_id' => ['name' => 'suppliermgmt_attr_type_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_attr_type_l11n_title' => ['name' => 'suppliermgmt_attr_type_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
|
||||
'suppliermgmt_attr_type_l11n_type' => ['name' => 'suppliermgmt_attr_type_l11n_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'suppliermgmt_attr_type_l11n_lang' => ['name' => 'suppliermgmt_attr_type_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
'suppliermgmt_attr_type_l11n_id' => ['name' => 'suppliermgmt_attr_type_l11n_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_attr_type_l11n_title' => ['name' => 'suppliermgmt_attr_type_l11n_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
|
||||
'suppliermgmt_attr_type_l11n_type' => ['name' => 'suppliermgmt_attr_type_l11n_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'suppliermgmt_attr_type_l11n_lang' => ['name' => 'suppliermgmt_attr_type_l11n_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -33,12 +33,12 @@ final class SupplierAttributeTypeMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'suppliermgmt_attr_type_id' => ['name' => 'suppliermgmt_attr_type_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_attr_type_name' => ['name' => 'suppliermgmt_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
|
||||
'suppliermgmt_attr_type_fields' => ['name' => 'suppliermgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
|
||||
'suppliermgmt_attr_type_custom' => ['name' => 'suppliermgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
||||
'suppliermgmt_attr_type_pattern' => ['name' => 'suppliermgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
||||
'suppliermgmt_attr_type_required' => ['name' => 'suppliermgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
||||
'suppliermgmt_attr_type_id' => ['name' => 'suppliermgmt_attr_type_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_attr_type_name' => ['name' => 'suppliermgmt_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
|
||||
'suppliermgmt_attr_type_fields' => ['name' => 'suppliermgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
|
||||
'suppliermgmt_attr_type_custom' => ['name' => 'suppliermgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
|
||||
'suppliermgmt_attr_type_pattern' => ['name' => 'suppliermgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
|
||||
'suppliermgmt_attr_type_required' => ['name' => 'suppliermgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -49,17 +49,17 @@ final class SupplierAttributeTypeMapper extends DataMapperFactory
|
|||
*/
|
||||
public const HAS_MANY = [
|
||||
'l11n' => [
|
||||
'mapper' => SupplierAttributeTypeL11nMapper::class,
|
||||
'table' => 'suppliermgmt_attr_type_l11n',
|
||||
'self' => 'suppliermgmt_attr_type_l11n_type',
|
||||
'column' => 'title',
|
||||
'external' => null,
|
||||
'mapper' => SupplierAttributeTypeL11nMapper::class,
|
||||
'table' => 'suppliermgmt_attr_type_l11n',
|
||||
'self' => 'suppliermgmt_attr_type_l11n_type',
|
||||
'column' => 'title',
|
||||
'external' => null,
|
||||
],
|
||||
'defaults' => [
|
||||
'mapper' => SupplierAttributeValueMapper::class,
|
||||
'table' => 'suppliermgmt_supplier_attr_default',
|
||||
'self' => 'suppliermgmt_supplier_attr_default_type',
|
||||
'external' => 'suppliermgmt_supplier_attr_default_value'
|
||||
'mapper' => SupplierAttributeValueMapper::class,
|
||||
'table' => 'suppliermgmt_supplier_attr_default',
|
||||
'self' => 'suppliermgmt_supplier_attr_default_type',
|
||||
'external' => 'suppliermgmt_supplier_attr_default_value'
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 1.0
|
||||
* @version 1.0.0
|
||||
* @link https: //orange-management.org
|
||||
* @link https://orange-management.org
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
*
|
||||
* @package Modules\SupplierManagement\Models
|
||||
* @license OMS License 1.0
|
||||
* @link https: //orange-management.org
|
||||
* @link https://orange-management.org
|
||||
* @since 1.0.0
|
||||
*/
|
||||
final class SupplierAttributeValueMapper extends DataMapperFactory
|
||||
|
|
@ -33,15 +33,15 @@ final class SupplierAttributeValueMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'suppliermgmt_attr_value_id' => ['name' => 'suppliermgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_attr_value_default' => ['name' => 'suppliermgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
|
||||
'suppliermgmt_attr_value_type' => ['name' => 'suppliermgmt_attr_value_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'suppliermgmt_attr_value_valueStr' => ['name' => 'suppliermgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
|
||||
'suppliermgmt_attr_value_valueInt' => ['name' => 'suppliermgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
|
||||
'suppliermgmt_attr_value_valueDec' => ['name' => 'suppliermgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
|
||||
'suppliermgmt_attr_value_id' => ['name' => 'suppliermgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_attr_value_default' => ['name' => 'suppliermgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
|
||||
'suppliermgmt_attr_value_type' => ['name' => 'suppliermgmt_attr_value_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'suppliermgmt_attr_value_valueStr' => ['name' => 'suppliermgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
|
||||
'suppliermgmt_attr_value_valueInt' => ['name' => 'suppliermgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
|
||||
'suppliermgmt_attr_value_valueDec' => ['name' => 'suppliermgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
|
||||
'suppliermgmt_attr_value_valueDat' => ['name' => 'suppliermgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
|
||||
'suppliermgmt_attr_value_lang' => ['name' => 'suppliermgmt_attr_value_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
'suppliermgmt_attr_value_country' => ['name' => 'suppliermgmt_attr_value_country', 'type' => 'string', 'internal' => 'country'],
|
||||
'suppliermgmt_attr_value_lang' => ['name' => 'suppliermgmt_attr_value_lang', 'type' => 'string', 'internal' => 'language'],
|
||||
'suppliermgmt_attr_value_country' => ['name' => 'suppliermgmt_attr_value_country', 'type' => 'string', 'internal' => 'country'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -38,15 +38,15 @@ final class SupplierMapper extends DataMapperFactory
|
|||
* @since 1.0.0
|
||||
*/
|
||||
public const COLUMNS = [
|
||||
'suppliermgmt_supplier_id' => ['name' => 'suppliermgmt_supplier_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_supplier_no' => ['name' => 'suppliermgmt_supplier_no', 'type' => 'string', 'internal' => 'number'],
|
||||
'suppliermgmt_supplier_no_reverse' => ['name' => 'suppliermgmt_supplier_no_reverse', 'type' => 'string', 'internal' => 'numberReverse'],
|
||||
'suppliermgmt_supplier_status' => ['name' => 'suppliermgmt_supplier_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'suppliermgmt_supplier_type' => ['name' => 'suppliermgmt_supplier_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'suppliermgmt_supplier_info' => ['name' => 'suppliermgmt_supplier_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'suppliermgmt_supplier_id' => ['name' => 'suppliermgmt_supplier_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'suppliermgmt_supplier_no' => ['name' => 'suppliermgmt_supplier_no', 'type' => 'string', 'internal' => 'number'],
|
||||
'suppliermgmt_supplier_no_reverse' => ['name' => 'suppliermgmt_supplier_no_reverse', 'type' => 'string', 'internal' => 'numberReverse'],
|
||||
'suppliermgmt_supplier_status' => ['name' => 'suppliermgmt_supplier_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'suppliermgmt_supplier_type' => ['name' => 'suppliermgmt_supplier_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'suppliermgmt_supplier_info' => ['name' => 'suppliermgmt_supplier_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'suppliermgmt_supplier_created_at' => ['name' => 'suppliermgmt_supplier_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
|
||||
'suppliermgmt_supplier_profile' => ['name' => 'suppliermgmt_supplier_profile', 'type' => 'int', 'internal' => 'profile'],
|
||||
'suppliermgmt_supplier_address' => ['name' => 'suppliermgmt_supplier_address', 'type' => 'int', 'internal' => 'mainAddress'],
|
||||
'suppliermgmt_supplier_profile' => ['name' => 'suppliermgmt_supplier_profile', 'type' => 'int', 'internal' => 'profile'],
|
||||
'suppliermgmt_supplier_address' => ['name' => 'suppliermgmt_supplier_address', 'type' => 'int', 'internal' => 'mainAddress'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -81,12 +81,12 @@ final class SupplierMapper extends DataMapperFactory
|
|||
*/
|
||||
public const OWNS_ONE = [
|
||||
'profile' => [
|
||||
'mapper' => ProfileMapper::class,
|
||||
'external' => 'suppliermgmt_supplier_profile',
|
||||
'mapper' => ProfileMapper::class,
|
||||
'external' => 'suppliermgmt_supplier_profile',
|
||||
],
|
||||
'mainAddress' => [
|
||||
'mapper' => AddressMapper::class,
|
||||
'external' => 'suppliermgmt_supplier_address',
|
||||
'mapper' => AddressMapper::class,
|
||||
'external' => 'suppliermgmt_supplier_address',
|
||||
],
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<tbody>
|
||||
<?php $count = 0; foreach ($suppliers as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/prefix}purchase/supplier/profile?{?}&id=' . $value->getId());
|
||||
$image = $value->getFileByType('backend_image'); ?>
|
||||
$image = $value->getFileByType(0); ?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><img width="30" loading="lazy" class="item-image"
|
||||
src="<?= $image instanceof NullMedia ?
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\Profile\Models\ContactType;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$countryCodes = \phpOMS\Localization\ISO3166TwoEnum::getConstants();
|
||||
|
|
@ -61,7 +62,7 @@ echo $this->getData('nav')->render();
|
|||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-lg-3 last-lg">
|
||||
<section class="portlet">
|
||||
<section class="portlet">
|
||||
<form>
|
||||
<div class="portlet-body">
|
||||
<table class="layout wf-100">
|
||||
|
|
@ -73,23 +74,6 @@ echo $this->getData('nav')->render();
|
|||
<tr><td><input type="text" id="iName2" name="name2" value="<?= $this->printHtml($supplier->profile->account->name2); ?>">
|
||||
<tr><td><label for="iName3"><?= $this->getHtml('Name3'); ?></label>
|
||||
<tr><td><input type="text" id="iName3" name="name3" value="<?= $this->printHtml($supplier->profile->account->name3); ?>">
|
||||
<tr><td><h3><?= $this->getHtml('Address'); ?></h3>
|
||||
<?php if (!empty($supplier->mainAddress->addition)) : ?>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Addition'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->mainAddress->addition); ?>">
|
||||
<?php endif; ?>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Address'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->mainAddress->address); ?>" required>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Postal'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->mainAddress->postal); ?>" required>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('City'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->mainAddress->city); ?>" required>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Country'); ?></label>
|
||||
<tr><td><select>
|
||||
<?php foreach ($countryCodes as $code3 => $code2) : ?>
|
||||
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $supplier->mainAddress->getCountry() ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</table>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
|
|
@ -98,6 +82,73 @@ echo $this->getData('nav')->render();
|
|||
</form>
|
||||
</section>
|
||||
|
||||
<section class="portlet">
|
||||
<div class="portlet-head">
|
||||
<?= $this->getHtml('Contact'); ?>
|
||||
<a class="floatRight" href=""><i class="fa fa-envelope-o btn"></i></a>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<table class="layout wf-100">
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Phone'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->getMainContactElement(ContactType::PHONE)->content); ?>">
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Email'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->getMainContactElement(ContactType::EMAIL)->content); ?>">
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Website'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->getMainContactElement(ContactType::WEBSITE)->content); ?>">
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="portlet">
|
||||
<div class="portlet-head">
|
||||
<?= $this->getHtml('Address'); ?>
|
||||
<span class="clickPopup floatRight">
|
||||
<label for="addressDropdown"><i class="fa fa-print btn"></i></label>
|
||||
<input id="addressDropdown" name="addressDropdown" type="checkbox">
|
||||
<div class="popup">
|
||||
<ul>
|
||||
<li>
|
||||
<input id="id1" type="checkbox">
|
||||
<ul>
|
||||
<li>
|
||||
<label for="id1">
|
||||
<a href="" class="button">Word</a>
|
||||
<span></span>
|
||||
<i class="fa fa-chevron-right expand"></i>
|
||||
</label>
|
||||
<li>Letter
|
||||
</ul>
|
||||
<li><label class="button cancel" for="addressDropdown">Cancel</label>
|
||||
</ul>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<div class="portlet-body">
|
||||
<table class="layout wf-100">
|
||||
<?php if (!empty($supplier->mainAddress->addition)) : ?>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Addition'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->mainAddress->addition); ?>">
|
||||
<?php endif; ?>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Address'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->mainAddress->address); ?>" required>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Postal'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->mainAddress->postal); ?>" required>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('City'); ?></label>
|
||||
<tr><td><input type="text" id="iName1" name="name1" value="<?= $this->printHtml($supplier->mainAddress->city); ?>" required>
|
||||
<tr><td><label for="iName1"><?= $this->getHtml('Country'); ?></label>
|
||||
<tr><td><select>
|
||||
<?php foreach ($countryCodes as $code3 => $code2) : ?>
|
||||
<option value="<?= $this->printHtml($code2); ?>"<?= $this->printHtml($code2 === $supplier->mainAddress->getCountry() ? ' selected' : ''); ?>><?= $this->printHtml($countries[$code3]); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<tr><td>
|
||||
<?php if (\is_file(__DIR__ . '/../../../../phpOMS/Localization/Maps/svg/' . \strtolower($supplier->mainAddress->getCountry()) . '.svg')) : ?>
|
||||
<img id="iMap" style="width: 100%;" src="<?= UriFactory::build('phpOMS/Localization/Maps/svg/' . \strtolower($supplier->mainAddress->getCountry()) . '.svg'); ?>">
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="portlet highlight-4">
|
||||
<div class="portlet-body">
|
||||
<textarea class="undecorated"><?= $this->printHtml($supplier->info); ?></textarea>
|
||||
|
|
@ -233,14 +284,16 @@ echo $this->getData('nav')->render();
|
|||
<td><?= $this->getHtml('Net'); ?>
|
||||
<td><?= $this->getHtml('Date'); ?>
|
||||
<tbody>
|
||||
<?php foreach ($newestInvoices as $invoice) :
|
||||
<?php
|
||||
/** @var \Modules\Billing\Models\Bill $invoice */
|
||||
foreach ($newestInvoices as $invoice) :
|
||||
$url = UriFactory::build('{/prefix}purchase/bill?{?}&id=' . $invoice->getId());
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><?= $invoice->getNumber(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $invoice->type->getL11n(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $invoice->billTo; ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $invoice->net->getCurrency(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $invoice->netSales->getCurrency(); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $invoice->createdAt->format('Y-m-d'); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user