mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-01-11 15:18:42 +00:00
template fixes + bug fixes + style fixes
This commit is contained in:
parent
4ebb4bc285
commit
d194aade27
|
|
@ -41,6 +41,27 @@
|
||||||
"de" : "Zahlung fällig 90 Tage nach Rechnungsdatum"
|
"de" : "Zahlung fällig 90 Tage nach Rechnungsdatum"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "Net 120",
|
||||||
|
"l11n": {
|
||||||
|
"en" : "Payment is due 120 days after the invoice date",
|
||||||
|
"de" : "Zahlung fällig 120 Tage nach Rechnungsdatum"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Net 150",
|
||||||
|
"l11n": {
|
||||||
|
"en" : "Payment is due 150 days after the invoice date",
|
||||||
|
"de" : "Zahlung fällig 150 Tage nach Rechnungsdatum"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Net 180",
|
||||||
|
"l11n": {
|
||||||
|
"en" : "Payment is due 180 days after the invoice date",
|
||||||
|
"de" : "Zahlung fällig 180 Tage nach Rechnungsdatum"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "COD",
|
"name": "COD",
|
||||||
"l11n": {
|
"l11n": {
|
||||||
|
|
@ -104,6 +125,34 @@
|
||||||
"de" : "3% Skonto innerhalb von 15 Tagen nach Rechnungsdatum, andernfalls fällig zum vollen Betrag nach 30 Tagen nach Rechnungsdatum"
|
"de" : "3% Skonto innerhalb von 15 Tagen nach Rechnungsdatum, andernfalls fällig zum vollen Betrag nach 30 Tagen nach Rechnungsdatum"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "2/10 Net 60",
|
||||||
|
"l11n": {
|
||||||
|
"en" : "2% discount for payment within 10 days after invoice date; otherwise, the full amount is due in 60 days after invoice date",
|
||||||
|
"de" : "2% Skonto innerhalb von 10 Tagen nach Rechnungsdatum, andernfalls fällig zum vollen Betrag nach 60 Tagen nach Rechnungsdatum"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "3/10 Net 60",
|
||||||
|
"l11n": {
|
||||||
|
"en" : "3% discount for payment within 10 days after invoice date; otherwise, the full amount is due in 60 days after invoice date",
|
||||||
|
"de" : "3% Skonto innerhalb von 10 Tagen nach Rechnungsdatum, andernfalls fällig zum vollen Betrag nach 60 Tagen nach Rechnungsdatum"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "2/15 Net 60",
|
||||||
|
"l11n": {
|
||||||
|
"en" : "2% discount for payment within 15 days after invoice date; otherwise, the full amount is due in 60 days after invoice date",
|
||||||
|
"de" : "2% Skonto innerhalb von 15 Tagen nach Rechnungsdatum, andernfalls fällig zum vollen Betrag nach 60 Tagen nach Rechnungsdatum"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "3/15 Net 60",
|
||||||
|
"l11n": {
|
||||||
|
"en" : "3% discount for payment within 15 days after invoice date; otherwise, the full amount is due in 60 days after invoice date",
|
||||||
|
"de" : "3% Skonto innerhalb von 15 Tagen nach Rechnungsdatum, andernfalls fällig zum vollen Betrag nach 60 Tagen nach Rechnungsdatum"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "Escrow",
|
"name": "Escrow",
|
||||||
"l11n": {
|
"l11n": {
|
||||||
|
|
|
||||||
|
|
@ -66,4 +66,16 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
'^.*/purchase/recognition/upload(\?.*$|$)' => [
|
||||||
|
[
|
||||||
|
'dest' => '\Modules\Billing\Controller\ApiPurchaseController:apiPurchaseBillUpload',
|
||||||
|
'verb' => RouteVerb::SET,
|
||||||
|
'csrf' => true,
|
||||||
|
'permission' => [
|
||||||
|
'module' => BackendController::NAME,
|
||||||
|
'type' => PermissionType::CREATE,
|
||||||
|
'state' => PermissionCategory::PURCHASE_INVOICE,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ return [
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
'^/sales/bill(\?.*$|$)' => [
|
'^/sales/bill/view(\?.*$|$)' => [
|
||||||
[
|
[
|
||||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoice',
|
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoice',
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
|
|
@ -113,7 +113,7 @@ return [
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => BackendController::NAME,
|
'module' => BackendController::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::CREATE,
|
||||||
'state' => PermissionCategory::SALES_INVOICE,
|
'state' => PermissionCategory::SALES_INVOICE,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
@ -181,7 +181,7 @@ return [
|
||||||
'verb' => RouteVerb::GET,
|
'verb' => RouteVerb::GET,
|
||||||
'permission' => [
|
'permission' => [
|
||||||
'module' => BackendController::NAME,
|
'module' => BackendController::NAME,
|
||||||
'type' => PermissionType::READ,
|
'type' => PermissionType::CREATE,
|
||||||
'state' => PermissionCategory::PRIVATE_BILL_UPLOAD,
|
'state' => PermissionCategory::PRIVATE_BILL_UPLOAD,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -358,7 +358,7 @@ final class ApiTaxController extends Controller
|
||||||
->with('itemCode')
|
->with('itemCode')
|
||||||
->where('clientCode/valueStr', $combination['account_code'] ?? '')
|
->where('clientCode/valueStr', $combination['account_code'] ?? '')
|
||||||
->where('itemCode/valueStr', $combination['item_code'] ?? '')
|
->where('itemCode/valueStr', $combination['item_code'] ?? '')
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
if (\count($old) !== 1) {
|
if (\count($old) !== 1) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,9 @@ use Modules\Billing\Models\BillTypeMapper;
|
||||||
use Modules\Billing\Models\PaymentTermL11nMapper;
|
use Modules\Billing\Models\PaymentTermL11nMapper;
|
||||||
use Modules\Billing\Models\PaymentTermMapper;
|
use Modules\Billing\Models\PaymentTermMapper;
|
||||||
use Modules\Billing\Models\PermissionCategory;
|
use Modules\Billing\Models\PermissionCategory;
|
||||||
use Modules\Billing\Models\PurchaseBillMapper;
|
|
||||||
use Modules\Billing\Models\SalesBillMapper;
|
|
||||||
use Modules\Billing\Models\SettingsEnum;
|
use Modules\Billing\Models\SettingsEnum;
|
||||||
use Modules\Billing\Models\ShippingTermL11nMapper;
|
use Modules\Billing\Models\ShippingTermL11nMapper;
|
||||||
use Modules\Billing\Models\ShippingTermMapper;
|
use Modules\Billing\Models\ShippingTermMapper;
|
||||||
use Modules\Billing\Models\StockBillMapper;
|
|
||||||
use Modules\Billing\Models\Tax\TaxCombinationMapper;
|
use Modules\Billing\Models\Tax\TaxCombinationMapper;
|
||||||
use phpOMS\Account\PermissionType;
|
use phpOMS\Account\PermissionType;
|
||||||
use phpOMS\Contract\RenderableInterface;
|
use phpOMS\Contract\RenderableInterface;
|
||||||
|
|
@ -67,7 +64,7 @@ final class BackendController extends Controller
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
||||||
|
|
||||||
$mapperQuery = SalesBillMapper::getAll()
|
$mapperQuery = BillMapper::getAll()
|
||||||
->with('type')
|
->with('type')
|
||||||
->with('type/l11n')
|
->with('type/l11n')
|
||||||
->with('client')
|
->with('client')
|
||||||
|
|
@ -76,23 +73,19 @@ final class BackendController extends Controller
|
||||||
->where('type/l11n/language', $response->header->l11n->language)
|
->where('type/l11n/language', $response->header->l11n->language)
|
||||||
->sort('id', OrderType::DESC)
|
->sort('id', OrderType::DESC)
|
||||||
->where('unit', $this->app->unitId)
|
->where('unit', $this->app->unitId)
|
||||||
|
->where('client', null, '!=')
|
||||||
->limit(25);
|
->limit(25);
|
||||||
|
|
||||||
if ($request->getData('ptype') === 'p') {
|
if ($request->getData('ptype') === 'p') {
|
||||||
$view->data['bills'] = $mapperQuery
|
$mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '<');
|
||||||
->where('id', $request->getDataInt('id') ?? 0, '<')
|
|
||||||
->where('client', null, '!=')
|
|
||||||
->execute();
|
|
||||||
} elseif ($request->getData('ptype') === 'n') {
|
} elseif ($request->getData('ptype') === 'n') {
|
||||||
$view->data['bills'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
|
$mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '>');
|
||||||
->where('client', null, '!=')
|
|
||||||
->execute();
|
|
||||||
} else {
|
} else {
|
||||||
$view->data['bills'] = $mapperQuery->where('id', 0, '>')
|
$mapperQuery->where('id', 0, '>');
|
||||||
->where('client', null, '!=')
|
|
||||||
->execute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$view->data['bills'] = $mapperQuery->execute();
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,7 +107,7 @@ final class BackendController extends Controller
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
||||||
|
|
||||||
$mapperQuery = SalesBillMapper::getAll()
|
$view->data['bills'] = BillMapper::getAll()
|
||||||
->with('type')
|
->with('type')
|
||||||
->with('type/l11n')
|
->with('type/l11n')
|
||||||
->with('client')
|
->with('client')
|
||||||
|
|
@ -123,23 +116,89 @@ final class BackendController extends Controller
|
||||||
->where('type/l11n/language', $response->header->l11n->language)
|
->where('type/l11n/language', $response->header->l11n->language)
|
||||||
->sort('id', OrderType::DESC)
|
->sort('id', OrderType::DESC)
|
||||||
->where('unit', $this->app->unitId)
|
->where('unit', $this->app->unitId)
|
||||||
->limit(25);
|
->where('client', null, '!=')
|
||||||
|
->limit(25)
|
||||||
|
->paginate(
|
||||||
|
'id',
|
||||||
|
$request->getDataString('ptype') ?? '',
|
||||||
|
$request->getDataInt('offset')
|
||||||
|
)->executeGetArray();
|
||||||
|
|
||||||
if ($request->getData('ptype') === 'p') {
|
return $view;
|
||||||
$view->data['bills'] = $mapperQuery
|
|
||||||
->where('id', $request->getDataInt('id') ?? 0, '<')
|
|
||||||
->where('client', null, '!=')
|
|
||||||
->execute();
|
|
||||||
} elseif ($request->getData('ptype') === 'n') {
|
|
||||||
$view->data['bills'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
|
|
||||||
->where('client', null, '!=')
|
|
||||||
->execute();
|
|
||||||
} else {
|
|
||||||
$view->data['bills'] = $mapperQuery->where('id', 0, '>')
|
|
||||||
->where('client', null, '!=')
|
|
||||||
->execute();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Routing end-point for application behavior.
|
||||||
|
*
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
* @param ResponseAbstract $response Response
|
||||||
|
* @param array $data Generic data
|
||||||
|
*
|
||||||
|
* @return RenderableInterface
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
|
public function viewBillingStockArchive(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||||
|
{
|
||||||
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
|
$view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list');
|
||||||
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005106001, $request, $response);
|
||||||
|
|
||||||
|
$view->data['bills'] = BillMapper::getAll()
|
||||||
|
->with('type')
|
||||||
|
->with('type/l11n')
|
||||||
|
->with('client')
|
||||||
|
->where('status', BillStatus::DRAFT, '!=')
|
||||||
|
->where('type/transferType', BillTransferType::STOCK)
|
||||||
|
->where('type/l11n/language', $response->header->l11n->language)
|
||||||
|
->sort('id', OrderType::DESC)
|
||||||
|
->where('unit', $this->app->unitId)
|
||||||
|
->limit(25)
|
||||||
|
->paginate(
|
||||||
|
'id',
|
||||||
|
$request->getDataString('ptype') ?? '',
|
||||||
|
$request->getDataInt('offset')
|
||||||
|
)->executeGetArray();
|
||||||
|
|
||||||
|
return $view;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Routing end-point for application behavior.
|
||||||
|
*
|
||||||
|
* @param RequestAbstract $request Request
|
||||||
|
* @param ResponseAbstract $response Response
|
||||||
|
* @param array $data Generic data
|
||||||
|
*
|
||||||
|
* @return RenderableInterface
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
|
public function viewBillingPurchaseArchive(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||||
|
{
|
||||||
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
||||||
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
||||||
|
|
||||||
|
$view->data['bills'] = BillMapper::getAll()
|
||||||
|
->with('type')
|
||||||
|
->with('type/l11n')
|
||||||
|
->with('supplier')
|
||||||
|
->where('status', BillStatus::DRAFT, '!=')
|
||||||
|
->where('type/transferType', BillTransferType::PURCHASE)
|
||||||
|
->where('type/l11n/language', $response->header->l11n->language)
|
||||||
|
->sort('id', OrderType::DESC)
|
||||||
|
->where('unit', $this->app->unitId)
|
||||||
|
->where('supplier', null, '!=')
|
||||||
|
->limit(25)
|
||||||
|
->paginate(
|
||||||
|
'id',
|
||||||
|
$request->getDataString('ptype') ?? '',
|
||||||
|
$request->getDataInt('offset')
|
||||||
|
)->executeGetArray();
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -162,7 +221,7 @@ final class BackendController extends Controller
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
||||||
|
|
||||||
/** @var \Modules\Billing\Models\Bill $bill */
|
/** @var \Modules\Billing\Models\Bill $bill */
|
||||||
$bill = SalesBillMapper::get()
|
$bill = BillMapper::get()
|
||||||
->with('client')
|
->with('client')
|
||||||
->with('elements')
|
->with('elements')
|
||||||
->with('elements/container')
|
->with('elements/container')
|
||||||
|
|
@ -179,7 +238,7 @@ final class BackendController extends Controller
|
||||||
->where('isTemplate', false)
|
->where('isTemplate', false)
|
||||||
->where('transferType', BillTransferType::SALES)
|
->where('transferType', BillTransferType::SALES)
|
||||||
->where('l11n/language', $request->header->l11n->language)
|
->where('l11n/language', $request->header->l11n->language)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$view->data['billtypes'] = $billTypes;
|
$view->data['billtypes'] = $billTypes;
|
||||||
|
|
||||||
|
|
@ -198,7 +257,7 @@ final class BackendController extends Controller
|
||||||
->where('module', 'Billing')
|
->where('module', 'Billing')
|
||||||
->where('type', StringUtils::intHash(BillMapper::class))
|
->where('type', StringUtils::intHash(BillMapper::class))
|
||||||
->where('ref', $bill->id)
|
->where('ref', $bill->id)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
if (!empty($bill->elements)) {
|
if (!empty($bill->elements)) {
|
||||||
/** @var \Modules\Auditor\Models\Audit[] $logsElements */
|
/** @var \Modules\Auditor\Models\Audit[] $logsElements */
|
||||||
|
|
@ -207,7 +266,7 @@ final class BackendController extends Controller
|
||||||
->where('module', 'Billing')
|
->where('module', 'Billing')
|
||||||
->where('type', StringUtils::intHash(BillElementMapper::class))
|
->where('type', StringUtils::intHash(BillElementMapper::class))
|
||||||
->where('ref', \array_keys($bill->elements), 'IN')
|
->where('ref', \array_keys($bill->elements), 'IN')
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$logs = \array_merge($logs, $logsElements);
|
$logs = \array_merge($logs, $logsElements);
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +301,7 @@ final class BackendController extends Controller
|
||||||
->where('isTemplate', false)
|
->where('isTemplate', false)
|
||||||
->where('transferType', BillTransferType::SALES)
|
->where('transferType', BillTransferType::SALES)
|
||||||
->where('l11n/language', $request->header->l11n->language)
|
->where('l11n/language', $request->header->l11n->language)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$view->data['billtypes'] = $billTypes;
|
$view->data['billtypes'] = $billTypes;
|
||||||
|
|
||||||
|
|
@ -267,7 +326,9 @@ final class BackendController extends Controller
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/bill-create');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/bill-create');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
||||||
|
|
||||||
|
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -288,7 +349,9 @@ final class BackendController extends Controller
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/bill-create');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/bill-create');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005106001, $request, $response);
|
||||||
|
|
||||||
|
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -311,32 +374,21 @@ final class BackendController extends Controller
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
||||||
|
|
||||||
$mapperQuery = PurchaseBillMapper::getAll()
|
$view->data['bills'] = BillMapper::getAll()
|
||||||
->with('type')
|
->with('type')
|
||||||
->with('type/l11n')
|
->with('type/l11n')
|
||||||
->with('supplier')
|
->with('supplier')
|
||||||
->where('type/transferType', BillTransferType::PURCHASE)
|
->where('type/transferType', BillTransferType::PURCHASE)
|
||||||
->sort('id', OrderType::DESC)
|
->sort('id', OrderType::DESC)
|
||||||
->where('unit', $this->app->unitId)
|
->where('unit', $this->app->unitId)
|
||||||
->limit(25);
|
|
||||||
|
|
||||||
if ($request->getData('ptype') === 'p') {
|
|
||||||
$view->data['bills'] = $mapperQuery
|
|
||||||
->where('id', $request->getDataInt('id') ?? 0, '<')
|
|
||||||
->where('supplier', null, '!=')
|
->where('supplier', null, '!=')
|
||||||
->where('type/l11n/language', $response->header->l11n->language)
|
->where('type/l11n/language', $response->header->l11n->language)
|
||||||
->execute();
|
->limit(25)
|
||||||
} elseif ($request->getData('ptype') === 'n') {
|
->paginate(
|
||||||
$view->data['bills'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
|
'id',
|
||||||
->where('supplier', null, '!=')
|
$request->getDataString('ptype') ?? '',
|
||||||
->where('type/l11n/language', $response->header->l11n->language)
|
$request->getDataInt('offset')
|
||||||
->execute();
|
)->executeGetArray();
|
||||||
} else {
|
|
||||||
$view->data['bills'] = $mapperQuery->where('id', 0, '>')
|
|
||||||
->where('supplier', null, '!=')
|
|
||||||
->where('type/l11n/language', $response->header->l11n->language)
|
|
||||||
->execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -359,7 +411,7 @@ final class BackendController extends Controller
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
||||||
|
|
||||||
$view->data['bill'] = PurchaseBillMapper::get()
|
$view->data['bill'] = BillMapper::get()
|
||||||
->with('supplier')
|
->with('supplier')
|
||||||
->with('elements')
|
->with('elements')
|
||||||
->with('elements/container')
|
->with('elements/container')
|
||||||
|
|
@ -374,7 +426,7 @@ final class BackendController extends Controller
|
||||||
->where('isTemplate', false)
|
->where('isTemplate', false)
|
||||||
->where('transferType', BillTransferType::PURCHASE)
|
->where('transferType', BillTransferType::PURCHASE)
|
||||||
->where('l11n/language', $request->header->l11n->language)
|
->where('l11n/language', $request->header->l11n->language)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$logs = [];
|
$logs = [];
|
||||||
if ($this->app->accountManager->get($request->header->account)->hasPermission(
|
if ($this->app->accountManager->get($request->header->account)->hasPermission(
|
||||||
|
|
@ -391,7 +443,7 @@ final class BackendController extends Controller
|
||||||
->where('module', 'Billing')
|
->where('module', 'Billing')
|
||||||
->where('type', StringUtils::intHash(BillMapper::class))
|
->where('type', StringUtils::intHash(BillMapper::class))
|
||||||
->where('ref', $view->data['bill']->id)
|
->where('ref', $view->data['bill']->id)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
if (!empty($view->data['bill']->elements)) {
|
if (!empty($view->data['bill']->elements)) {
|
||||||
/** @var \Modules\Auditor\Models\Audit[] $logsElements */
|
/** @var \Modules\Auditor\Models\Audit[] $logsElements */
|
||||||
|
|
@ -400,7 +452,7 @@ final class BackendController extends Controller
|
||||||
->where('module', 'Billing')
|
->where('module', 'Billing')
|
||||||
->where('type', StringUtils::intHash(BillElementMapper::class))
|
->where('type', StringUtils::intHash(BillElementMapper::class))
|
||||||
->where('ref', \array_keys($view->data['bill']->elements), 'IN')
|
->where('ref', \array_keys($view->data['bill']->elements), 'IN')
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$logs = \array_merge($logs, $logsElements);
|
$logs = \array_merge($logs, $logsElements);
|
||||||
}
|
}
|
||||||
|
|
@ -428,14 +480,14 @@ final class BackendController extends Controller
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005106001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
||||||
|
|
||||||
if ($request->getData('ptype') === 'p') {
|
if ($request->getData('ptype') === 'p') {
|
||||||
$view->data['bills'] = StockBillMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '<')->where('unit', $this->app->unitId)->limit(25)->execute();
|
$view->data['bills'] = BillMapper::getAll()->where('id', $request->getDataInt('offset') ?? 0, '<')->where('unit', $this->app->unitId)->limit(25)->executeGetArray();
|
||||||
} elseif ($request->getData('ptype') === 'n') {
|
} elseif ($request->getData('ptype') === 'n') {
|
||||||
$view->data['bills'] = StockBillMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->where('unit', $this->app->unitId)->limit(25)->execute();
|
$view->data['bills'] = BillMapper::getAll()->where('id', $request->getDataInt('offset') ?? 0, '>')->where('unit', $this->app->unitId)->limit(25)->executeGetArray();
|
||||||
} else {
|
} else {
|
||||||
$view->data['bills'] = StockBillMapper::getAll()->where('id', 0, '>')->where('unit', $this->app->unitId)->limit(25)->execute();
|
$view->data['bills'] = BillMapper::getAll()->where('id', 0, '>')->where('unit', $this->app->unitId)->limit(25)->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
|
|
@ -459,7 +511,7 @@ final class BackendController extends Controller
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005106001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005106001, $request, $response);
|
||||||
|
|
||||||
$bill = StockBillMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
$bill = BillMapper::get()->where('id', (int) $request->getData('id'))->execute();
|
||||||
|
|
||||||
$view->data['bill'] = $bill;
|
$view->data['bill'] = $bill;
|
||||||
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
$view->data['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||||
|
|
@ -483,7 +535,7 @@ final class BackendController extends Controller
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-upload');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-upload');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002901101, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -503,7 +555,7 @@ final class BackendController extends Controller
|
||||||
public function viewPrivatePurchaseBillUpload(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
public function viewPrivatePurchaseBillUpload(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/user-purchase-bill-upload');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-upload');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005109001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005109001, $request, $response);
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
|
|
@ -527,7 +579,7 @@ final class BackendController extends Controller
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005109001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005109001, $request, $response);
|
||||||
|
|
||||||
$mapperQuery = PurchaseBillMapper::getAll()
|
$view->data['bills'] = BillMapper::getAll()
|
||||||
->with('type')
|
->with('type')
|
||||||
->with('type/l11n')
|
->with('type/l11n')
|
||||||
->with('supplier')
|
->with('supplier')
|
||||||
|
|
@ -535,22 +587,13 @@ final class BackendController extends Controller
|
||||||
->where('status', BillStatus::UNPARSED)
|
->where('status', BillStatus::UNPARSED)
|
||||||
->sort('id', OrderType::DESC)
|
->sort('id', OrderType::DESC)
|
||||||
->where('unit', $this->app->unitId)
|
->where('unit', $this->app->unitId)
|
||||||
->limit(25);
|
|
||||||
|
|
||||||
if ($request->getData('ptype') === 'p') {
|
|
||||||
$view->data['bills'] = $mapperQuery
|
|
||||||
->where('id', $request->getDataInt('id') ?? 0, '<')
|
|
||||||
->where('type/l11n/language', $response->header->l11n->language)
|
->where('type/l11n/language', $response->header->l11n->language)
|
||||||
->execute();
|
->limit(25)
|
||||||
} elseif ($request->getData('ptype') === 'n') {
|
->paginate(
|
||||||
$view->data['bills'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
|
'id',
|
||||||
->where('type/l11n/language', $response->header->l11n->language)
|
$request->getDataString('ptype') ?? '',
|
||||||
->execute();
|
$request->getDataInt('offset')
|
||||||
} else {
|
)->executeGetArray();
|
||||||
$view->data['bills'] = $mapperQuery->where('id', 0, '>')
|
|
||||||
->where('type/l11n/language', $response->header->l11n->language)
|
|
||||||
->execute();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -573,7 +616,7 @@ final class BackendController extends Controller
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005109001, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005109001, $request, $response);
|
||||||
|
|
||||||
$bill = PurchaseBillMapper::get()
|
$bill = BillMapper::get()
|
||||||
->with('elements')
|
->with('elements')
|
||||||
->with('files')
|
->with('files')
|
||||||
->with('files/types')
|
->with('files/types')
|
||||||
|
|
@ -619,12 +662,12 @@ final class BackendController extends Controller
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/payment-type-list');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/payment-type-list');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002901101, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
||||||
|
|
||||||
$view->data['types'] = PaymentTermMapper::getAll()
|
$view->data['types'] = PaymentTermMapper::getAll()
|
||||||
->with('l11n')
|
->with('l11n')
|
||||||
->where('l11n/language', $response->header->l11n->language)
|
->where('l11n/language', $response->header->l11n->language)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -658,7 +701,7 @@ final class BackendController extends Controller
|
||||||
/** @var \phpOMS\Localization\BaseStringL11n[] $l11nValues */
|
/** @var \phpOMS\Localization\BaseStringL11n[] $l11nValues */
|
||||||
$l11nValues = PaymentTermL11nMapper::getAll()
|
$l11nValues = PaymentTermL11nMapper::getAll()
|
||||||
->where('ref', $view->data['type']->id)
|
->where('ref', $view->data['type']->id)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$view->data['l11nValues'] = $l11nValues;
|
$view->data['l11nValues'] = $l11nValues;
|
||||||
|
|
||||||
|
|
@ -681,12 +724,12 @@ final class BackendController extends Controller
|
||||||
{
|
{
|
||||||
$view = new View($this->app->l11nManager, $request, $response);
|
$view = new View($this->app->l11nManager, $request, $response);
|
||||||
$view->setTemplate('/Modules/Billing/Theme/Backend/shipping-type-list');
|
$view->setTemplate('/Modules/Billing/Theme/Backend/shipping-type-list');
|
||||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002901101, $request, $response);
|
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
||||||
|
|
||||||
$view->data['types'] = ShippingTermMapper::getAll()
|
$view->data['types'] = ShippingTermMapper::getAll()
|
||||||
->with('l11n')
|
->with('l11n')
|
||||||
->where('l11n/language', $response->header->l11n->language)
|
->where('l11n/language', $response->header->l11n->language)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
return $view;
|
return $view;
|
||||||
}
|
}
|
||||||
|
|
@ -720,7 +763,7 @@ final class BackendController extends Controller
|
||||||
/** @var \phpOMS\Localization\BaseStringL11n[] $l11nValues */
|
/** @var \phpOMS\Localization\BaseStringL11n[] $l11nValues */
|
||||||
$l11nValues = ShippingTermL11nMapper::getAll()
|
$l11nValues = ShippingTermL11nMapper::getAll()
|
||||||
->where('ref', $view->data['type']->id)
|
->where('ref', $view->data['type']->id)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$view->data['l11nValues'] = $l11nValues;
|
$view->data['l11nValues'] = $l11nValues;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ final class CliController extends Controller
|
||||||
->with('mainAddress')
|
->with('mainAddress')
|
||||||
->with('attributes/type')
|
->with('attributes/type')
|
||||||
->where('attributes/type/name', ['bill_match_pattern', 'bill_date_format'], 'IN')
|
->where('attributes/type/name', ['bill_match_pattern', 'bill_date_format'], 'IN')
|
||||||
->execute();
|
->executeGetArray();
|
||||||
|
|
||||||
$supplierId = $this->matchSupplier($content, $suppliers);
|
$supplierId = $this->matchSupplier($content, $suppliers);
|
||||||
$bill->supplier = new NullSupplier($supplierId);
|
$bill->supplier = new NullSupplier($supplierId);
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ class BillMapper extends DataMapperFactory
|
||||||
'referral' => [
|
'referral' => [
|
||||||
'mapper' => AccountMapper::class,
|
'mapper' => AccountMapper::class,
|
||||||
'external' => 'billing_bill_referral',
|
'external' => 'billing_bill_referral',
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ final class PurchaseBillMapper extends BillMapper
|
||||||
->where('id', $pivot, '<')
|
->where('id', $pivot, '<')
|
||||||
->where('transferType', BillTransferType::PURCHASE)
|
->where('transferType', BillTransferType::PURCHASE)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -72,7 +72,7 @@ final class PurchaseBillMapper extends BillMapper
|
||||||
->where('id', $pivot, '>')
|
->where('id', $pivot, '>')
|
||||||
->where('transferType', BillTransferType::PURCHASE)
|
->where('transferType', BillTransferType::PURCHASE)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -253,7 +253,7 @@ final class PurchaseBillMapper extends BillMapper
|
||||||
->groupBy(SupplierMapper::TABLE . '_d1.suppliermgmt_supplier_id');
|
->groupBy(SupplierMapper::TABLE . '_d1.suppliermgmt_supplier_id');
|
||||||
|
|
||||||
$suppliers = SupplierMapper::getAll()->execute($query);
|
$suppliers = SupplierMapper::getAll()->execute($query);
|
||||||
$data = SupplierMapper::getRaw()->execute();
|
$data = SupplierMapper::getRaw()->executeGetArray();
|
||||||
|
|
||||||
return [$suppliers, $data];
|
return [$suppliers, $data];
|
||||||
}
|
}
|
||||||
|
|
@ -326,4 +326,161 @@ final class PurchaseBillMapper extends BillMapper
|
||||||
|
|
||||||
return $result ?? [];
|
return $result ?? [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Placeholder
|
||||||
|
* @todo Implement
|
||||||
|
*/
|
||||||
|
public static function getSupplierNetSales(int $supplier, \DateTime $start, \DateTime $end) : FloatInt
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT SUM(billing_bill_netsales * billing_type_transfer_sign) as net_sales
|
||||||
|
FROM billing_bill
|
||||||
|
LEFT JOIN billing_type
|
||||||
|
ON billing_bill_type = billing_type_id
|
||||||
|
WHERE
|
||||||
|
billing_bill_supplier = {$supplier}
|
||||||
|
AND billing_bill_performance_date >= '{$start->format('Y-m-d H:i:s')}'
|
||||||
|
AND billing_bill_performance_date <= '{$end->format('Y-m-d H:i:s')}';
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
$query = new Builder(self::$db);
|
||||||
|
$result = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
||||||
|
return new FloatInt(-((int) ($result[0]['net_sales'] ?? 0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Placeholder
|
||||||
|
* @todo Implement
|
||||||
|
*/
|
||||||
|
public static function getSupplierLastOrder(int $supplier) : ?\DateTime
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT billing_bill_created_at
|
||||||
|
FROM billing_bill
|
||||||
|
WHERE billing_bill_supplier = {$supplier}
|
||||||
|
ORDER BY billing_bill_created_at DESC
|
||||||
|
LIMIT 1;
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
$query = new Builder(self::$db);
|
||||||
|
$result = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
||||||
|
return isset($result[0]['billing_bill_created_at'])
|
||||||
|
? new \DateTime(($result[0]['billing_bill_created_at']))
|
||||||
|
: null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Placeholder
|
||||||
|
* @todo Implement
|
||||||
|
*/
|
||||||
|
public static function getSLVHistoric(int $supplier) : FloatInt
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT SUM(billing_bill_netsales * billing_type_transfer_sign) as net_sales
|
||||||
|
FROM billing_bill
|
||||||
|
LEFT JOIN billing_type
|
||||||
|
ON billing_bill_type = billing_type_id
|
||||||
|
WHERE billing_bill_supplier = {$supplier};
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
$query = new Builder(self::$db);
|
||||||
|
$result = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
||||||
|
return new FloatInt(-((int) ($result[0]['net_sales'] ?? 0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Placeholder
|
||||||
|
* @todo Implement
|
||||||
|
*/
|
||||||
|
public static function getSupplierMonthlySalesCosts(int $supplier, \DateTime $start, \DateTime $end) : array
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT
|
||||||
|
SUM(billing_bill_netsales * billing_type_transfer_sign * -1) as net_sales,
|
||||||
|
SUM(billing_bill_netcosts * billing_type_transfer_sign * -1) as net_costs,
|
||||||
|
YEAR(billing_bill_performance_date) as year,
|
||||||
|
MONTH(billing_bill_performance_date) as month
|
||||||
|
FROM billing_bill
|
||||||
|
LEFT JOIN billing_type ON billing_bill_type = billing_type_id
|
||||||
|
WHERE
|
||||||
|
billing_bill_supplier = {$supplier}
|
||||||
|
AND billing_type_accounting = 1
|
||||||
|
AND billing_bill_performance_date >= '{$start->format('Y-m-d H:i:s')}'
|
||||||
|
AND billing_bill_performance_date <= '{$end->format('Y-m-d H:i:s')}'
|
||||||
|
GROUP BY year, month
|
||||||
|
ORDER BY year ASC, month ASC;
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
$query = new Builder(self::$db);
|
||||||
|
$result = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
||||||
|
return $result ?? [];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Placeholder
|
||||||
|
* @todo Implement
|
||||||
|
*/
|
||||||
|
public static function getSupplierAttributeNetSales(
|
||||||
|
int $supplier,
|
||||||
|
string $attribute,
|
||||||
|
string $language,
|
||||||
|
\DateTime $start,
|
||||||
|
\DateTime $end
|
||||||
|
) : array
|
||||||
|
{
|
||||||
|
$sql = <<<SQL
|
||||||
|
SELECT
|
||||||
|
itemmgmt_attr_value_l11n_title as title,
|
||||||
|
SUM(billing_bill_element_total_netlistprice * billing_type_transfer_sign * -1) as net_sales
|
||||||
|
FROM billing_bill
|
||||||
|
LEFT JOIN billing_type
|
||||||
|
ON billing_bill_type = billing_type_id
|
||||||
|
LEFT JOIN billing_bill_element
|
||||||
|
ON billing_bill_id = billing_bill_element_bill
|
||||||
|
LEFT JOIN itemmgmt_item
|
||||||
|
ON itemmgmt_item_id = billing_bill_element_item
|
||||||
|
LEFT JOIN itemmgmt_item_attr
|
||||||
|
ON itemmgmt_item_id = itemmgmt_item_attr_item
|
||||||
|
LEFT JOIN itemmgmt_attr_type
|
||||||
|
ON itemmgmt_item_attr_type = itemmgmt_attr_type_id
|
||||||
|
LEFT JOIN itemmgmt_attr_type_l11n
|
||||||
|
ON itemmgmt_attr_type_id = itemmgmt_attr_type_l11n_type AND itemmgmt_attr_type_l11n_lang = '{$language}'
|
||||||
|
LEFT JOIN itemmgmt_attr_value
|
||||||
|
ON itemmgmt_item_attr_value = itemmgmt_attr_value_id
|
||||||
|
LEFT JOIN itemmgmt_attr_value_l11n
|
||||||
|
ON itemmgmt_attr_value_id = itemmgmt_attr_value_l11n_value AND itemmgmt_attr_value_l11n_lang = '{$language}'
|
||||||
|
WHERE
|
||||||
|
billing_bill_supplier = {$supplier}
|
||||||
|
AND billing_type_accounting = 1
|
||||||
|
AND billing_bill_performance_date >= '{$start->format('Y-m-d H:i:s')}'
|
||||||
|
AND billing_bill_performance_date <= '{$end->format('Y-m-d H:i:s')}'
|
||||||
|
AND itemmgmt_attr_type_name = '{$attribute}'
|
||||||
|
GROUP BY
|
||||||
|
itemmgmt_attr_value_l11n_title;
|
||||||
|
SQL;
|
||||||
|
|
||||||
|
$query = new Builder(self::$db);
|
||||||
|
$result = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Placeholder
|
||||||
|
* @todo Implement
|
||||||
|
*/
|
||||||
|
public static function getSupplierItem(int $supplier, \DateTime $start, \DateTime $end) : array
|
||||||
|
{
|
||||||
|
return BillElementMapper::getAll()
|
||||||
|
->with('bill')
|
||||||
|
->with('bill/type')
|
||||||
|
->where('bill/supplier', $supplier)
|
||||||
|
->where('bill/type/transferStock', true)
|
||||||
|
->executeGetArray();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ final class SalesBillMapper extends BillMapper
|
||||||
->where('id', $pivot, '<')
|
->where('id', $pivot, '<')
|
||||||
->where('type/transferType', BillTransferType::SALES)
|
->where('type/transferType', BillTransferType::SALES)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -74,7 +74,7 @@ final class SalesBillMapper extends BillMapper
|
||||||
->where('id', $pivot, '>')
|
->where('id', $pivot, '>')
|
||||||
->where('type/transferType', BillTransferType::SALES)
|
->where('type/transferType', BillTransferType::SALES)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -287,7 +287,7 @@ final class SalesBillMapper extends BillMapper
|
||||||
->with('account')
|
->with('account')
|
||||||
->with('mainAddress')
|
->with('mainAddress')
|
||||||
->where('id', $clientIds, 'IN')
|
->where('id', $clientIds, 'IN')
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
return [$clients, $data];
|
return [$clients, $data];
|
||||||
|
|
@ -334,7 +334,7 @@ final class SalesBillMapper extends BillMapper
|
||||||
->where('type/l11n/language', $language)
|
->where('type/l11n/language', $language)
|
||||||
->where('billDate', $start, '>=')
|
->where('billDate', $start, '>=')
|
||||||
->where('billDate', $end, '<=')
|
->where('billDate', $end, '<=')
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -348,7 +348,7 @@ final class SalesBillMapper extends BillMapper
|
||||||
->with('bill/type')
|
->with('bill/type')
|
||||||
->where('bill/client', $client)
|
->where('bill/client', $client)
|
||||||
->where('bill/type/transferStock', true)
|
->where('bill/type/transferStock', true)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -637,8 +637,10 @@ final class SalesBillMapper extends BillMapper
|
||||||
public static function getClientNetSales(int $client, \DateTime $start, \DateTime $end) : FloatInt
|
public static function getClientNetSales(int $client, \DateTime $start, \DateTime $end) : FloatInt
|
||||||
{
|
{
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
SELECT SUM(billing_bill_netsales) as net_sales
|
SELECT SUM(billing_bill_netsales * billing_type_transfer_sign) as net_sales
|
||||||
FROM billing_bill
|
FROM billing_bill
|
||||||
|
LEFT JOIN billing_type
|
||||||
|
ON billing_bill_type = billing_type_id
|
||||||
WHERE
|
WHERE
|
||||||
billing_bill_client = {$client}
|
billing_bill_client = {$client}
|
||||||
AND billing_bill_performance_date >= '{$start->format('Y-m-d H:i:s')}'
|
AND billing_bill_performance_date >= '{$start->format('Y-m-d H:i:s')}'
|
||||||
|
|
@ -658,8 +660,10 @@ final class SalesBillMapper extends BillMapper
|
||||||
public static function getCLVHistoric(int $client) : FloatInt
|
public static function getCLVHistoric(int $client) : FloatInt
|
||||||
{
|
{
|
||||||
$sql = <<<SQL
|
$sql = <<<SQL
|
||||||
SELECT SUM(billing_bill_netsales) as net_sales
|
SELECT SUM(billing_bill_netsales * billing_type_transfer_sign) as net_sales
|
||||||
FROM billing_bill
|
FROM billing_bill
|
||||||
|
LEFT JOIN billing_type
|
||||||
|
ON billing_bill_type = billing_type_id
|
||||||
WHERE billing_bill_client = {$client};
|
WHERE billing_bill_client = {$client};
|
||||||
SQL;
|
SQL;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,5 +39,6 @@ abstract class SettingsEnum extends Enum
|
||||||
public const BILLING_SUPPLIER_EMAIL_TEMPLATE = '1005100005'; // Email template for supplier billing
|
public const BILLING_SUPPLIER_EMAIL_TEMPLATE = '1005100005'; // Email template for supplier billing
|
||||||
|
|
||||||
public const BILLING_DOCUMENT_SPACER_COLOR = '1005100101';
|
public const BILLING_DOCUMENT_SPACER_COLOR = '1005100101';
|
||||||
|
|
||||||
public const BILLING_DOCUMENT_SPACER_TOLERANCE = '1005100102';
|
public const BILLING_DOCUMENT_SPACER_TOLERANCE = '1005100102';
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ final class StockBillMapper extends BillMapper
|
||||||
->where('id', $pivot, '<')
|
->where('id', $pivot, '<')
|
||||||
->where('transferType', BillTransferType::SALES)
|
->where('transferType', BillTransferType::SALES)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -69,6 +69,6 @@ final class StockBillMapper extends BillMapper
|
||||||
->where('id', $pivot, '>')
|
->where('id', $pivot, '>')
|
||||||
->where('transferType', BillTransferType::SALES)
|
->where('transferType', BillTransferType::SALES)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->execute();
|
->executeGetArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,9 @@ return ['Billing' => [
|
||||||
'ShippingTerms' => 'Lieferbedingungen',
|
'ShippingTerms' => 'Lieferbedingungen',
|
||||||
'PaymentTerm' => 'Zahlungsbedingung',
|
'PaymentTerm' => 'Zahlungsbedingung',
|
||||||
'ShippingTerm' => 'Lieferbedingung',
|
'ShippingTerm' => 'Lieferbedingung',
|
||||||
|
'RecognitionUpload1' => 'Einzelne Rechnung',
|
||||||
|
'RecognitionUpload2' => 'Mehrere Rechnungen in getrennten Dateien',
|
||||||
|
'RecognitionUpload3' => 'Mehrere Rechnungen in einer Datei ABER getrennt mit einer farbigen Zwischenseite',
|
||||||
'E_bill_items' => 'Es gibt ein Problem mit Ihren Artikeln.',
|
'E_bill_items' => 'Es gibt ein Problem mit Ihren Artikeln.',
|
||||||
'E_bill_taxes' => 'Der Gesamtsteuerbetrag stimmt nicht mit dem Steuerbetrag der Elemente überein. Möglicherweise gibt es ein Problem mit den Steuersätzen oder zusätzlichen Posten.',
|
'E_bill_taxes' => 'Der Gesamtsteuerbetrag stimmt nicht mit dem Steuerbetrag der Elemente überein. Möglicherweise gibt es ein Problem mit den Steuersätzen oder zusätzlichen Posten.',
|
||||||
'E_bill_net' => 'Der Gesamtnettobetrag stimmt nicht mit dem Nettobetrag der Elemente überein. Mögliches Problem mit Steuersätzen oder zusätzlichen Positionen.',
|
'E_bill_net' => 'Der Gesamtnettobetrag stimmt nicht mit dem Nettobetrag der Elemente überein. Mögliches Problem mit Steuersätzen oder zusätzlichen Positionen.',
|
||||||
|
|
|
||||||
|
|
@ -88,6 +88,9 @@ return ['Billing' => [
|
||||||
'ShippingTerms' => 'Shipping Terms',
|
'ShippingTerms' => 'Shipping Terms',
|
||||||
'PaymentTerm' => 'Payment Term',
|
'PaymentTerm' => 'Payment Term',
|
||||||
'ShippingTerm' => 'Shipping Term',
|
'ShippingTerm' => 'Shipping Term',
|
||||||
|
'RecognitionUpload1' => 'Individual file upload',
|
||||||
|
'RecognitionUpload2' => 'Multiple invoices in separate files',
|
||||||
|
'RecognitionUpload3' => 'Multiple invoices in one file BUT separated with a colored spacer paper',
|
||||||
'E_bill_items' => 'There is an issue with your bill items.',
|
'E_bill_items' => 'There is an issue with your bill items.',
|
||||||
'E_bill_taxes' => 'The total tax amount doesn\'t match the tax amount of the elements. Potential issue with tax rates or additional items.',
|
'E_bill_taxes' => 'The total tax amount doesn\'t match the tax amount of the elements. Potential issue with tax rates or additional items.',
|
||||||
'E_bill_net' => 'The total net amount doesn\'t match the net amount of the elements. Potential issue with tax rates or additional items.',
|
'E_bill_net' => 'The total net amount doesn\'t match the net amount of the elements. Potential issue with tax rates or additional items.',
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ use phpOMS\Uri\UriFactory;
|
||||||
*/
|
*/
|
||||||
$taxcombination = $this->data['taxcombination'];
|
$taxcombination = $this->data['taxcombination'];
|
||||||
|
|
||||||
$previous = empty($taxcombination) ? '{/base}/finance/tax/combination/list' : '{/base}/finance/tax/combination/list?{?}&id=' . \reset($taxcombination)->id . '&ptype=p';
|
$previous = empty($taxcombination) ? '{/base}/finance/tax/combination/list' : '{/base}/finance/tax/combination/list?{?}&offset=' . \reset($taxcombination)->id . '&ptype=p';
|
||||||
$next = empty($taxcombination) ? '{/base}/finance/tax/combination/list' : '{/base}/finance/tax/combination/list?{?}&id=' . \end($taxcombination)->id . '&ptype=n';
|
$next = empty($taxcombination) ? '{/base}/finance/tax/combination/list' : '{/base}/finance/tax/combination/list?{?}&offset=' . \end($taxcombination)->id . '&ptype=n';
|
||||||
|
|
||||||
echo $this->data['nav']->render(); ?>
|
echo $this->data['nav']->render(); ?>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<?php $count = 0;
|
<?php $count = 0;
|
||||||
foreach ($bills as $key => $value) :
|
foreach ($bills as $key => $value) :
|
||||||
++$count;
|
++$count;
|
||||||
$url = UriFactory::build('{/base}/purchase/bill?{?}&id=' . $value->id);
|
$url = UriFactory::build('{/base}/purchase/bill/view?{?}&id=' . $value->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
|
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
|
||||||
|
|
|
||||||
44
Theme/Backend/purchase-bill-upload.tpl.php
Normal file
44
Theme/Backend/purchase-bill-upload.tpl.php
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Jingga
|
||||||
|
*
|
||||||
|
* PHP Version 8.2
|
||||||
|
*
|
||||||
|
* @package Modules\Billing
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 2.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://jingga.app
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use phpOMS\Uri\UriFactory;
|
||||||
|
|
||||||
|
echo $this->data['nav']->render(); ?>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12 col-md-6">
|
||||||
|
<form method="PUT" id="media-uploader" action="<?= UriFactory::build('{/api}purchase/recognition/upload?csrf={$CSRF}'); ?>">
|
||||||
|
<section class="portlet">
|
||||||
|
<div class="portlet-head"><?= $this->getHtml('Upload'); ?></div>
|
||||||
|
<div class="portlet-body">
|
||||||
|
<div class="form-group">
|
||||||
|
<ul>
|
||||||
|
<li><?= $this->getHtml('RecognitionUpload1'); ?>
|
||||||
|
<li><?= $this->getHtml('RecognitionUpload2'); ?>
|
||||||
|
<li><?= $this->getHtml('RecognitionUpload3'); ?>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="iFiles"><?= $this->getHtml('Files'); ?></label>
|
||||||
|
<input type="file" id="iFiles" name="files" multiple>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="portlet-foot">
|
||||||
|
<input type="submit" id="iMediaCreate" name="mediaCreateButton" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -453,7 +453,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<div class="portlet-body col-simple">
|
<div class="portlet-body col-simple">
|
||||||
<iframe id="iBillArchive"
|
<iframe id="iBillArchive"
|
||||||
class="col-simple"
|
class="col-simple"
|
||||||
src="<?= UriFactory::build('{/api}media/export?csrf={$CSRF}') . '?id=' . $archive->id; ?>"
|
src="<?= UriFactory::build('{/api}media/export?csrf={$CSRF}') . '&id=' . $archive->id; ?>"
|
||||||
loading="lazy" allowfullscreen></iframe>
|
loading="lazy" allowfullscreen></iframe>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ echo $this->data['nav']->render(); ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $count = 0; foreach ($bills as $key => $value) :
|
<?php $count = 0; foreach ($bills as $key => $value) :
|
||||||
++$count;
|
++$count;
|
||||||
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $value->id);
|
$url = UriFactory::build('{/base}/sales/bill/view?{?}&id=' . $value->id);
|
||||||
?>
|
?>
|
||||||
<tr data-href="<?= $url; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
|
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
|
||||||
|
|
|
||||||
|
|
@ -1,202 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* Jingga
|
|
||||||
*
|
|
||||||
* PHP Version 8.2
|
|
||||||
*
|
|
||||||
* @package Modules\Billing
|
|
||||||
* @copyright Dennis Eichhorn
|
|
||||||
* @license OMS License 2.0
|
|
||||||
* @version 1.0.0
|
|
||||||
* @link https://jingga.app
|
|
||||||
*/
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
use phpOMS\Localization\ISO3166NameEnum;
|
|
||||||
use phpOMS\Localization\ISO3166TwoEnum;
|
|
||||||
use phpOMS\Uri\UriFactory;
|
|
||||||
|
|
||||||
$bills = $this->data['bills'] ?? [];
|
|
||||||
|
|
||||||
echo $this->data['nav']->render(); ?>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-12">
|
|
||||||
<div class="portlet">
|
|
||||||
<div class="portlet-head"><?= $this->getHtml('Bills'); ?><i class="g-icon download btn end-xs">download</i></div>
|
|
||||||
<div class="slider">
|
|
||||||
<table id="billList" class="default sticky">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<td><label class="checkbox" for="iBillSelect-">
|
|
||||||
<input type="checkbox" id="iBillSelect-" name="billselect">
|
|
||||||
<span class="checkmark"></span>
|
|
||||||
</label>
|
|
||||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
|
||||||
<label for="billList-sort-1">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-1">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-2">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-2">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td><?= $this->getHtml('External'); ?>
|
|
||||||
<label for="billList-sort-1">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-1">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-2">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-2">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td><?= $this->getHtml('Type'); ?>
|
|
||||||
<label for="billList-sort-3">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-3">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-4">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-4">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td><?= $this->getHtml('SupplierID'); ?>
|
|
||||||
<label for="billList-sort-5">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-5">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-6">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-6">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td class="wf-100"><?= $this->getHtml('Supplier'); ?>
|
|
||||||
<label for="billList-sort-7">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-7">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-8">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-8">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td class="wf-100"><?= $this->getHtml('Address'); ?>
|
|
||||||
<label for="billList-sort-9">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-9">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-10">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-10">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td class="wf-100"><?= $this->getHtml('Postal'); ?>
|
|
||||||
<label for="billList-sort-11">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-11">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-12">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-12">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td class="wf-100"><?= $this->getHtml('City'); ?>
|
|
||||||
<label for="billList-sort-13">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-13">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-14">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-14">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td class="wf-100"><?= $this->getHtml('Country'); ?>
|
|
||||||
<label for="billList-sort-15">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-15">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-16">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-16">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td><?= $this->getHtml('Gross'); ?>
|
|
||||||
<label for="billList-sort-7">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-7">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-18">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-18">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<td><?= $this->getHtml('Date'); ?>
|
|
||||||
<label for="billList-sort-23">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-23">
|
|
||||||
<i class="sort-asc g-icon">expand_less</i>
|
|
||||||
</label>
|
|
||||||
<label for="billList-sort-24">
|
|
||||||
<input type="radio" name="billList-sort" id="billList-sort-24">
|
|
||||||
<i class="sort-desc g-icon">expand_more</i>
|
|
||||||
</label>
|
|
||||||
<label>
|
|
||||||
<i class="filter g-icon">filter_alt</i>
|
|
||||||
</label>
|
|
||||||
<tbody>
|
|
||||||
<?php $count = 0;
|
|
||||||
foreach ($bills as $key => $value) :
|
|
||||||
++$count;
|
|
||||||
$url = UriFactory::build('{/base}/private/purchase/bill?{?}&id=' . $value->id);
|
|
||||||
?>
|
|
||||||
<tr data-href="<?= $url; ?>">
|
|
||||||
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
|
|
||||||
<input type="checkbox" id="iBillSelect-<?= $key; ?>" name="billselect">
|
|
||||||
<span class="checkmark"></span>
|
|
||||||
</label>
|
|
||||||
<td><a href="<?= $url; ?>"><?= $value->getNumber(); ?></a>
|
|
||||||
<td><a href="<?= $url; ?>"><?= $value->external; ?></a>
|
|
||||||
<td><a href="<?= $url; ?>"><?= $value->type->getL11n(); ?></a>
|
|
||||||
<td><a class="content" href="<?= $supplier = UriFactory::build('purchase/supplier/view?{?}&id=' . $value->supplier->id); ?>"><?= $value->supplier->number; ?></a>
|
|
||||||
<td><a class="content" href="<?= $supplier; ?>"><?= $this->printHtml($value->billTo); ?></a>
|
|
||||||
<td><a href="<?= $url;
|
|
||||||
?>"><?= $value->billAddress; ?></a>
|
|
||||||
<td><a href="<?= $url; ?>"><?= $value->billZip; ?></a>
|
|
||||||
<td><a href="<?= $url; ?>"><?= $value->billCity; ?></a>
|
|
||||||
<td><a href="<?= $url; ?>"><?= empty($value->billCountry)
|
|
||||||
? ''
|
|
||||||
: ISO3166NameEnum::getByName(
|
|
||||||
ISO3166TwoEnum::getName($value->billCountry)
|
|
||||||
); ?></a>
|
|
||||||
<td><a href="<?= $url; ?>"><?= $value->grossSales->getAmount(); ?></a>
|
|
||||||
<td><a href="<?= $url; ?>"><?= $value->billDate?->format('Y-m-d'); ?></a>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php if ($count === 0) : ?>
|
|
||||||
<tr><td colspan="12" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
|
||||||
<?php endif; ?>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
Loading…
Reference in New Issue
Block a user