<?php
 namespace App\QuickReports\PivotTables\Data; class SupplierInvoiceRows extends GeneralAbstract { protected $allAvailableColumns = [ 'invoiceDate', 'invoiceDateY', 'invoiceDateM', 'invoiceDateYM', 'dueDate', 'dueDays', 'dueDateY', 'dueDateM', 'dueDateYM', 'statusOp', 'rowType', 'rowValOrg', 'rowVatOrg', 'rowTtlOrg', 'currency', 'rowValDef', 'rowVatDef', 'rowTtlDef', 'rowValWrk', 'rowVatWrk', 'rowTtlWrk', 'rowVatPercent', 'rowVatText', 'idSupplier', 'supplierCountryCode', 'serviceCode', 'invoiceIdUser', 'invoiceIdOffice', 'payedStatus', 'payedOrg', 'payedDef', 'payedWrk', 'duePayOrg', 'duePayDef', 'duePayWrk', 'payDate', 'payDays', ]; protected function getDbTable() { global $DBTPivotTablesData_supplierInvoiceRows; return $DBTPivotTablesData_supplierInvoiceRows; } public function getColumnDisplayValue($column, $value) { switch ($column) { case 'invoiceDate': case 'dueDate': case 'payDate': { return \Engine\DateTime::isoToStd($value); } case 'invoiceDateM': case 'dueDateM': { $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); return $_LANG['date']['month']['short'][$value]; } case 'invoiceDateYM': case 'dueDateYM': { $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); $y = floor($value/100); $m = $value % 100; return $_LANG['date']['month']['short'][$m].' '.$y; } case 'statusOp': { $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); return $_LANG['supplierInvoices']['statusOp'][$value]; } case 'idSupplier': { return \Entity\Supplier::select($value)->alias; } case 'supplierCountryCode': { return \Entity\Country::select($value)->name; } case 'invoiceIdUser': { return \Entity\User::select($value)->name; } case 'invoiceIdOffice': { return \Entity\Office::select($value)->name; } case 'rowType': { $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); return $_LANG['rowType'][$value]; } case 'payedStatus': { $_LANG = \App\Loader_Lang::getInstance()->getGlobal(); return $_LANG['supplierInvoices']['statusFin'][$value]; } case 'serviceCode': { return \App\Config\Services_Basic::getInstance()->getServiceName($value); } case 'rowVatPercent': { return $value.'%'; } default: { return parent::getColumnDisplayValue($column, $value); } } } } 