diff --git a/Admin/Install/Navigation.install.json b/Admin/Install/Navigation.install.json index 0d19ec5..cdd5012 100755 --- a/Admin/Install/Navigation.install.json +++ b/Admin/Install/Navigation.install.json @@ -79,8 +79,8 @@ "pid": "/purchase", "type": 3, "subtype": 1, - "name": "Values", - "uri": "{/base}/purchase/supplier/attribute/value/list?{?}", + "name": "Create", + "uri": "{/base}/purchase/supplier/attribute/type/create?{?}", "target": "self", "icon": null, "order": 15, diff --git a/Controller/ApiController.php b/Controller/ApiController.php index 0fc0452..8998428 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -96,7 +96,7 @@ final class ApiController extends Controller /** * Create directory for an account * - * @param int $id Item number + * @param int $id Item number * @param int $createdBy Creator of the directory * * @return Collection @@ -174,7 +174,7 @@ final class ApiController extends Controller /** @var \Modules\Attribute\Models\AttributeType[] $types */ $types = SupplierAttributeTypeMapper::getAll() ->where('name', \array_keys($segmentation), 'IN') - ->execute(); + ->executeGetArray(); foreach ($types as $type) { $internalResponse = clone $response; diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 46ee841..d8d5019 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -14,22 +14,25 @@ declare(strict_types=1); namespace Modules\SupplierManagement\Controller; -use Modules\Billing\Models\PurchaseBillMapper; +use Modules\Auditor\Models\AuditMapper; use Modules\Media\Models\MediaMapper; use Modules\Media\Models\MediaTypeMapper; +use Modules\Organization\Models\Attribute\UnitAttributeMapper; use Modules\SupplierManagement\Models\Attribute\SupplierAttributeTypeL11nMapper; use Modules\SupplierManagement\Models\Attribute\SupplierAttributeTypeMapper; use Modules\SupplierManagement\Models\Attribute\SupplierAttributeValueL11nMapper; use Modules\SupplierManagement\Models\Attribute\SupplierAttributeValueMapper; +use Modules\SupplierManagement\Models\PermissionCategory; use Modules\SupplierManagement\Models\SupplierMapper; +use phpOMS\Account\PermissionType; use phpOMS\Asset\AssetType; use phpOMS\Contract\RenderableInterface; use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\OrderType; -use phpOMS\Localization\Money; +use phpOMS\DataStorage\Database\Query\Where; use phpOMS\Message\RequestAbstract; use phpOMS\Message\ResponseAbstract; -use phpOMS\Stdlib\Base\SmartDateTime; +use phpOMS\Utils\StringUtils; use phpOMS\Views\View; /** @@ -57,13 +60,13 @@ final class BackendController extends Controller */ public function viewSupplierManagementAttributeTypeList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface { - $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response); + $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeListView($this->app->l11nManager, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003203001, $request, $response); $view->attributes = SupplierAttributeTypeMapper::getAll() ->with('l11n') ->where('l11n/language', $response->header->l11n->language) - ->execute(); + ->executeGetArray(); $view->path = 'purchase/supplier'; @@ -92,7 +95,7 @@ final class BackendController extends Controller $attributes = SupplierAttributeValueMapper::getAll() ->with('l11n') ->where('l11n/language', $response->header->l11n->language) - ->execute(); + ->executeGetArray(); $view->data['attributes'] = $attributes; @@ -113,7 +116,7 @@ final class BackendController extends Controller */ public function viewSupplierManagementAttributeType(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface { - $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response); + $view = new \Modules\Attribute\Theme\Backend\Components\AttributeTypeView($this->app->l11nManager, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003203001, $request, $response); $view->attribute = SupplierAttributeTypeMapper::get() @@ -127,7 +130,7 @@ final class BackendController extends Controller $view->l11ns = SupplierAttributeTypeL11nMapper::getAll() ->where('ref', $view->attribute->id) - ->execute(); + ->executeGetArray(); $view->path = 'purchase/supplier'; @@ -148,7 +151,7 @@ final class BackendController extends Controller */ public function viewSupplierManagementAttributeValue(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface { - $view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response); + $view = new \Modules\Attribute\Theme\Backend\Components\AttributeValueView($this->app->l11nManager, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003203001, $request, $response); $view->attribute = SupplierAttributeValueMapper::get() @@ -159,7 +162,7 @@ final class BackendController extends Controller $view->l11ns = SupplierAttributeValueL11nMapper::getAll() ->where('ref', $view->attribute->id) - ->execute(); + ->executeGetArray(); // @todo Also find the ItemAttributeType @@ -189,7 +192,7 @@ final class BackendController extends Controller ->with('mainAddress') ->where('unit', $this->app->unitId) ->limit(25) - ->execute(); + ->executeGetArray(); $view->data['supplier'] = $supplier; @@ -211,7 +214,7 @@ final class BackendController extends Controller public function viewSupplierManagementSupplierCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface { $view = new View($this->app->l11nManager, $request, $response); - $view->setTemplate('/Modules/SupplierManagement/Theme/Backend/supplier-create'); + $view->setTemplate('/Modules/SupplierManagement/Theme/Backend/supplier-view'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003202001, $request, $response); return $view; @@ -243,17 +246,43 @@ final class BackendController extends Controller $view->setTemplate('/Modules/SupplierManagement/Theme/Backend/supplier-view'); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1003202001, $request, $response); - /** @var \Modules\SupplierManagement\Models\Supplier $supplier */ - $supplier = SupplierMapper::get() + $pkType = 'id'; + $pkValue = $request->getDataInt('id'); + if ($pkValue === null) { + $pkType = 'number'; + $pkValue = $request->getDataString('number'); + } + + $view->data['supplier'] = SupplierMapper::get() ->with('account') - ->with('contactElements') + ->with('account/addresses') + ->with('account/contacts') ->with('mainAddress') ->with('files')->limit(5, 'files')->sort('files/id', OrderType::DESC) ->with('notes')->limit(5, 'notes')->sort('notes/id', OrderType::DESC) - ->where('id', (int) $request->getData('id')) + ->with('attributes') + ->with('attributes/type') + ->with('attributes/type/l11n') + ->with('attributes/value') + //->with('attributes/value/l11n') + //->with('attributes/value/l11n') + ->where($pkType, $pkValue) + ->where('attributes/type/l11n/language', $response->header->l11n->language) + //->where('attributes/value/l11n/language', $response->header->l11n->language) + /* + ->where('attributes/value/l11n', (new Where($this->app->dbPool->get())) + ->where(SupplierAttributeValueL11nMapper::getColumnByMember('ref'), '=', null) + ->orWhere(SupplierAttributeValueL11nMapper::getColumnByMember('language'), '=', $response->header->l11n->language)) + */ ->execute(); - $view->data['supplier'] = $supplier; + $view->data['attributeView'] = new \Modules\Attribute\Theme\Backend\Components\AttributeView($this->app->l11nManager, $request, $response); + $view->data['attributeView']->data['default_localization'] = $this->app->l11nServer; + + $view->data['attributeTypes'] = SupplierAttributeTypeMapper::getAll() + ->with('l11n') + ->where('l11n/language', $response->header->l11n->language) + ->executeGetArray(); // Get item profile image // @feature Create a new read mapper function that returns relation models instead of its own model @@ -269,38 +298,107 @@ final class BackendController extends Controller ->on(MediaMapper::TABLE . '.' . MediaMapper::PRIMARYFIELD, '=', MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['self']) ->leftJoin(MediaTypeMapper::TABLE) ->on(MediaMapper::HAS_MANY['types']['table'] . '.' . MediaMapper::HAS_MANY['types']['external'], '=', MediaTypeMapper::TABLE . '.' . MediaTypeMapper::PRIMARYFIELD) - ->where(SupplierMapper::HAS_MANY['files']['self'], '=', $supplier->id) + ->where(SupplierMapper::HAS_MANY['files']['self'], '=', $view->data['supplier']->id) ->where(MediaTypeMapper::TABLE . '.' . MediaTypeMapper::getColumnByMember('name'), '=', 'supplier_profile_image'); - $clientImage = MediaMapper::get() + $view->data['supplierImage'] = MediaMapper::get() ->where('id', $results) ->limit(1) ->execute(); - $view->data['clientImage'] = $clientImage; + $businessStart = UnitAttributeMapper::get() + ->with('type') + ->with('value') + ->where('ref', $this->app->unitId) + ->where('type/name', 'business_year_start') + ->execute(); - // stats - if ($this->app->moduleManager->isActive('Billing')) { - $ytd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->id, new SmartDateTime('Y-01-01'), new SmartDateTime('now')); - $mtd = PurchaseBillMapper::getPurchaseBySupplierId($supplier->id, new SmartDateTime('Y-m-01'), new SmartDateTime('now')); - $lastOrder = PurchaseBillMapper::getLastOrderDateBySupplierId($supplier->id); - $newestInvoices = PurchaseBillMapper::getAll()->with('supplier')->where('supplier', $supplier->id)->sort('id', OrderType::DESC)->limit(5)->execute(); - $monthlyPurchaseCosts = PurchaseBillMapper::getSupplierMonthlyPurchaseCosts($supplier->id, (new SmartDateTime('now'))->createModify(-1), new SmartDateTime('now')); - } else { - $ytd = new Money(); - $mtd = new Money(); - $lastOrder = null; - $newestInvoices = []; - $monthlyPurchaseCosts = []; - } + $view->data['business_start'] = $businessStart->id === 0 ? 1 : $businessStart->value->getValue(); - $view->data['ytd'] = $ytd; - $view->data['mtd'] = $mtd; - $view->data['lastOrder'] = $lastOrder; - $view->data['newestInvoices'] = $newestInvoices; - $view->data['monthlyPurchaseCosts'] = $monthlyPurchaseCosts; + $view->data['hasBilling'] = $this->app->moduleManager->isActive('Billing'); + $view->data['hasAccounting'] = $this->app->moduleManager->isActive('Accounting'); - return $view; + $view->data['prices'] = $view->data['hasBilling'] + ? \Modules\Billing\Models\Price\PriceMapper::getAll() + ->where('supplier', $view->data['supplier']->id) + ->where('type', \Modules\Billing\Models\Price\PriceType::PURCHASE) + ->executeGetArray() + : []; + + /** @var \Modules\Attribute\Models\AttributeType[] $tmp */ + $tmp = SupplierAttributeTypeMapper::getAll() + ->with('defaults') + ->with('defaults/l11n') + ->where('name', [ + 'segment', 'section', 'sales_group', 'product_group', 'product_type', + 'sales_tax_code', 'purchase_tax_code', + ], 'IN') + ->where('defaults/l11n', (new Where($this->app->dbPool->get())) + ->where(SupplierAttributeValueL11nMapper::getColumnByMember('ref') ?? '', '=', null) + ->orWhere(SupplierAttributeValueL11nMapper::getColumnByMember('language') ?? '', '=', $response->header->l11n->language)) + ->executeGetArray(); + + $defaultAttributeTypes = []; + foreach ($tmp as $t) { + $defaultAttributeTypes[$t->name] = $t; + } + + $view->data['defaultAttributeTypes'] = $defaultAttributeTypes; + + /** @var \Modules\Attribute\Models\AttributeType[] $tmp */ + $tmp = SupplierAttributeTypeMapper::getAll() + ->with('defaults') + ->with('defaults/l11n') + ->where('name', [ + 'segment', 'section', 'supplier_group', 'supplier_type', + 'sales_tax_code', + ], 'IN') + ->where('defaults/l11n', (new Where($this->app->dbPool->get())) + ->where(SupplierAttributeValueL11nMapper::getColumnByMember('ref') ?? '', '=', null) + ->orWhere(SupplierAttributeValueL11nMapper::getColumnByMember('language') ?? '', '=', $response->header->l11n->language)) + ->executeGetArray(); + + $supplierSegmentationTypes = []; + foreach ($tmp as $t) { + $supplierSegmentationTypes[$t->name] = $t; + } + + $view->data['supplierSegmentationTypes'] = $supplierSegmentationTypes; + + $logs = []; + if ($this->app->accountManager->get($request->header->account)->hasPermission( + PermissionType::READ, + $this->app->unitId, + null, + self::NAME, + PermissionCategory::SUPPLIER_LOG, + ) + ) { + /** @var \Modules\Auditor\Models\Audit[] */ + $logs = AuditMapper::getAll() + ->where('type', StringUtils::intHash(SupplierMapper::class)) + ->where('module', 'SupplierManagement') + ->where('ref', (string) $view->data['supplier']->id) + ->executeGetArray(); + } + + $view->data['logs'] = $logs; + + // @todo join audit with files, attributes, localization, prices, notes, ... + + $view->data['files'] = MediaMapper::getAll() + ->with('types') + ->join('id', SupplierMapper::class, 'files') // id = media id, files = supplier relations + ->on('id', $view->data['supplier']->id, relation: 'files') // id = item id + ->executeGetArray(); + + $view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response); + $view->data['note'] = new \Modules\Editor\Theme\Backend\Components\Note\BaseView($this->app->l11nManager, $request, $response); + + $view->data['address-component'] = new \Modules\Admin\Theme\Backend\Components\AddressEditor\AddressView($this->app->l11nManager, $request, $response); + $view->data['contact-component'] = new \Modules\Admin\Theme\Backend\Components\ContactEditor\ContactView($this->app->l11nManager, $request, $response); + + return $view; } /** diff --git a/Models/PermissionCategory.php b/Models/PermissionCategory.php index a370a98..ad7b793 100755 --- a/Models/PermissionCategory.php +++ b/Models/PermissionCategory.php @@ -31,4 +31,6 @@ abstract class PermissionCategory extends Enum public const ANALYSIS = 2; public const ATTRIBUTE = 4; + + public const SUPPLIER_LOG = 5; } diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index e3aa1f9..dbaddc7 100755 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -13,96 +13,121 @@ declare(strict_types=1); return ['SupplierManagement' => [ - 'Accounting' => 'Buchhaltung', - 'Address' => 'Adresse', - 'Addresses' => 'Adressen', - 'AreaManager' => 'Bereichsleiter', - 'Articlegroup' => 'ArtikelGroup.', - 'Articles' => 'Artikel', - 'Attribute' => '', - 'AttributeTypes' => 'Attributetypen', - 'Attributes' => '', - 'Balance' => 'Gleichgewicht', - 'Bills' => '', - 'Bonus' => 'Bonus', - 'CLV' => 'CLV', - 'Calendar' => 'Kalender', - 'City' => 'Stadt', - 'Client' => 'Kunde', - 'ClientID' => 'Kunden ID', - 'Contact' => 'Kontakt', - 'Country' => 'Land', - 'Created' => 'Erstellt', - 'CreatedAt' => '', - 'CreditRating' => 'Kreditbeurteilung', - 'Creditcard' => 'Kreditkarte', - 'DSO' => 'DSO.', - 'DUE' => 'Fällig', - 'Date' => 'Datum', - 'Default' => 'Standard', - 'Delivery' => 'Die Zustellung', - 'Discount' => 'Rabatt', - 'DiscountBonus' => '', - 'DiscountP' => 'Rabatt %', - 'Documents' => 'Unterlagen', - 'Due' => '', - 'Email' => 'Email', - 'Fax' => 'Fax', - 'Files' => 'Dateien', - 'Freightage' => 'Fracht', - 'Group' => 'Gruppe', - 'ID' => 'ICH WÜRDE', - 'Info' => 'Die Info', - 'Invoice' => 'Rechnung', - 'Invoices' => 'Rechnungen', - 'IsDefault' => 'Ist default', - 'Items' => '', - 'LastContact' => 'Letzter Kontakt', - 'LastOrder' => 'Letzte Bestellung', - 'Log' => 'Protokoll', - 'Logs' => 'Protokoll', - 'MRR' => 'Mrr.', - 'MTDSales' => 'MTD-Verkäufe.', - 'Map' => '', - 'Margin' => 'Rand', - 'Master' => 'Meister', - 'Messages' => 'Mitteilungen', - 'Modified' => 'Geändert', - 'Name' => 'Name', - 'Name1' => 'Name1', - 'Name2' => 'Name2', - 'Name3' => 'Name3', - 'Net' => 'Netz', - 'Notes' => 'Anmerkungen', - 'Number' => 'Nummer', - 'Office' => 'Sekretariat', - 'Payment' => 'Zahlung', - 'PaymentTerm' => 'Zahlungsbezeichnung', - 'Permission' => 'Erlaubnis', - 'Phone' => 'Telefon', - 'Postal' => 'Post', - 'Price' => 'Preis', - 'Prices' => 'Preise', - 'Productgroup' => 'Produktgruppe', - 'Profile' => 'Profil', - 'Profit' => '', - 'Purchase' => 'Kaufen', - 'Quantity' => 'Menge', - 'RecentInvoices' => 'Jüngste Rechnungen', - 'Sales' => 'Umsatz', - 'Segment' => 'Segment', - 'Segments' => 'Segmente', - 'Subtype' => 'Untertyp', - 'Supplier' => 'Anbieter', - 'Suppliers' => 'Lieferanten', - 'Support' => 'Unterstützung', - 'Tags' => 'Stichworte', - 'Title' => '', - 'TotalPrice' => '', - 'Type' => 'Typ', - 'UnitPrice' => '', - 'Website' => '', - 'Wire' => 'Kabel', - 'YTDSales' => 'Ytd Sales.', - 'Zip' => 'Reißverschluss', + 'Accounting' => 'Buchhaltung', + 'Address' => 'Adresse', + 'Addresses' => 'Adressen', + 'AreaManager' => 'Bereichsleiter', + 'Articlegroup' => 'ArtikelGroup.', + 'Articles' => 'Artikel', + 'Attribute' => 'Attribut', + 'AttributeTypes' => 'Attributetypen', + 'Attributes' => 'Attribute', + 'Balance' => 'Gleichgewicht', + 'Bills' => 'Rechnungen', + 'Bonus' => 'Bonus', + 'CLV' => 'CLV', + 'Calendar' => 'Kalender', + 'City' => 'Stadt', + 'Client' => 'Kunde', + 'ClientID' => 'Kunden ID', + 'Contact' => 'Kontakt', + 'Country' => 'Land', + 'Created' => 'Erstellt', + 'CreatedAt' => 'Erstellt', + 'CreditRating' => 'Kreditbeurteilung', + 'Creditcard' => 'Kreditkarte', + 'DSO' => 'DSO.', + 'DUE' => 'Fällig', + 'Date' => 'Datum', + 'Default' => 'Standard', + 'Delivery' => 'Die Zustellung', + 'Discount' => 'Rabatt', + 'DiscountBonus' => '', + 'DiscountP' => 'Rabatt %', + 'Documents' => 'Unterlagen', + 'Due' => 'Fällig', + 'Email' => 'Email', + 'Fax' => 'Fax', + 'Files' => 'Dateien', + 'Freightage' => 'Fracht', + 'Group' => 'Gruppe', + 'ID' => 'ICH WÜRDE', + 'Info' => 'Die Info', + 'Invoice' => 'Rechnung', + 'Invoices' => 'Rechnungen', + 'IsDefault' => 'Ist default', + 'Items' => 'Artikel', + 'LastContact' => 'Letzter Kontakt', + 'LastOrder' => 'Letzte Bestellung', + 'Log' => 'Protokoll', + 'Logs' => 'Protokoll', + 'MRR' => 'Mrr.', + 'MTDSales' => 'MTD-Verkäufe.', + 'Map' => '', + 'Margin' => 'Rand', + 'Master' => 'Meister', + 'Messages' => 'Mitteilungen', + 'Modified' => 'Geändert', + 'Name' => 'Name', + 'Name1' => 'Name1', + 'Name2' => 'Name2', + 'Name3' => 'Name3', + 'Net' => 'Netz', + 'Notes' => 'Anmerkungen', + 'Number' => 'Nummer', + 'Office' => 'Sekretariat', + 'Payment' => 'Zahlung', + 'PaymentTerm' => 'Zahlungsbezeichnung', + 'Permission' => 'Erlaubnis', + 'Phone' => 'Telefon', + 'Postal' => 'Post', + 'Price' => 'Preis', + 'Prices' => 'Preise', + 'Productgroup' => 'Produktgruppe', + 'Profile' => 'Profil', + 'Profit' => 'Gewinn', + 'Purchase' => 'Kaufen', + 'Quantity' => 'Menge', + 'RecentInvoices' => 'Jüngste Rechnungen', + 'Sales' => 'Umsatz', + 'Segment' => 'Segment', + 'Segments' => 'Segmente', + 'Subtype' => 'Untertyp', + 'Supplier' => 'Anbieter', + 'Suppliers' => 'Lieferanten', + 'Support' => 'Unterstützung', + 'Tags' => 'Stichworte', + 'Title' => 'Titel', + 'TotalPrice' => '', + 'Type' => 'Typ', + 'UnitPrice' => '', + 'Website' => 'Webseite', + 'Wire' => 'Überweisung', + 'YTDSales' => 'Ytd Sales', + 'SLV' => 'SLV', + 'Bill' => 'Rechnung', + 'Account' => 'Konto', + 'EarningIndicator' => 'Verkaufssteuerkennzeichen', + 'CostIndicator' => 'Einkaufssteuerkennzeichen', + 'Zip' => 'Reißverschluss', + 'Status' => 'Status', + 'Bills' => 'Rechnungen', + 'Items' => 'Artikel', + 'ViewAccount' => 'Buchhaltung', + 'CreateBill' => 'Erstelle Rechnung', + ':status-1' => 'Aktiv', + ':status-2' => 'Inaktiv', + ':status-3' => 'Blockiert', + 'Pricing' => 'Pricing', + 'Start' => 'Start', + 'End' => 'End', + 'ItemSegment' => 'Artikelsegment', + 'ClientSegment' => 'Kundensegment', + 'ItemSection' => 'Artikelsparte', + 'ClientSection' => 'Kundensparte', + 'ItemSalesGroup' => 'Artikel Umsatzgruppe', + 'ClientGroup' => 'Kundengruppe', + 'ClientType' => 'Kundenart', + 'ItemType' => 'Artikeltyp', + 'Item' => 'Artikel', ]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 651b02b..59c014e 100755 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -13,96 +13,121 @@ declare(strict_types=1); return ['SupplierManagement' => [ - 'Accounting' => 'Accounting', - 'Address' => 'Address', - 'Addresses' => 'Addresses', - 'AreaManager' => 'Area Manager', - 'Articlegroup' => 'Articlegroup', - 'Articles' => 'Articles', - 'Attribute' => 'Attribute', - 'AttributeTypes' => 'Attribute Types', - 'Attributes' => '', - 'Balance' => 'Balance', - 'Bills' => '', - 'Bonus' => 'Bonus', - 'CLV' => 'CLV', - 'Calendar' => 'Calendar', - 'City' => 'City', - 'Client' => 'Client', - 'ClientID' => '', - 'Contact' => 'Contact', - 'Country' => 'Country', - 'Created' => 'Created', - 'CreatedAt' => 'Created at', - 'CreditRating' => 'Credit Rating', - 'Creditcard' => 'Creditcard', - 'DSO' => 'DSO', - 'DUE' => 'Due', - 'Date' => 'Date', - 'Default' => 'Default', - 'Delivery' => 'Delivery', - 'Discount' => 'Discount', - 'DiscountBonus' => '', - 'DiscountP' => 'Discount %', - 'Documents' => 'Documents', - 'Due' => 'Due', - 'Email' => 'Email', - 'Fax' => 'Fax', - 'Files' => 'Files', - 'Freightage' => 'Freightage', - 'Group' => 'Group', - 'ID' => 'ID', - 'Info' => 'Info', - 'Invoice' => 'Invoice', - 'Invoices' => 'Invoices', - 'IsDefault' => 'Is default', - 'Items' => '', - 'LastContact' => 'Last Contact', - 'LastOrder' => 'Last Order', - 'Log' => 'Log', - 'Logs' => 'Logs', - 'MRR' => 'MRR', - 'MTDSales' => 'MTD Sales', - 'Map' => '', - 'Margin' => 'Margin', - 'Master' => 'Master', - 'Messages' => 'Messages', - 'Modified' => 'Modified', - 'Name' => 'Name', - 'Name1' => 'Name1', - 'Name2' => 'Name2', - 'Name3' => 'Name3', - 'Net' => 'Net', - 'Notes' => 'Notes', - 'Number' => 'Number', - 'Office' => 'Office', - 'Payment' => 'Payment', - 'PaymentTerm' => 'Payment Term', - 'Permission' => 'Permission', - 'Phone' => 'Phone', - 'Postal' => 'Postal', - 'Price' => 'Price', - 'Prices' => 'Prices', - 'Productgroup' => 'Productgroup', - 'Profile' => 'Profile', - 'Profit' => '', - 'Purchase' => 'Purchase', - 'Quantity' => 'Quantity', - 'RecentInvoices' => 'Recent Invoices', - 'Sales' => 'Sales', - 'Segment' => 'Segment', - 'Segments' => 'Segments', - 'Subtype' => 'Subtype', - 'Supplier' => 'Supplier', - 'Suppliers' => 'Suppliers', - 'Support' => 'Support', - 'Tags' => 'Tags', - 'Title' => 'Title', - 'TotalPrice' => '', - 'Type' => 'Type', - 'UnitPrice' => '', - 'Website' => 'Website', - 'Wire' => 'Wire', - 'YTDSales' => 'YTD Sales', - 'Zip' => 'Zip', + 'Accounting' => 'Accounting', + 'Address' => 'Address', + 'Addresses' => 'Addresses', + 'AreaManager' => 'Area Manager', + 'Articlegroup' => 'Articlegroup', + 'Articles' => 'Articles', + 'Attribute' => 'Attribute', + 'AttributeTypes' => 'Attribute Types', + 'Attributes' => '', + 'Balance' => 'Balance', + 'Bills' => '', + 'Bonus' => 'Bonus', + 'CLV' => 'CLV', + 'Calendar' => 'Calendar', + 'City' => 'City', + 'Client' => 'Client', + 'ClientID' => '', + 'Contact' => 'Contact', + 'Country' => 'Country', + 'Created' => 'Created', + 'CreatedAt' => 'Created at', + 'CreditRating' => 'Credit Rating', + 'Creditcard' => 'Creditcard', + 'DSO' => 'DSO', + 'DUE' => 'Due', + 'Date' => 'Date', + 'Default' => 'Default', + 'Delivery' => 'Delivery', + 'Discount' => 'Discount', + 'DiscountBonus' => '', + 'DiscountP' => 'Discount %', + 'Documents' => 'Documents', + 'Due' => 'Due', + 'Email' => 'Email', + 'Fax' => 'Fax', + 'Files' => 'Files', + 'Freightage' => 'Freightage', + 'Group' => 'Group', + 'ID' => 'ID', + 'Info' => 'Info', + 'Invoice' => 'Invoice', + 'Invoices' => 'Invoices', + 'IsDefault' => 'Is default', + 'LastContact' => 'Last Contact', + 'LastOrder' => 'Last Order', + 'Log' => 'Log', + 'Logs' => 'Logs', + 'MRR' => 'MRR', + 'MTDSales' => 'MTD Sales', + 'Map' => '', + 'Margin' => 'Margin', + 'Master' => 'Master', + 'Messages' => 'Messages', + 'Modified' => 'Modified', + 'Name' => 'Name', + 'Name1' => 'Name1', + 'Name2' => 'Name2', + 'Name3' => 'Name3', + 'Net' => 'Net', + 'Notes' => 'Notes', + 'Number' => 'Number', + 'Office' => 'Office', + 'Payment' => 'Payment', + 'PaymentTerm' => 'Payment Term', + 'Permission' => 'Permission', + 'Phone' => 'Phone', + 'Postal' => 'Postal', + 'Price' => 'Price', + 'Prices' => 'Prices', + 'Productgroup' => 'Productgroup', + 'Profile' => 'Profile', + 'Profit' => '', + 'Purchase' => 'Purchase', + 'Quantity' => 'Quantity', + 'RecentInvoices' => 'Recent Invoices', + 'Sales' => 'Sales', + 'Segment' => 'Segment', + 'Segments' => 'Segments', + 'Subtype' => 'Subtype', + 'Supplier' => 'Supplier', + 'Suppliers' => 'Suppliers', + 'Support' => 'Support', + 'Tags' => 'Tags', + 'Title' => 'Title', + 'TotalPrice' => '', + 'Type' => 'Type', + 'UnitPrice' => '', + 'Website' => 'Website', + 'Account' => 'Account', + 'EarningIndicator' => 'Sales tax code', + 'CostIndicator' => 'Purchase tax code', + 'Wire' => 'Wire', + 'YTDSales' => 'YTD Sales', + 'Zip' => 'Zip', + 'SLV' => 'SLV', + 'Bill' => 'Bill', + 'Status' => 'Status', + 'Bills' => 'Bills', + 'Items' => 'Items', + 'ViewAccount' => 'View Account', + 'CreateBill' => 'Create Bill', + ':status-1' => 'Active', + ':status-2' => 'Inactive', + ':status-3' => 'Banned', + 'Pricing' => 'Pricing', + 'Start' => 'Start', + 'End' => 'End', + 'ItemSegment' => 'Item Segment', + 'ClientSegment' => 'Client Segment', + 'ItemSection' => 'Item Section', + 'ClientSection' => 'Client Section', + 'ItemSalesGroup' => 'Item Sales Group', + 'ClientGroup' => 'Client Group', + 'ClientType' => 'Client Type', + 'ItemProductGroup' => 'Item Product Group', + 'ItemType' => 'Item Type', + 'Item' => 'Item', ]]; diff --git a/Theme/Backend/supplier-create.tpl.php b/Theme/Backend/supplier-create.tpl.php deleted file mode 100755 index 0121c70..0000000 --- a/Theme/Backend/supplier-create.tpl.php +++ /dev/null @@ -1,194 +0,0 @@ -data['nav']->render(); ?> - -
-
- -
-
- request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>> -
-
-

getHtml('Supplier'); ?>

-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>> -
-
-

getHtml('Contact'); ?>

-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
- request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>> -
-
-

getHtml('Address'); ?>

-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>> -
-
-

getHtml('PaymentTerm'); ?>

-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- request->uri->fragment === 'c-tab-5' ? ' checked' : ''; ?>> -
-
-

getHtml('Payment'); ?>

-
-
- -
-
-
-
-
-
-
-
- request->uri->fragment === 'c-tab-6' ? ' checked' : ''; ?>> -
-
- request->uri->fragment === 'c-tab-7' ? ' checked' : ''; ?>> -
- l11nManager, $this->request, $this->response); - $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); - $footerView->setPages(20); - $footerView->setPage(1); - ?> -
- - - - - - - - -
getHtml('Logs'); ?>download
IP - getHtml('ID', '0', '0'); ?> - getHtml('Name'); ?> - getHtml('Log'); ?> - getHtml('Date'); ?> -
-
printHtml($this->request->getOrigin()); ?> - printHtml($this->request->header->account); ?> - printHtml($this->request->header->account); ?> - Creating suppier - printHtml((new \DateTime('now'))->format('Y-m-d H:i:s')); ?> -
-
-
-
-
diff --git a/Theme/Backend/supplier-profile-bills.tpl.php b/Theme/Backend/supplier-profile-bills.tpl.php index 2864c7c..da1e412 100644 --- a/Theme/Backend/supplier-profile-bills.tpl.php +++ b/Theme/Backend/supplier-profile-bills.tpl.php @@ -166,7 +166,7 @@ $bills = $this->data['newestInvoices'] ?? []; /** @var \Modules\Billing\Models\Bill $value */ foreach ($bills as $key => $value) : ++$count; - $url = UriFactory::build('{/base}/purchase/bill?{?}&id=' . $value->id); + $url = UriFactory::build('{/base}/purchase/bill/view?{?}&id=' . $value->id); ?>