mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-01-10 14:48:42 +00:00
Merge branch 'develop'
This commit is contained in:
commit
a293d98a4e
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
|
|
@ -13,10 +13,15 @@ on:
|
|||
- cron: '0 0 1,15 * *'
|
||||
|
||||
jobs:
|
||||
general_module_workflow:
|
||||
general_module_workflow_php:
|
||||
uses: Karaka-Management/Karaka/.github/workflows/php_template.yml@develop
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
general_module_workflow_js:
|
||||
uses: Karaka-Management/Karaka/.github/workflows/js_template.yml@develop
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -23,4 +23,18 @@ return [
|
|||
'pattern' => '',
|
||||
'module' => ApiController::NAME,
|
||||
],
|
||||
[
|
||||
'type' => 'setting',
|
||||
'name' => SettingsEnum::BILLING_DOCUMENT_SPACER_COLOR,
|
||||
'content' => '15613766',
|
||||
'pattern' => '\d',
|
||||
'module' => ApiController::NAME,
|
||||
],
|
||||
[
|
||||
'type' => 'setting',
|
||||
'name' => SettingsEnum::BILLING_DOCUMENT_SPACER_TOLERANCE,
|
||||
'content' => '175',
|
||||
'pattern' => '\d',
|
||||
'module' => ApiController::NAME,
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Media
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* Bill localization.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Billing",
|
||||
"uri": "{/base}/sales/bill/list?{?}",
|
||||
"uri": "{/base}/sales/bill/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 10,
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Open",
|
||||
"uri": "{/base}/sales/bill/list?{?}",
|
||||
"uri": "{/base}/sales/bill/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Archive",
|
||||
"uri": "{/base}/sales/bill/archive?{?}",
|
||||
"uri": "{/base}/sales/bill/archive",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -49,7 +49,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "{/base}/sales/bill/create?{?}",
|
||||
"uri": "{/base}/sales/bill/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 10,
|
||||
|
|
@ -60,11 +60,11 @@
|
|||
},
|
||||
{
|
||||
"id": 1005104401,
|
||||
"pid": "/sales/bill",
|
||||
"pid": "/bill/payment",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "PaymentTerms",
|
||||
"uri": "{/base}/bill/payment/list?{?}",
|
||||
"uri": "{/base}/bill/payment/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 15,
|
||||
|
|
@ -75,11 +75,11 @@
|
|||
},
|
||||
{
|
||||
"id": 1005104501,
|
||||
"pid": "/sales/bill",
|
||||
"pid": "/bill/shipping",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "ShippingTerms",
|
||||
"uri": "{/base}/bill/shipping/list?{?}",
|
||||
"uri": "{/base}/bill/shipping/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 20,
|
||||
|
|
@ -96,7 +96,7 @@
|
|||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Billing",
|
||||
"uri": "{/base}/purchase/bill/list?{?}",
|
||||
"uri": "{/base}/purchase/bill/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 10,
|
||||
|
|
@ -110,7 +110,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Open",
|
||||
"uri": "{/base}/purchase/bill/list?{?}",
|
||||
"uri": "{/base}/purchase/bill/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Archive",
|
||||
"uri": "{/base}/purchase/bill/archive?{?}",
|
||||
"uri": "{/base}/purchase/bill/archive",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -140,7 +140,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "{/base}/purchase/bill/create?{?}",
|
||||
"uri": "{/base}/purchase/bill/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 10,
|
||||
|
|
@ -155,7 +155,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Upload",
|
||||
"uri": "{/base}/purchase/bill/upload?{?}",
|
||||
"uri": "{/base}/purchase/bill/upload",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 15,
|
||||
|
|
@ -172,7 +172,7 @@
|
|||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "Billing",
|
||||
"uri": "{/base}/warehouse/bill/list?{?}",
|
||||
"uri": "{/base}/warehouse/bill/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -186,7 +186,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "{/base}/warehouse/bill/list?{?}",
|
||||
"uri": "{/base}/warehouse/bill/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
|
|
@ -201,7 +201,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Archive",
|
||||
"uri": "{/base}/warehouse/bill/archive?{?}",
|
||||
"uri": "{/base}/warehouse/bill/archive",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
|
|
@ -216,7 +216,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "{/base}/warehouse/bill/create?{?}",
|
||||
"uri": "{/base}/warehouse/bill/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -233,7 +233,7 @@
|
|||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Bill",
|
||||
"uri": "{/base}/purchase/analysis/bill?{?}",
|
||||
"uri": "{/base}/purchase/analysis/bill",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 15,
|
||||
|
|
@ -248,7 +248,7 @@
|
|||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "InvoiceRecognition",
|
||||
"uri": "{/base}/private/purchase/recognition/dashboard?{?}",
|
||||
"uri": "{/base}/private/purchase/recognition/dashboard",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -258,11 +258,11 @@
|
|||
"children": [
|
||||
{
|
||||
"id": 1005109101,
|
||||
"pid": "/",
|
||||
"pid": "/private/purchase/recognition",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "{/base}/private/purchase/recognition/dashboard?{?}",
|
||||
"uri": "{/base}/private/purchase/recognition/dashboard",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
|
|
@ -274,11 +274,11 @@
|
|||
},
|
||||
{
|
||||
"id": 1005109201,
|
||||
"pid": "/",
|
||||
"pid": "/private/purchase/recognition",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Upload",
|
||||
"uri": "{/base}/private/purchase/recognition/upload?{?}",
|
||||
"uri": "{/base}/private/purchase/recognition/upload",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -296,7 +296,7 @@
|
|||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "InvoiceRecognition",
|
||||
"uri": "{/base}/purchase/recognition/dashboard?{?}",
|
||||
"uri": "{/base}/purchase/recognition/dashboard",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -306,11 +306,11 @@
|
|||
"children": [
|
||||
{
|
||||
"id": 1005110101,
|
||||
"pid": "/",
|
||||
"pid": "/purchase/recognition",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "{/base}/purchase/recognition/dashboard?{?}",
|
||||
"uri": "{/base}/purchase/recognition/dashboard",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
|
|
@ -322,11 +322,11 @@
|
|||
},
|
||||
{
|
||||
"id": 1005110201,
|
||||
"pid": "/",
|
||||
"pid": "/purchase/recognition",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Upload",
|
||||
"uri": "{/base}/purchase/recognition/upload?{?}",
|
||||
"uri": "{/base}/purchase/recognition/upload",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
|
|
@ -337,5 +337,51 @@
|
|||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": 1005103001,
|
||||
"pid": "/",
|
||||
"type": 2,
|
||||
"subtype": 1,
|
||||
"name": "TaxCombinations",
|
||||
"uri": "{/base}/finance/tax/combination/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 2,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1008101001,
|
||||
"children": [
|
||||
{
|
||||
"id": 1005103002,
|
||||
"pid": "/finance/tax/combination",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "List",
|
||||
"uri": "{/base}/finance/tax/combination/list",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 1,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005103001,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"id": 1005103003,
|
||||
"pid": "/finance/tax/combination",
|
||||
"type": 3,
|
||||
"subtype": 1,
|
||||
"name": "Create",
|
||||
"uri": "{/base}/finance/tax/combination/create",
|
||||
"target": "self",
|
||||
"icon": null,
|
||||
"order": 5,
|
||||
"from": "Billing",
|
||||
"permission": { "permission": 2, "category": null, "element": null },
|
||||
"parent": 1005103001,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -1,4 +1,11 @@
|
|||
[
|
||||
{
|
||||
"type": 1,
|
||||
"item_code": "GENERAL",
|
||||
"account_code": "EU_S",
|
||||
"tax_code": "EU_S0",
|
||||
"account": "8400"
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"item_code": "GENERAL",
|
||||
|
|
@ -83,14 +90,14 @@
|
|||
{
|
||||
"type": 1,
|
||||
"item_code": "GENERAL",
|
||||
"account_code": "DE_0",
|
||||
"account_code": "DE_S",
|
||||
"tax_code": "SBIZ_0",
|
||||
"account": "8195"
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"item_code": "GENERAL",
|
||||
"account_code": "DE_0",
|
||||
"account_code": "DE_S",
|
||||
"tax_code": "SBIZ_0",
|
||||
"account": "3349"
|
||||
},
|
||||
|
|
@ -202,6 +209,12 @@
|
|||
"account_code": "INT",
|
||||
"tax_code": "S0"
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"item_code": "SOFTWARE",
|
||||
"account_code": "EU_S",
|
||||
"tax_code": "EU_S0"
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"item_code": "SOFTWARE",
|
||||
|
|
@ -285,14 +298,14 @@
|
|||
{
|
||||
"type": 1,
|
||||
"item_code": "SOFTWARE",
|
||||
"account_code": "DE_0",
|
||||
"account_code": "DE_S",
|
||||
"tax_code": "SBIZ_0",
|
||||
"account": "8195"
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"item_code": "SOFTWARE",
|
||||
"account_code": "DE_0",
|
||||
"account_code": "DE_S",
|
||||
"tax_code": "SBIZ_0",
|
||||
"account": "3349"
|
||||
},
|
||||
|
|
@ -404,6 +417,12 @@
|
|||
"account_code": "INT",
|
||||
"tax_code": "S0"
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"item_code": "SERVICE",
|
||||
"account_code": "EU_S",
|
||||
"tax_code": "EU_S0"
|
||||
},
|
||||
{
|
||||
"type": 1,
|
||||
"item_code": "SERVICE",
|
||||
|
|
@ -487,14 +506,14 @@
|
|||
{
|
||||
"type": 1,
|
||||
"item_code": "SERVICE",
|
||||
"account_code": "DE_0",
|
||||
"account_code": "DE_S",
|
||||
"tax_code": "SBIZ_0",
|
||||
"account": "8195"
|
||||
},
|
||||
{
|
||||
"type": 2,
|
||||
"item_code": "SERVICE",
|
||||
"account_code": "DE_0",
|
||||
"account_code": "DE_S",
|
||||
"tax_code": "SBIZ_0",
|
||||
"account": "3349"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin\Install
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -41,6 +41,27 @@
|
|||
"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",
|
||||
"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"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"l11n": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -285,6 +285,12 @@ final class Installer extends InstallerAbstract
|
|||
->where('name', 'sales_tax_code')
|
||||
->execute();
|
||||
|
||||
/** @var \Modules\Attribute\Models\AttributeType $itemAttributePurchase */
|
||||
$itemAttributePurchase = ItemAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'purchase_tax_code')
|
||||
->execute();
|
||||
|
||||
/** @var \Modules\Attribute\Models\AttributeType $clientAttributeSales */
|
||||
$clientAttributeSales = ClientAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
|
|
@ -298,7 +304,10 @@ final class Installer extends InstallerAbstract
|
|||
->execute();
|
||||
|
||||
foreach ($taxes as $tax) {
|
||||
$itemValue = $itemAttributeSales->getDefaultByValue($tax['item_code']);
|
||||
$itemValue = $tax['type'] === 1
|
||||
? $itemAttributeSales->getDefaultByValue($tax['item_code'])
|
||||
: $itemAttributePurchase->getDefaultByValue($tax['item_code']);
|
||||
|
||||
$accountValue = $tax['type'] === 1
|
||||
? $clientAttributeSales->getDefaultByValue($tax['account_code'])
|
||||
: $supplierAttributeSales->getDefaultByValue($tax['account_code']);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -22,6 +22,8 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\ApiBillController:apiMediaRender',
|
||||
'verb' => RouteVerb::GET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -33,6 +35,8 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\ApiBillController:apiPreviewRender',
|
||||
'verb' => RouteVerb::GET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -44,6 +48,8 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\ApiPriceController:apiPriceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -55,6 +61,8 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\ApiPurchaseController:apiInvoiceParse',
|
||||
'verb' => RouteVerb::SET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::MODIFY,
|
||||
|
|
@ -62,4 +70,17 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/recognition/upload(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\ApiPurchaseController:apiPurchaseBillUpload',
|
||||
'verb' => RouteVerb::SET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionCategory::PURCHASE_INVOICE,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -18,10 +18,11 @@ use phpOMS\Account\PermissionType;
|
|||
use phpOMS\Router\RouteVerb;
|
||||
|
||||
return [
|
||||
'^.*/sales/bill/create(\?.*$|$)' => [
|
||||
'^/sales/bill/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -29,10 +30,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/sales/bill/list(\?.*$|$)' => [
|
||||
'^/sales/bill/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -40,10 +42,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/sales/bill/archive(\?.*$|$)' => [
|
||||
'^/sales/bill/archive(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesArchive',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -51,10 +54,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/sales/bill(\?.*$|$)' => [
|
||||
'^/sales/bill/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -63,10 +67,11 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/purchase/bill/create(\?.*$|$)' => [
|
||||
'^/purchase/bill/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -74,10 +79,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/bill/list(\?.*$|$)' => [
|
||||
'^/purchase/bill/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -85,10 +91,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/bill/archive(\?.*$|$)' => [
|
||||
'^/purchase/bill/archive(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseArchive',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -96,10 +103,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/bill(\?.*$|$)' => [
|
||||
'^/purchase/bill/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -107,22 +115,24 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/bill/upload(\?.*$|$)' => [
|
||||
'^/purchase/bill/upload(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceUpload',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionCategory::SALES_INVOICE,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'^.*/warehouse/bill/create(\?.*$|$)' => [
|
||||
'^/warehouse/bill/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -130,10 +140,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/warehouse/bill/list(\?.*$|$)' => [
|
||||
'^/warehouse/bill/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -141,10 +152,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/warehouse/bill/archive(\?.*$|$)' => [
|
||||
'^/warehouse/bill/archive(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockArchive',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -152,10 +164,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/warehouse/bill(\?.*$|$)' => [
|
||||
'^/warehouse/bill/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -164,10 +177,11 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/private/purchase/recognition/dashboard(\?.*$|$)' => [
|
||||
'^/private/purchase/recognition/dashboard(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillDashboard',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -175,10 +189,47 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/private/purchase/recognition/upload(\?.*$|$)' => [
|
||||
'^/private/purchase/recognition/upload(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillUpload',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionCategory::PRIVATE_BILL_UPLOAD,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^/private/purchase/recognition/bill(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivateBillingPurchaseInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::PRIVATE_DASHBOARD,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^/purchase/recognition/dashboard(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillDashboard',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::PRIVATE_DASHBOARD,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^/purchase/recognition/upload(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillUpload',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -186,43 +237,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/private/purchase/recognition/bill(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivateBillingPurchaseInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::PRIVATE_DASHBOARD,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/recognition/dashboard(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillDashboard',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::PRIVATE_DASHBOARD,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/recognition/upload(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillUpload',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::PRIVATE_BILL_UPLOAD,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/recognition/bill(\?.*$|$)' => [
|
||||
'^/purchase/recognition/bill(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivateBillingPurchaseInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -231,10 +250,11 @@ return [
|
|||
],
|
||||
],
|
||||
|
||||
'^.*/bill/payment/list(\?.*$|$)' => [
|
||||
'^/bill/payment/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPaymentList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -242,10 +262,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/bill/payment/view(\?.*$|$)' => [
|
||||
'^/bill/payment/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPaymentView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -253,10 +274,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/bill/shipping/list(\?.*$|$)' => [
|
||||
'^/bill/shipping/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewShippingList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -264,10 +286,11 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^.*/bill/shipping/view(\?.*$|$)' => [
|
||||
'^/bill/shipping/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewShippingView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -275,4 +298,41 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
|
||||
'^/finance/tax/combination/list(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewTaxCombinationList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionCategory::TAX,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^/finance/tax/combination/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewTaxCombinationView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::TAX,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^/finance/tax/combination/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewTaxCombinationCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionCategory::TAX,
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Admin
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -40,7 +40,7 @@ final class ApiAttributeController extends Controller
|
|||
use \Modules\Attribute\Controller\ApiAttributeTraitController;
|
||||
|
||||
/**
|
||||
* Api method to create item attribute
|
||||
* Api method to create Attribute
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -217,7 +217,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttribute
|
||||
* Api method to update bill Attribute
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -268,7 +268,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to delete BillAttribute
|
||||
* Api method to delete bill Attribute
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -305,7 +305,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttributeTypeL11n
|
||||
* Api method to update bill AttributeTypeL11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -363,7 +363,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttributeType
|
||||
* Api method to update bill AttributeType
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -393,7 +393,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to delete BillAttributeType
|
||||
* Api method to delete bill AttributeType
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -423,7 +423,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttributeValue
|
||||
* Api method to update bill AttributeValue
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -460,7 +460,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to delete BillAttributeValue
|
||||
* Api method to delete bill AttributeValue
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -491,7 +491,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttributeValueL11n
|
||||
* Api method to update bill AttributeValueL11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -521,7 +521,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to delete BillAttributeValueL11n
|
||||
* Api method to delete bill AttributeValueL11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -101,6 +101,8 @@ final class ApiBillController extends Controller
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function apiBillEmail(RequestAbstract $request, array $data = []) : void
|
||||
|
|
@ -440,7 +442,7 @@ final class ApiBillController extends Controller
|
|||
|
||||
// @todo use bill and shipping address instead of main address if available
|
||||
// https://github.com/Karaka-Management/oms-Billing/issues/45
|
||||
$bill->billTo = $request->getDataString('billto') ?? $account->account->name1;
|
||||
$bill->billTo = $request->getDataString('billto') ?? $account->account->name1 . ' ' . $account->account->name2;
|
||||
$bill->billAddress = $request->getDataString('billaddress') ?? $account->mainAddress->address;
|
||||
$bill->billCity = $request->getDataString('billtocity') ?? $account->mainAddress->city;
|
||||
$bill->billZip = $request->getDataString('billtopostal') ?? $account->mainAddress->postal;
|
||||
|
|
@ -481,7 +483,7 @@ final class ApiBillController extends Controller
|
|||
$settings = $this->app->appSettings->get(null,
|
||||
SettingsEnum::VALID_BILL_LANGUAGES,
|
||||
unit: $this->app->unitId,
|
||||
module: 'Admin'
|
||||
module: self::NAME
|
||||
);
|
||||
|
||||
if (empty($settings)) {
|
||||
|
|
@ -489,7 +491,7 @@ final class ApiBillController extends Controller
|
|||
$settings = $this->app->appSettings->get(null,
|
||||
SettingsEnum::VALID_BILL_LANGUAGES,
|
||||
unit: null,
|
||||
module: 'Admin'
|
||||
module: self::NAME
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -732,88 +734,40 @@ final class ApiBillController extends Controller
|
|||
$bill = BillMapper::get()->where('id', (int) $request->getData('bill'))->execute();
|
||||
$path = $this->createBillDir($bill);
|
||||
|
||||
$uploaded = [];
|
||||
if (!empty($uploadedFiles = $request->files)) {
|
||||
$uploaded = new NullCollection();
|
||||
if (!empty($request->files)) {
|
||||
$uploaded = $this->app->moduleManager->get('Media', 'Api')->uploadFiles(
|
||||
names: [],
|
||||
fileNames: [],
|
||||
files: $uploadedFiles,
|
||||
files: $request->files,
|
||||
account: $request->header->account,
|
||||
basePath: __DIR__ . '/../../../Modules/Media/Files' . $path,
|
||||
virtualPath: $path,
|
||||
pathSettings: PathSettings::FILE_PATH,
|
||||
hasAccountRelation: false,
|
||||
readContent: $request->getDataBool('parse_content') ?? false
|
||||
readContent: $request->getDataBool('parse_content') ?? false,
|
||||
type: $request->getDataInt('type'),
|
||||
rel: $bill->id,
|
||||
mapper: BillMapper::class,
|
||||
field: 'files'
|
||||
);
|
||||
|
||||
$collection = null;
|
||||
foreach ($uploaded as $media) {
|
||||
$this->createModelRelation(
|
||||
$request->header->account,
|
||||
$bill->id,
|
||||
$media->id,
|
||||
BillMapper::class,
|
||||
'files',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
|
||||
if ($request->hasData('type')) {
|
||||
$this->createModelRelation(
|
||||
$request->header->account,
|
||||
$media->id,
|
||||
$request->getDataInt('type'),
|
||||
MediaMapper::class,
|
||||
'types',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
}
|
||||
|
||||
if ($collection === null) {
|
||||
/** @var \Modules\Media\Models\Collection $collection */
|
||||
$collection = MediaMapper::getParentCollection($path)
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
if ($collection->id === 0) {
|
||||
$collection = $this->app->moduleManager->get('Media')->createRecursiveMediaCollection(
|
||||
$path,
|
||||
$request->header->account,
|
||||
__DIR__ . '/../../../Modules/Media/Files' . $path,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->createModelRelation(
|
||||
$request->header->account,
|
||||
$collection->id,
|
||||
$media->id,
|
||||
CollectionMapper::class,
|
||||
'sources',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$mediaFiles = $request->getDataJson('media');
|
||||
foreach ($mediaFiles as $media) {
|
||||
$this->createModelRelation(
|
||||
if (!empty($media = $request->getDataJson('media'))) {
|
||||
$this->app->moduleManager->get('Media', 'Api')->addMediaToCollectionAndModel(
|
||||
$request->header->account,
|
||||
$media,
|
||||
$bill->id,
|
||||
(int) $media,
|
||||
BillMapper::class,
|
||||
'files',
|
||||
'',
|
||||
$request->getOrigin()
|
||||
$path
|
||||
);
|
||||
}
|
||||
|
||||
// @todo media should be an array of NullMedia elements
|
||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, 'Media', 'Media added to bill.', [
|
||||
'upload' => $uploaded,
|
||||
'media' => $mediaFiles,
|
||||
$this->fillJsonResponse($request, $response, NotificationLevel::OK, '', $this->app->l11nManager->getText($response->header->l11n->language, '0', '0', 'SuccessfulAdd'), [
|
||||
'upload' => $uploaded->sources,
|
||||
'media' => $media,
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -939,7 +893,7 @@ final class ApiBillController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to validate bill creation from request
|
||||
* Method to validate add Media to bill request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -1539,7 +1493,7 @@ final class ApiBillController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to create bill files
|
||||
* Api method to create Note
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -64,7 +64,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute from request.
|
||||
* Method to create BillType from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -98,7 +98,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate BillType create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -119,7 +119,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to create item attribute l11n
|
||||
* Api method to create BillType l11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -146,7 +146,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute l11n from request.
|
||||
* Method to create BillType l11n from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -165,7 +165,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute l11n create request
|
||||
* Validate BillType l11n create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -228,7 +228,7 @@ final class ApiPriceController extends Controller
|
|||
*/
|
||||
|
||||
/** @var \Modules\Billing\Models\Price\Price[] $prices */
|
||||
$prices = $queryMapper->execute();
|
||||
$prices = $queryMapper->executeGetArray();
|
||||
|
||||
// Find base price
|
||||
$basePrice = null;
|
||||
|
|
@ -247,7 +247,7 @@ final class ApiPriceController extends Controller
|
|||
&& $price->clientsection->id === 0
|
||||
&& $price->clienttype->id === 0
|
||||
&& $price->promocode === ''
|
||||
&& $price->priceNew->value < ($basePrice?->priceNew->value ?? \PHP_INT_MAX)
|
||||
&& $price->priceNew->value < ($basePrice?->priceNew?->value ?? \PHP_INT_MAX)
|
||||
) {
|
||||
$basePrice = $price;
|
||||
}
|
||||
|
|
@ -362,7 +362,7 @@ final class ApiPriceController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute from request.
|
||||
* Method to create Price from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -407,14 +407,14 @@ final class ApiPriceController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate Price create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*
|
||||
* @todo consider to prevent name 'default'?
|
||||
* Might not be possible because it is used internally as well (see apiItemCreate in ItemManagement)
|
||||
* Might not be possible because it is used internally as well (see apiItemCreate in ItemManagement)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
@ -506,8 +506,8 @@ final class ApiPriceController extends Controller
|
|||
$new->clientsection = $request->hasData('clientsection') ? new NullAttributeValue((int) $request->getData('clientsection')) : $new->clientsection;
|
||||
$new->clienttype = $request->hasData('clienttype') ? new NullAttributeValue((int) $request->getData('clienttype')) : $new->clienttype;
|
||||
|
||||
$new->supplier = $request->hasData('supplier') ? new NullSupplier((int) $request->getData('supplier')) : $new->supplier;
|
||||
$new->unit = $request->getDataInt('unit') ?? $new->unit;
|
||||
$new->supplier = $request->hasData('supplier') ? new NullSupplier((int) $request->getData('supplier')) : $new->supplier;
|
||||
$new->unit = $request->getDataInt('unit') ?? $new->unit;
|
||||
|
||||
$new->quantity = new FloatInt($request->getDataString('quantity') ?? $new->quantity->value);
|
||||
$new->price = new FloatInt($request->getDataString('price') ?? $new->price->value);
|
||||
|
|
@ -516,10 +516,10 @@ final class ApiPriceController extends Controller
|
|||
$new->discountPercentage = new FloatInt($request->getDataString('discountPercentage') ?? $new->discountPercentage->value);
|
||||
$new->bonus = new FloatInt($request->getDataString('bonus') ?? $new->bonus->value);
|
||||
|
||||
$new->multiply = $request->getDataBool('multiply') ?? $new->multiply;
|
||||
$new->currency = ISO4217CharEnum::tryFromValue($request->getDataString('currency')) ?? $new->currency;
|
||||
$new->start = $request->getDataDateTime('start') ?? $new->start;
|
||||
$new->end = $request->getDataDateTime('end') ?? $new->end;
|
||||
$new->multiply = $request->getDataBool('multiply') ?? $new->multiply;
|
||||
$new->currency = ISO4217CharEnum::tryFromValue($request->getDataString('currency')) ?? $new->currency;
|
||||
$new->start = $request->getDataDateTime('start') ?? $new->start;
|
||||
$new->end = $request->getDataDateTime('end') ?? $new->end;
|
||||
|
||||
return $new;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -82,7 +82,7 @@ final class ApiPurchaseController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute from request.
|
||||
* Method to upload supplier Bill from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -111,7 +111,39 @@ final class ApiPurchaseController extends Controller
|
|||
$bills = [];
|
||||
|
||||
$files = \array_merge($request->files, $request->getDataJson('media'));
|
||||
|
||||
/** @var \Model\Setting[] $settings */
|
||||
$settings = $this->app->appSettings->get(null,
|
||||
[SettingsEnum::BILLING_DOCUMENT_SPACER_COLOR, SettingsEnum::BILLING_DOCUMENT_SPACER_TOLERANCE],
|
||||
unit: $this->app->unitId,
|
||||
module: self::NAME
|
||||
);
|
||||
|
||||
if (empty($settings)) {
|
||||
/** @var \Model\Setting[] $settings */
|
||||
$settings = $this->app->appSettings->get(null,
|
||||
[SettingsEnum::BILLING_DOCUMENT_SPACER_COLOR, SettingsEnum::BILLING_DOCUMENT_SPACER_TOLERANCE],
|
||||
unit: null,
|
||||
module: self::NAME
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($files as $file) {
|
||||
// 1. convert to image pdftoppm
|
||||
// 2. search for color pages by using averageColorRandom (tolerance < 175 = color match)
|
||||
// 3. split pdf document if necessary
|
||||
// sudo apt-get --yes install pdftk
|
||||
// pdftk foo-bar.pdf cat 1-12 output foo.pdf
|
||||
// pdftk foo-bar.pdf cat 13-end output bar.pdf
|
||||
// alternatively, pdfseparate -f 1 -l 5 input.pdf output-page%d.pdf
|
||||
// alternatively, pdfjam <input-file> <page-ranges> -o <output-file>
|
||||
// alternatively, pdfly cat in.pdf 2:4 -o out.pdf
|
||||
// 4. add to documents array
|
||||
}
|
||||
|
||||
$documents = $files;
|
||||
|
||||
foreach ($documents as $file) {
|
||||
// Create default bill
|
||||
$billRequest = new HttpRequest();
|
||||
$billRequest->header->account = $request->header->account;
|
||||
|
|
@ -171,7 +203,7 @@ final class ApiPurchaseController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate supplier Bill upload request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -252,7 +284,7 @@ final class ApiPurchaseController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate Bill parse request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -126,6 +126,8 @@ final class ApiTaxController extends Controller
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function apiTaxCombinationCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
|
||||
|
|
@ -143,7 +145,7 @@ final class ApiTaxController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute from request.
|
||||
* Method to create TaxCombination from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -169,7 +171,7 @@ final class ApiTaxController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate TaxCombination create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -358,7 +360,7 @@ final class ApiTaxController extends Controller
|
|||
->with('itemCode')
|
||||
->where('clientCode/valueStr', $combination['account_code'] ?? '')
|
||||
->where('itemCode/valueStr', $combination['item_code'] ?? '')
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
if (\count($old) !== 1) {
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -23,12 +23,14 @@ use Modules\Billing\Models\BillTypeMapper;
|
|||
use Modules\Billing\Models\PaymentTermL11nMapper;
|
||||
use Modules\Billing\Models\PaymentTermMapper;
|
||||
use Modules\Billing\Models\PermissionCategory;
|
||||
use Modules\Billing\Models\PurchaseBillMapper;
|
||||
use Modules\Billing\Models\SalesBillMapper;
|
||||
use Modules\Billing\Models\SettingsEnum;
|
||||
use Modules\Billing\Models\ShippingTermL11nMapper;
|
||||
use Modules\Billing\Models\ShippingTermMapper;
|
||||
use Modules\Billing\Models\StockBillMapper;
|
||||
use Modules\Billing\Models\Tax\TaxCombinationMapper;
|
||||
use Modules\ClientManagement\Models\Attribute\ClientAttributeTypeMapper;
|
||||
use Modules\Finance\Models\TaxCodeMapper;
|
||||
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeMapper;
|
||||
use Modules\SupplierManagement\Models\Attribute\SupplierAttributeTypeMapper;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\DataStorage\Database\Query\OrderType;
|
||||
|
|
@ -66,7 +68,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
||||
|
||||
$mapperQuery = SalesBillMapper::getAll()
|
||||
$view->data['bills'] = BillMapper::getAll()
|
||||
->with('type')
|
||||
->with('type/l11n')
|
||||
->with('client')
|
||||
|
|
@ -75,22 +77,14 @@ final class BackendController extends Controller
|
|||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->sort('id', OrderType::DESC)
|
||||
->where('unit', $this->app->unitId)
|
||||
->limit(25);
|
||||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$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();
|
||||
}
|
||||
->where('client', null, '!=')
|
||||
->limit(25)
|
||||
->paginate(
|
||||
'id',
|
||||
$request->getData('ptype'),
|
||||
$request->getDataInt('offset')
|
||||
)
|
||||
->execute();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -113,7 +107,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Billing/Theme/Backend/sales-bill-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
||||
|
||||
$mapperQuery = SalesBillMapper::getAll()
|
||||
$view->data['bills'] = BillMapper::getAll()
|
||||
->with('type')
|
||||
->with('type/l11n')
|
||||
->with('client')
|
||||
|
|
@ -122,22 +116,88 @@ final class BackendController extends Controller
|
|||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->sort('id', OrderType::DESC)
|
||||
->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') {
|
||||
$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();
|
||||
}
|
||||
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 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;
|
||||
}
|
||||
|
|
@ -161,7 +221,7 @@ final class BackendController extends Controller
|
|||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005104001, $request, $response);
|
||||
|
||||
/** @var \Modules\Billing\Models\Bill $bill */
|
||||
$bill = SalesBillMapper::get()
|
||||
$bill = BillMapper::get()
|
||||
->with('client')
|
||||
->with('elements')
|
||||
->with('elements/container')
|
||||
|
|
@ -178,7 +238,7 @@ final class BackendController extends Controller
|
|||
->where('isTemplate', false)
|
||||
->where('transferType', BillTransferType::SALES)
|
||||
->where('l11n/language', $request->header->l11n->language)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['billtypes'] = $billTypes;
|
||||
|
||||
|
|
@ -197,7 +257,7 @@ final class BackendController extends Controller
|
|||
->where('module', 'Billing')
|
||||
->where('type', StringUtils::intHash(BillMapper::class))
|
||||
->where('ref', $bill->id)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
if (!empty($bill->elements)) {
|
||||
/** @var \Modules\Auditor\Models\Audit[] $logsElements */
|
||||
|
|
@ -206,7 +266,7 @@ final class BackendController extends Controller
|
|||
->where('module', 'Billing')
|
||||
->where('type', StringUtils::intHash(BillElementMapper::class))
|
||||
->where('ref', \array_keys($bill->elements), 'IN')
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
$logs = \array_merge($logs, $logsElements);
|
||||
}
|
||||
|
|
@ -241,7 +301,7 @@ final class BackendController extends Controller
|
|||
->where('isTemplate', false)
|
||||
->where('transferType', BillTransferType::SALES)
|
||||
->where('l11n/language', $request->header->l11n->language)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['billtypes'] = $billTypes;
|
||||
|
||||
|
|
@ -266,7 +326,9 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$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;
|
||||
}
|
||||
|
|
@ -287,7 +349,9 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$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;
|
||||
}
|
||||
|
|
@ -310,32 +374,21 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
||||
|
||||
$mapperQuery = PurchaseBillMapper::getAll()
|
||||
$view->data['bills'] = BillMapper::getAll()
|
||||
->with('type')
|
||||
->with('type/l11n')
|
||||
->with('supplier')
|
||||
->where('type/transferType', BillTransferType::PURCHASE)
|
||||
->sort('id', OrderType::DESC)
|
||||
->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('type/l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->data['bills'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
|
||||
->where('supplier', null, '!=')
|
||||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
} else {
|
||||
$view->data['bills'] = $mapperQuery->where('id', 0, '>')
|
||||
->where('supplier', null, '!=')
|
||||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
}
|
||||
->where('supplier', null, '!=')
|
||||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->limit(25)
|
||||
->paginate(
|
||||
'id',
|
||||
$request->getDataString('ptype') ?? '',
|
||||
$request->getDataInt('offset')
|
||||
)->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -358,7 +411,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
||||
$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('elements')
|
||||
->with('elements/container')
|
||||
|
|
@ -373,7 +426,7 @@ final class BackendController extends Controller
|
|||
->where('isTemplate', false)
|
||||
->where('transferType', BillTransferType::PURCHASE)
|
||||
->where('l11n/language', $request->header->l11n->language)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
$logs = [];
|
||||
if ($this->app->accountManager->get($request->header->account)->hasPermission(
|
||||
|
|
@ -390,7 +443,7 @@ final class BackendController extends Controller
|
|||
->where('module', 'Billing')
|
||||
->where('type', StringUtils::intHash(BillMapper::class))
|
||||
->where('ref', $view->data['bill']->id)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
if (!empty($view->data['bill']->elements)) {
|
||||
/** @var \Modules\Auditor\Models\Audit[] $logsElements */
|
||||
|
|
@ -399,7 +452,7 @@ final class BackendController extends Controller
|
|||
->where('module', 'Billing')
|
||||
->where('type', StringUtils::intHash(BillElementMapper::class))
|
||||
->where('ref', \array_keys($view->data['bill']->elements), 'IN')
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
$logs = \array_merge($logs, $logsElements);
|
||||
}
|
||||
|
|
@ -427,15 +480,17 @@ final class BackendController extends Controller
|
|||
{
|
||||
$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(1005106001, $request, $response);
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005105001, $request, $response);
|
||||
|
||||
if ($request->getData('ptype') === 'p') {
|
||||
$view->data['bills'] = StockBillMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '<')->where('unit', $this->app->unitId)->limit(25)->execute();
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->data['bills'] = StockBillMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->where('unit', $this->app->unitId)->limit(25)->execute();
|
||||
} else {
|
||||
$view->data['bills'] = StockBillMapper::getAll()->where('id', 0, '>')->where('unit', $this->app->unitId)->limit(25)->execute();
|
||||
}
|
||||
$view->data['bills'] = BillMapper::getAll()
|
||||
->where('unit', $this->app->unitId)
|
||||
->limit(25)
|
||||
->paginate(
|
||||
'id',
|
||||
$request->getData('ptype'),
|
||||
$request->getDataInt('offset')
|
||||
)
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -458,7 +513,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
||||
$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['media-upload'] = new \Modules\Media\Theme\Backend\Components\Upload\BaseView($this->app->l11nManager, $request, $response);
|
||||
|
|
@ -482,7 +537,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$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;
|
||||
}
|
||||
|
|
@ -502,7 +557,7 @@ final class BackendController extends Controller
|
|||
public function viewPrivatePurchaseBillUpload(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$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);
|
||||
|
||||
return $view;
|
||||
|
|
@ -526,7 +581,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005109001, $request, $response);
|
||||
|
||||
$mapperQuery = PurchaseBillMapper::getAll()
|
||||
$view->data['bills'] = BillMapper::getAll()
|
||||
->with('type')
|
||||
->with('type/l11n')
|
||||
->with('supplier')
|
||||
|
|
@ -534,22 +589,13 @@ final class BackendController extends Controller
|
|||
->where('status', BillStatus::UNPARSED)
|
||||
->sort('id', OrderType::DESC)
|
||||
->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)
|
||||
->execute();
|
||||
} elseif ($request->getData('ptype') === 'n') {
|
||||
$view->data['bills'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
|
||||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
} else {
|
||||
$view->data['bills'] = $mapperQuery->where('id', 0, '>')
|
||||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
}
|
||||
->where('type/l11n/language', $response->header->l11n->language)
|
||||
->limit(25)
|
||||
->paginate(
|
||||
'id',
|
||||
$request->getDataString('ptype') ?? '',
|
||||
$request->getDataInt('offset')
|
||||
)->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -572,7 +618,7 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Billing/Theme/Backend/purchase-bill');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005109001, $request, $response);
|
||||
|
||||
$bill = PurchaseBillMapper::get()
|
||||
$bill = BillMapper::get()
|
||||
->with('elements')
|
||||
->with('files')
|
||||
->with('files/types')
|
||||
|
|
@ -618,12 +664,12 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$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()
|
||||
->with('l11n')
|
||||
->where('l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -644,7 +690,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Billing/Theme/Backend/payment-view');
|
||||
$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['type'] = PaymentTermMapper::get()
|
||||
->with('l11n')
|
||||
|
|
@ -657,7 +703,7 @@ final class BackendController extends Controller
|
|||
/** @var \phpOMS\Localization\BaseStringL11n[] $l11nValues */
|
||||
$l11nValues = PaymentTermL11nMapper::getAll()
|
||||
->where('ref', $view->data['type']->id)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['l11nValues'] = $l11nValues;
|
||||
|
||||
|
|
@ -680,12 +726,12 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$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()
|
||||
->with('l11n')
|
||||
->where('l11n/language', $response->header->l11n->language)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -706,7 +752,7 @@ final class BackendController extends Controller
|
|||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Billing/Theme/Backend/shipping-view');
|
||||
$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['type'] = ShippingTermMapper::get()
|
||||
->with('l11n')
|
||||
|
|
@ -719,10 +765,139 @@ final class BackendController extends Controller
|
|||
/** @var \phpOMS\Localization\BaseStringL11n[] $l11nValues */
|
||||
$l11nValues = ShippingTermL11nMapper::getAll()
|
||||
->where('ref', $view->data['type']->id)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
$view->data['l11nValues'] = $l11nValues;
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which shows the sales dashboard
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param array $data Generic data
|
||||
*
|
||||
* @return RenderableInterface Response can be rendered
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function viewTaxCombinationList(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Billing/Theme/Backend/finance-taxcombination-list');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005103001, $request, $response);
|
||||
|
||||
$view->data['taxcombination'] = TaxCombinationMapper::getAll()
|
||||
->with('clientCode')
|
||||
->with('supplierCode')
|
||||
->with('itemCode')
|
||||
->with('taxCode')
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which shows the sales dashboard
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param array $data Generic data
|
||||
*
|
||||
* @return RenderableInterface Response can be rendered
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function viewTaxCombinationCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Billing/Theme/Backend/finance-taxcombination-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005103001, $request, $response);
|
||||
|
||||
$view->data['client_codes'] = ClientAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'sales_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['supplier_codes'] = SupplierAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'purchase_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['item_codes_sales'] = ItemAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'sales_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['item_codes_purchase'] = ItemAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'purchase_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['tax_codes'] = TaxCodeMapper::getAll()
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which shows the sales dashboard
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param array $data Generic data
|
||||
*
|
||||
* @return RenderableInterface Response can be rendered
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function viewTaxCombinationView(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Billing/Theme/Backend/finance-taxcombination-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005103001, $request, $response);
|
||||
|
||||
$view->data['taxcombination'] = TaxCombinationMapper::get()
|
||||
->with('clientCode')
|
||||
->with('supplierCode')
|
||||
->with('itemCode')
|
||||
->with('taxCode')
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->execute();
|
||||
|
||||
$view->data['client_codes'] = ClientAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'sales_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['supplier_codes'] = SupplierAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'purchase_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['item_codes_sales'] = ItemAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'sales_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['item_codes_purchase'] = ItemAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'purchase_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['tax_codes'] = TaxCodeMapper::getAll()
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -122,7 +122,7 @@ final class CliController extends Controller
|
|||
->with('mainAddress')
|
||||
->with('attributes/type')
|
||||
->where('attributes/type/name', ['bill_match_pattern', 'bill_date_format'], 'IN')
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
|
||||
$supplierId = $this->matchSupplier($content, $suppliers);
|
||||
$bill->supplier = new NullSupplier($supplierId);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
0
ICAL.txt → ICLA.txt
Executable file → Normal file
0
ICAL.txt → ICLA.txt
Executable file → Normal file
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Attribute
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Attribute
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Attribute
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Attribute
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Attribute
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -15,7 +15,6 @@ declare(strict_types=1);
|
|||
namespace Modules\Billing\Models;
|
||||
|
||||
use Modules\Billing\Models\Tax\TaxCombination;
|
||||
use Modules\Finance\Models\TaxCode;
|
||||
use Modules\ItemManagement\Models\Container;
|
||||
use Modules\ItemManagement\Models\Item;
|
||||
use Modules\ItemManagement\Models\NullItem;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -20,7 +20,7 @@ use Modules\ItemManagement\Models\ItemMapper;
|
|||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* Billelement mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -18,13 +18,12 @@ use Modules\Admin\Models\AccountMapper;
|
|||
use Modules\Billing\Models\Attribute\BillAttributeMapper;
|
||||
use Modules\ClientManagement\Models\ClientMapper;
|
||||
use Modules\Editor\Models\EditorDocMapper;
|
||||
use Modules\Media\Models\CollectionMapper;
|
||||
use Modules\Media\Models\MediaMapper;
|
||||
use Modules\SupplierManagement\Models\SupplierMapper;
|
||||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* Bill mapper class.
|
||||
*
|
||||
* WARNING: This mapper may use a trigger to update the sequence number on insert.
|
||||
*
|
||||
|
|
@ -142,7 +141,7 @@ class BillMapper extends DataMapperFactory
|
|||
'referral' => [
|
||||
'mapper' => AccountMapper::class,
|
||||
'external' => 'billing_bill_referral',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* Item mapper class.
|
||||
* PaymentTermL11n mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11nType;
|
||||
|
||||
/**
|
||||
* Item mapper class.
|
||||
* PaymentTerm mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -45,4 +45,6 @@ abstract class PermissionCategory extends Enum
|
|||
public const SHIPPING_TERM = 10;
|
||||
|
||||
public const BILL_LOG = 101;
|
||||
|
||||
public const TAX = 201;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Price
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Price
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Price
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Price
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Price
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -20,7 +20,7 @@ use phpOMS\Localization\Defaults\CountryMapper;
|
|||
use phpOMS\Stdlib\Base\FloatInt;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* PurchaseBill mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
@ -53,7 +53,7 @@ final class PurchaseBillMapper extends BillMapper
|
|||
->where('id', $pivot, '<')
|
||||
->where('transferType', BillTransferType::PURCHASE)
|
||||
->limit($limit)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -72,7 +72,7 @@ final class PurchaseBillMapper extends BillMapper
|
|||
->where('id', $pivot, '>')
|
||||
->where('transferType', BillTransferType::PURCHASE)
|
||||
->limit($limit)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -253,7 +253,7 @@ final class PurchaseBillMapper extends BillMapper
|
|||
->groupBy(SupplierMapper::TABLE . '_d1.suppliermgmt_supplier_id');
|
||||
|
||||
$suppliers = SupplierMapper::getAll()->execute($query);
|
||||
$data = SupplierMapper::getRaw()->execute();
|
||||
$data = SupplierMapper::getRaw()->executeGetArray();
|
||||
|
||||
return [$suppliers, $data];
|
||||
}
|
||||
|
|
@ -326,4 +326,161 @@ final class PurchaseBillMapper extends BillMapper
|
|||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -16,11 +16,11 @@ namespace Modules\Billing\Models;
|
|||
|
||||
use Modules\ClientManagement\Models\ClientMapper;
|
||||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
use phpOMS\Localization\Defaults\CountryMapper;
|
||||
use phpOMS\DataStorage\Database\Query\OrderType;
|
||||
use phpOMS\Stdlib\Base\FloatInt;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* SalesBill mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
@ -54,7 +54,7 @@ final class SalesBillMapper extends BillMapper
|
|||
->where('id', $pivot, '<')
|
||||
->where('type/transferType', BillTransferType::SALES)
|
||||
->limit($limit)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -74,7 +74,7 @@ final class SalesBillMapper extends BillMapper
|
|||
->where('id', $pivot, '>')
|
||||
->where('type/transferType', BillTransferType::SALES)
|
||||
->limit($limit)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -257,13 +257,16 @@ final class SalesBillMapper extends BillMapper
|
|||
{
|
||||
$query = new Builder(self::$db);
|
||||
$query->selectAs(ClientMapper::TABLE . '.clientmgmt_client_id', 'client')
|
||||
->selectAs('SUM(' . BillElementMapper::TABLE . '.billing_bill_element_total_netsalesprice)', 'net_sales')
|
||||
->selectAs('SUM(' . BillElementMapper::TABLE . '.billing_bill_element_total_netsalesprice * billing_type_transfer_sign)', 'net_sales')
|
||||
->from(ClientMapper::TABLE)
|
||||
->leftJoin(self::TABLE)
|
||||
->on(ClientMapper::TABLE . '.clientmgmt_client_id', '=', self::TABLE . '.billing_bill_client')
|
||||
->leftJoin(BillElementMapper::TABLE)
|
||||
->on(self::TABLE . '.billing_bill_id', '=', BillElementMapper::TABLE . '.billing_bill_element_bill')
|
||||
->leftJoin(BillTypeMapper::TABLE)
|
||||
->on(self::TABLE . '.billing_bill_type', '=', BillTypeMapper::TABLE . '.billing_type_id')
|
||||
->where(BillElementMapper::TABLE . '.billing_bill_element_item', '=', $id)
|
||||
->andWhere(BillTypeMapper::TABLE . '.billing_type_accounting', '=', true)
|
||||
->andWhere(self::TABLE . '.billing_bill_performance_date', '>=', $start)
|
||||
->andWhere(self::TABLE . '.billing_bill_performance_date', '<=', $end)
|
||||
->orderBy('net_sales', 'DESC')
|
||||
|
|
@ -284,7 +287,7 @@ final class SalesBillMapper extends BillMapper
|
|||
->with('account')
|
||||
->with('mainAddress')
|
||||
->where('id', $clientIds, 'IN')
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
|
||||
return [$clients, $data];
|
||||
|
|
@ -294,28 +297,27 @@ final class SalesBillMapper extends BillMapper
|
|||
* Placeholder
|
||||
* @todo Implement
|
||||
*/
|
||||
public static function getItemBills(int $id, \DateTime $start, \DateTime $end) : array
|
||||
public static function getItemBills(int $id, \DateTime $start, \DateTime $end, int $limit = 10000) : array
|
||||
{
|
||||
$query = self::reader()
|
||||
->with('type')
|
||||
->with('type/l11n')
|
||||
->where('type/l11n/language', 'en')
|
||||
->where('createdAt', $start, '>=')
|
||||
->where('createdAt', $end, '<=')
|
||||
->sort('id', OrderType::DESC)
|
||||
->limit($limit)
|
||||
->getQuery();
|
||||
|
||||
$query->leftJoin(BillElementMapper::TABLE, BillElementMapper::TABLE . '_d1')
|
||||
->on(self::TABLE . '_d1.billing_bill_id', '=', BillElementMapper::TABLE . '_d1.billing_bill_element_bill')
|
||||
->where(BillElementMapper::TABLE . '_d1.billing_bill_element_item', '=', $id);
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
if (!empty(self::CREATED_AT)) {
|
||||
$query->orderBy(self::TABLE . '_d1.' . self::COLUMNS[self::CREATED_AT]['name'], 'DESC');
|
||||
} else {
|
||||
$query->orderBy(self::TABLE . '_d1.' . self::COLUMNS[self::PRIMARYFIELD]['name'], 'DESC');
|
||||
}
|
||||
|
||||
return self::getAll()
|
||||
->with('type')
|
||||
->with('type/l11n')
|
||||
->sort('id', OrderType::DESC)
|
||||
->limit($limit)
|
||||
->execute($query);
|
||||
}
|
||||
|
||||
|
|
@ -332,7 +334,7 @@ final class SalesBillMapper extends BillMapper
|
|||
->where('type/l11n/language', $language)
|
||||
->where('billDate', $start, '>=')
|
||||
->where('billDate', $end, '<=')
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -346,33 +348,50 @@ final class SalesBillMapper extends BillMapper
|
|||
->with('bill/type')
|
||||
->where('bill/client', $client)
|
||||
->where('bill/type/transferStock', true)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Placeholder
|
||||
* @todo Implement
|
||||
*/
|
||||
public static function getItemCountrySales(int $id, \DateTime $start, \DateTime $end, int $limit = 10) : array
|
||||
public static function getItemCountrySales(int $item, \DateTime $start, \DateTime $end, int $limit = 10) : array
|
||||
{
|
||||
$query = new Builder(self::$db);
|
||||
$result = $query->select(CountryMapper::TABLE . '.country_code2')
|
||||
->selectAs('SUM(billing_bill_element_total_netsalesprice)', 'net_sales')
|
||||
->from(self::TABLE)
|
||||
->leftJoin(BillElementMapper::TABLE)
|
||||
->on(self::TABLE . '.billing_bill_id', '=', BillElementMapper::TABLE . '.billing_bill_element_bill')
|
||||
->leftJoin(CountryMapper::TABLE)
|
||||
->on(self::TABLE . '.billing_bill_billCountry', '=', CountryMapper::TABLE . '.country_code2')
|
||||
->where(BillElementMapper::TABLE . '.billing_bill_element_item', '=', $id)
|
||||
->andWhere(self::TABLE . '.billing_bill_performance_date', '>=', $start)
|
||||
->andWhere(self::TABLE . '.billing_bill_performance_date', '<=', $end)
|
||||
->groupBy(CountryMapper::TABLE . '.country_code2')
|
||||
->orderBy('net_sales', 'DESC')
|
||||
->limit($limit)
|
||||
->execute()
|
||||
?->fetchAll(\PDO::FETCH_KEY_PAIR);
|
||||
$sql = <<<SQL
|
||||
SELECT
|
||||
billing_bill_billCountry as country,
|
||||
SUM(billing_bill_element_total_netlistprice * billing_type_transfer_sign) 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
|
||||
WHERE
|
||||
billing_bill_element_item = {$item}
|
||||
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
|
||||
billing_bill_billCountry
|
||||
LIMIT {$limit};
|
||||
SQL;
|
||||
|
||||
return $result ?? [];
|
||||
$query = new Builder(self::$db);
|
||||
$results = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||
|
||||
if ($results === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$hasData = false;
|
||||
foreach ($results as $result) {
|
||||
if ($result !== "0" || $result > 0) {
|
||||
$hasData = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $hasData ? $results : [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -390,24 +409,40 @@ final class SalesBillMapper extends BillMapper
|
|||
$sql = <<<SQL
|
||||
SELECT
|
||||
billing_bill_element_item,
|
||||
SUM(billing_bill_element_total_netsalesprice) as net_sales,
|
||||
SUM(billing_bill_element_total_netpurchaseprice) as net_costs,
|
||||
SUM(billing_bill_element_total_netsalesprice * billing_type_transfer_sign) as net_sales,
|
||||
SUM(billing_bill_element_total_netpurchaseprice * billing_type_transfer_sign) as net_costs,
|
||||
YEAR(billing_bill_performance_date) as year,
|
||||
MONTH(billing_bill_performance_date) as month
|
||||
FROM billing_bill_element
|
||||
JOIN billing_bill ON billing_bill_element.billing_bill_element_bill = billing_bill.billing_bill_id
|
||||
LEFT JOIN billing_type ON billing_bill_type = billing_type_id
|
||||
WHERE
|
||||
billing_bill_element_item IN ({$item})
|
||||
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 billing_bill_element_item, year, month
|
||||
ORDER BY billing_bill_element_item, year ASC, month ASC;
|
||||
SQL;
|
||||
|
||||
$query = new Builder(self::$db);
|
||||
$result = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||
$query = new Builder(self::$db);
|
||||
$results = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
|
||||
|
||||
return $result ?? [];
|
||||
if ($results === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$hasData = false;
|
||||
foreach ($results as $result) {
|
||||
if ($result['net_sales'] !== "0" || $result['net_sales'] > 0
|
||||
|| $result['net_costs'] !== "0" || $result['net_costs'] > 0
|
||||
) {
|
||||
$hasData = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return $hasData ? $results : [];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -452,13 +487,15 @@ final class SalesBillMapper extends BillMapper
|
|||
{
|
||||
$sql = <<<SQL
|
||||
SELECT
|
||||
SUM(billing_bill_netsales) as net_sales,
|
||||
SUM(billing_bill_netcosts) as net_costs,
|
||||
SUM(billing_bill_netsales * billing_type_transfer_sign) as net_sales,
|
||||
SUM(billing_bill_netcosts * billing_type_transfer_sign) 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_client = {$client}
|
||||
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
|
||||
|
|
@ -493,6 +530,55 @@ final class SalesBillMapper extends BillMapper
|
|||
return new FloatInt((int) ($result[0]['net_sales'] ?? 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Placeholder
|
||||
* @todo Implement
|
||||
*/
|
||||
public static function getClientAttributeNetSales(
|
||||
int $client,
|
||||
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) 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_client = {$client}
|
||||
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
|
||||
|
|
@ -551,8 +637,10 @@ final class SalesBillMapper extends BillMapper
|
|||
public static function getClientNetSales(int $client, \DateTime $start, \DateTime $end) : FloatInt
|
||||
{
|
||||
$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
|
||||
LEFT JOIN billing_type
|
||||
ON billing_bill_type = billing_type_id
|
||||
WHERE
|
||||
billing_bill_client = {$client}
|
||||
AND billing_bill_performance_date >= '{$start->format('Y-m-d H:i:s')}'
|
||||
|
|
@ -572,8 +660,10 @@ final class SalesBillMapper extends BillMapper
|
|||
public static function getCLVHistoric(int $client) : FloatInt
|
||||
{
|
||||
$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
|
||||
LEFT JOIN billing_type
|
||||
ON billing_bill_type = billing_type_id
|
||||
WHERE billing_bill_client = {$client};
|
||||
SQL;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -37,4 +37,8 @@ abstract class SettingsEnum extends Enum
|
|||
public const BILLING_CUSTOMER_EMAIL_TEMPLATE = '1005100004'; // Email template for customer 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_TOLERANCE = '1005100102';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* Item mapper class.
|
||||
* ShippingTermL11n mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11nType;
|
||||
|
||||
/**
|
||||
* Item mapper class.
|
||||
* ShippingTerm mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -17,7 +17,7 @@ namespace Modules\Billing\Models;
|
|||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* StockBill mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
@ -50,7 +50,7 @@ final class StockBillMapper extends BillMapper
|
|||
->where('id', $pivot, '<')
|
||||
->where('transferType', BillTransferType::SALES)
|
||||
->limit($limit)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -69,6 +69,6 @@ final class StockBillMapper extends BillMapper
|
|||
->where('id', $pivot, '>')
|
||||
->where('transferType', BillTransferType::SALES)
|
||||
->limit($limit)
|
||||
->execute();
|
||||
->executeGetArray();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -17,7 +17,7 @@ namespace Modules\Billing\Models;
|
|||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* Subscription mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Tax
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Tax
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Tax
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\Models\Tax
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -13,81 +13,92 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['Billing' => [
|
||||
'Address' => 'Adresse',
|
||||
'Addresses' => 'Adressen',
|
||||
'AlreadyPaid' => 'Bereits bezahlt',
|
||||
'Amount' => 'Betrag',
|
||||
'Archive' => 'Archiev',
|
||||
'Internal' => 'Intern',
|
||||
'Error' => 'Fehler',
|
||||
'Billing' => 'Rechnungsstellung',
|
||||
'External' => 'Extern',
|
||||
'Bills' => 'Rechnungen',
|
||||
'Bonus' => 'Bonus',
|
||||
'Cashback' => 'Kennzeichnen',
|
||||
'City' => 'Stadt',
|
||||
'Client' => 'Kunde',
|
||||
'ClientID' => 'Kunden ID',
|
||||
'Confirmation' => 'Bestätigung',
|
||||
'Country' => 'Land',
|
||||
'Created' => 'Erstellt',
|
||||
'CreditCard' => 'Kreditkarte',
|
||||
'CreditNote' => 'Rechnungskorrektur',
|
||||
'Currency' => 'Währung',
|
||||
'Date' => 'Datum',
|
||||
'Delivery' => 'Lieferung',
|
||||
'DeliveryNote' => 'Lieferschein',
|
||||
'DirectDebit' => 'Direktüberweisung.',
|
||||
'Discount' => 'Rabatt',
|
||||
'DiscountP' => 'Rabatt %',
|
||||
'Due' => 'Fällig',
|
||||
'Email' => 'Email',
|
||||
'Freightage' => 'Fracht',
|
||||
'Gross' => 'Brutto',
|
||||
'Invoice' => 'Rechnung',
|
||||
'Item' => 'Artikel',
|
||||
'Items' => 'Produkte',
|
||||
'Language' => 'Sprache',
|
||||
'Log' => 'Protokoll',
|
||||
'Logs' => 'Protokolle',
|
||||
'Media' => 'Medien',
|
||||
'MoneyTransfer' => 'Überweisung',
|
||||
'Name' => 'Name',
|
||||
'Net' => 'Netz',
|
||||
'Parse' => 'Rechnungserkennung',
|
||||
'Offer' => 'Angebot',
|
||||
'Original' => 'Original',
|
||||
'Payment' => 'Zahlung',
|
||||
'PaymentPlan' => 'Zahlungsplan',
|
||||
'Postal' => 'Post',
|
||||
'Prepaid' => 'Vorausbezahlt',
|
||||
'Preview' => 'Vorschau',
|
||||
'Price' => 'Preis',
|
||||
'Profit' => 'Gewinn',
|
||||
'Quantity' => 'Menge',
|
||||
'Recipient' => 'Empfänger',
|
||||
'Select' => 'Wählen',
|
||||
'Shipment' => 'Sendung',
|
||||
'Source' => 'Quelle',
|
||||
'Supplier' => 'Anbieter',
|
||||
'SupplierID' => 'Lieferanten ID',
|
||||
'Tax' => 'Steuer',
|
||||
'TaxP' => 'Steuer %',
|
||||
'Margin' => 'Marge',
|
||||
'TermsOfDelivery' => 'Lieferbedingungen',
|
||||
'Total' => 'Gesamt',
|
||||
'Type' => 'Typ',
|
||||
'Types' => 'Typen',
|
||||
'Upload' => 'Hochladen',
|
||||
'Zip' => 'Zip',
|
||||
'Files' => 'Files',
|
||||
'PaymentTerms' => 'Zahlungsbedingungen',
|
||||
'ShippingTerms' => 'Lieferbedingungen',
|
||||
'PaymentTerm' => 'Zahlungsbedingung',
|
||||
'ShippingTerm' => 'Lieferbedingung',
|
||||
'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_net' => 'Der Gesamtnettobetrag stimmt nicht mit dem Nettobetrag der Elemente überein. Mögliches Problem mit Steuersätzen oder zusätzlichen Positionen.',
|
||||
'E_bill_gross' => 'Der Gesamtbruttobetrag stimmt nicht mit dem Bruttobetrag der Elemente überein. Mögliches Problem mit Steuersätzen oder zusätzlichen Positionen.',
|
||||
'E_bill_unit' => 'Stückpreis stimmt nicht mit Gesamtpreis überein. Mögliche Probleme mit Preis, Menge oder Rabatten.',
|
||||
'Address' => 'Adresse',
|
||||
'Addresses' => 'Adressen',
|
||||
'AlreadyPaid' => 'Bereits bezahlt',
|
||||
'Amount' => 'Betrag',
|
||||
'Archive' => 'Archiev',
|
||||
'Internal' => 'Intern',
|
||||
'Error' => 'Fehler',
|
||||
'Billing' => 'Rechnungsstellung',
|
||||
'External' => 'Extern',
|
||||
'Bills' => 'Rechnungen',
|
||||
'Bonus' => 'Bonus',
|
||||
'Cashback' => 'Kennzeichnen',
|
||||
'City' => 'Stadt',
|
||||
'Client' => 'Kunde',
|
||||
'ClientID' => 'Kunden ID',
|
||||
'Confirmation' => 'Bestätigung',
|
||||
'Country' => 'Land',
|
||||
'Created' => 'Erstellt',
|
||||
'CreditCard' => 'Kreditkarte',
|
||||
'CreditNote' => 'Rechnungskorrektur',
|
||||
'Currency' => 'Währung',
|
||||
'Date' => 'Datum',
|
||||
'Delivery' => 'Lieferung',
|
||||
'DeliveryNote' => 'Lieferschein',
|
||||
'DirectDebit' => 'Direktüberweisung.',
|
||||
'Discount' => 'Rabatt',
|
||||
'DiscountP' => 'Rabatt %',
|
||||
'Due' => 'Fällig',
|
||||
'Email' => 'Email',
|
||||
'Freightage' => 'Fracht',
|
||||
'Gross' => 'Brutto',
|
||||
'Invoice' => 'Rechnung',
|
||||
'Item' => 'Artikel',
|
||||
'Items' => 'Produkte',
|
||||
'Language' => 'Sprache',
|
||||
'Log' => 'Protokoll',
|
||||
'Logs' => 'Protokolle',
|
||||
'Media' => 'Medien',
|
||||
'MoneyTransfer' => 'Überweisung',
|
||||
'Name' => 'Name',
|
||||
'Net' => 'Netz',
|
||||
'Parse' => 'Rechnungserkennung',
|
||||
'Offer' => 'Angebot',
|
||||
'Original' => 'Original',
|
||||
'Payment' => 'Zahlung',
|
||||
'PaymentPlan' => 'Zahlungsplan',
|
||||
'Postal' => 'Post',
|
||||
'Prepaid' => 'Vorausbezahlt',
|
||||
'Preview' => 'Vorschau',
|
||||
'Price' => 'Preis',
|
||||
'Profit' => 'Gewinn',
|
||||
'Quantity' => 'Menge',
|
||||
'Recipient' => 'Empfänger',
|
||||
'Select' => 'Wählen',
|
||||
'Shipment' => 'Sendung',
|
||||
'Source' => 'Quelle',
|
||||
'Supplier' => 'Anbieter',
|
||||
'SupplierID' => 'Lieferanten ID',
|
||||
'Tax' => 'Steuer',
|
||||
'TaxP' => 'Steuer %',
|
||||
'Margin' => 'Marge',
|
||||
'TermsOfDelivery' => 'Lieferbedingungen',
|
||||
'Total' => 'Gesamt',
|
||||
'Type' => 'Typ',
|
||||
'Types' => 'Typen',
|
||||
'Upload' => 'Hochladen',
|
||||
'Zip' => 'Zip',
|
||||
'Files' => 'Files',
|
||||
'TaxCode' => 'Steuerkz.',
|
||||
'PL' => 'GuV',
|
||||
':combinationtype-1' => 'Verkauf',
|
||||
':combinationtype-2' => 'Einkauf',
|
||||
'PLAccount' => 'GuV-Konto',
|
||||
'Tax1Account' => 'Steuerkonto 1',
|
||||
'Tax2Account' => 'Steuerkonto 2',
|
||||
'TaxCombinations' => 'Steuerkomb.',
|
||||
'PaymentTerms' => 'Zahlungsbedingungen',
|
||||
'ShippingTerms' => 'Lieferbedingungen',
|
||||
'PaymentTerm' => 'Zahlungsbedingung',
|
||||
'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_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_gross' => 'Der Gesamtbruttobetrag stimmt nicht mit dem Bruttobetrag der Elemente überein. Mögliches Problem mit Steuersätzen oder zusätzlichen Positionen.',
|
||||
'E_bill_unit' => 'Stückpreis stimmt nicht mit Gesamtpreis überein. Mögliche Probleme mit Preis, Menge oder Rabatten.',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -13,81 +13,92 @@
|
|||
declare(strict_types=1);
|
||||
|
||||
return ['Billing' => [
|
||||
'Address' => 'Address',
|
||||
'Addresses' => 'Addresses',
|
||||
'AlreadyPaid' => 'Already Paid',
|
||||
'Amount' => 'Amount',
|
||||
'Archive' => 'Archive',
|
||||
'Internal' => 'Internal',
|
||||
'Error' => 'Error',
|
||||
'Billing' => 'Billing',
|
||||
'External' => 'External',
|
||||
'Bills' => 'Bills',
|
||||
'Bonus' => 'Bonus',
|
||||
'Cashback' => 'Cash Back',
|
||||
'City' => 'City',
|
||||
'Client' => 'Client',
|
||||
'ClientID' => 'Client ID',
|
||||
'Confirmation' => 'Confirmation',
|
||||
'Country' => 'Country',
|
||||
'Created' => 'Created',
|
||||
'CreditCard' => 'CreditCard',
|
||||
'CreditNote' => 'Credit Note',
|
||||
'Currency' => 'Currency',
|
||||
'Date' => 'Date',
|
||||
'Delivery' => 'Delivery',
|
||||
'DeliveryNote' => 'Delivery Note',
|
||||
'DirectDebit' => 'DirectDebit',
|
||||
'Discount' => 'Discount',
|
||||
'DiscountP' => 'Discount %',
|
||||
'Due' => 'Due',
|
||||
'Email' => 'Email',
|
||||
'Freightage' => 'Freightage',
|
||||
'Gross' => 'Gross',
|
||||
'Invoice' => 'Invoice',
|
||||
'Item' => 'Item',
|
||||
'Items' => 'Items',
|
||||
'Language' => 'Language',
|
||||
'Log' => 'Log',
|
||||
'Logs' => 'Logs',
|
||||
'Media' => 'Media',
|
||||
'MoneyTransfer' => 'Money Transfer',
|
||||
'Name' => 'Name',
|
||||
'Net' => 'Net',
|
||||
'Parse' => 'Invoice recognition',
|
||||
'Offer' => 'Offer',
|
||||
'Original' => 'Original',
|
||||
'Payment' => 'Payment',
|
||||
'PaymentPlan' => 'Payment Plan',
|
||||
'Postal' => 'Postal',
|
||||
'Prepaid' => 'Prepaid',
|
||||
'Preview' => 'Preview',
|
||||
'Price' => 'Price',
|
||||
'Profit' => 'Profit',
|
||||
'Quantity' => 'Quantity',
|
||||
'Recipient' => 'Recipient',
|
||||
'Select' => 'Select',
|
||||
'Shipment' => 'Shipment',
|
||||
'Source' => 'Source',
|
||||
'Supplier' => 'Supplier',
|
||||
'SupplierID' => 'Supplier ID',
|
||||
'Tax' => 'Tax',
|
||||
'TaxP' => 'Tax %',
|
||||
'Margin' => 'Margin',
|
||||
'TermsOfDelivery' => 'Terms Of Delivery',
|
||||
'Total' => 'Total',
|
||||
'Type' => 'Type',
|
||||
'Types' => 'Types',
|
||||
'Upload' => 'Upload',
|
||||
'Zip' => 'Zip',
|
||||
'Files' => 'Files',
|
||||
'PaymentTerms' => 'Payment Terms',
|
||||
'ShippingTerms' => 'Shipping Terms',
|
||||
'PaymentTerm' => 'Payment Term',
|
||||
'ShippingTerm' => 'Shipping Term',
|
||||
'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_net' => 'The total net amount doesn\'t match the net amount of the elements. Potential issue with tax rates or additional items.',
|
||||
'E_bill_gross' => 'The total gross amount doesn\'t match the gross amount of the elements. Potential issue with tax rates or additional items.',
|
||||
'E_bill_unit' => 'Unit price doesn\'t match total price. Potential issues with price, quantity or discounts.',
|
||||
'Address' => 'Address',
|
||||
'Addresses' => 'Addresses',
|
||||
'AlreadyPaid' => 'Already Paid',
|
||||
'Amount' => 'Amount',
|
||||
'Archive' => 'Archive',
|
||||
'Internal' => 'Internal',
|
||||
'Error' => 'Error',
|
||||
'Billing' => 'Billing',
|
||||
'External' => 'External',
|
||||
'Bills' => 'Bills',
|
||||
'Bonus' => 'Bonus',
|
||||
'Cashback' => 'Cash Back',
|
||||
'City' => 'City',
|
||||
'Client' => 'Client',
|
||||
'ClientID' => 'Client ID',
|
||||
'Confirmation' => 'Confirmation',
|
||||
'Country' => 'Country',
|
||||
'Created' => 'Created',
|
||||
'CreditCard' => 'CreditCard',
|
||||
'CreditNote' => 'Credit Note',
|
||||
'Currency' => 'Currency',
|
||||
'Date' => 'Date',
|
||||
'Delivery' => 'Delivery',
|
||||
'DeliveryNote' => 'Delivery Note',
|
||||
'DirectDebit' => 'DirectDebit',
|
||||
'Discount' => 'Discount',
|
||||
'DiscountP' => 'Discount %',
|
||||
'Due' => 'Due',
|
||||
'Email' => 'Email',
|
||||
'Freightage' => 'Freightage',
|
||||
'Gross' => 'Gross',
|
||||
'Invoice' => 'Invoice',
|
||||
'Item' => 'Item',
|
||||
'Items' => 'Items',
|
||||
'Language' => 'Language',
|
||||
'Log' => 'Log',
|
||||
'Logs' => 'Logs',
|
||||
'Media' => 'Media',
|
||||
'MoneyTransfer' => 'Money Transfer',
|
||||
'Name' => 'Name',
|
||||
'Net' => 'Net',
|
||||
'Parse' => 'Invoice recognition',
|
||||
'Offer' => 'Offer',
|
||||
'Original' => 'Original',
|
||||
'Payment' => 'Payment',
|
||||
'PaymentPlan' => 'Payment Plan',
|
||||
'Postal' => 'Postal',
|
||||
'Prepaid' => 'Prepaid',
|
||||
'Preview' => 'Preview',
|
||||
'Price' => 'Price',
|
||||
'Profit' => 'Profit',
|
||||
'Quantity' => 'Quantity',
|
||||
'Recipient' => 'Recipient',
|
||||
'Select' => 'Select',
|
||||
'Shipment' => 'Shipment',
|
||||
'Source' => 'Source',
|
||||
'Supplier' => 'Supplier',
|
||||
'SupplierID' => 'Supplier ID',
|
||||
'Tax' => 'Tax',
|
||||
'TaxP' => 'Tax %',
|
||||
'Margin' => 'Margin',
|
||||
'TermsOfDelivery' => 'Terms Of Delivery',
|
||||
'Total' => 'Total',
|
||||
'Type' => 'Type',
|
||||
'Types' => 'Types',
|
||||
'Upload' => 'Upload',
|
||||
'Zip' => 'Zip',
|
||||
'Files' => 'Files',
|
||||
'TaxCode' => 'Tax Code',
|
||||
'PL' => 'PL',
|
||||
':combinationtype-1' => 'Sales',
|
||||
':combinationtype-2' => 'Purchase',
|
||||
'PLAccount' => 'PL Account',
|
||||
'Tax1Account' => 'Tax Account 1',
|
||||
'Tax2Account' => 'Tax Account 2',
|
||||
'TaxCombinations' => 'Tax Combinations',
|
||||
'PaymentTerms' => 'Payment Terms',
|
||||
'ShippingTerms' => 'Shipping Terms',
|
||||
'PaymentTerm' => 'Payment 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_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_gross' => 'The total gross amount doesn\'t match the gross amount of the elements. Potential issue with tax rates or additional items.',
|
||||
'E_bill_unit' => 'Unit price doesn\'t match total price. Potential issues with price, quantity or discounts.',
|
||||
]];
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -354,7 +354,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<button type="button" formaction="">
|
||||
<i class="g-icon">book</i>
|
||||
</button><input name="item_number" autocomplete="off" type="text" value="<?= $element->itemNumber; ?>"<?= $disabled; ?>></span>
|
||||
<td><textarea name="item_description" autocomplete="off"<?= $disabled; ?>><?= $element->itemName; ?></textarea>
|
||||
<td><textarea name="item_description" autocomplete="off"<?= $disabled; ?>><?= $this->printTextarea($element->itemName); ?></textarea>
|
||||
<td><input name="item_quantity" autocomplete="off" type="number" step="any" value="<?= $element->quantity->sub($element->discountQ)->getAmount($element->container->quantityDecimals); ?>"<?= $disabled; ?>>
|
||||
<td><input name="item_discountp" autocomplete="off" type="number" step="any" value="<?= $element->singleDiscountP->getAmount(); ?>"<?= $disabled; ?>>
|
||||
<td><input name="item_discountr" autocomplete="off" type="number" step="any" value="<?= $element->singleDiscountR->getAmount(); ?>"<?= $disabled; ?>>
|
||||
|
|
@ -422,7 +422,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="col-xs-12 col-simple">
|
||||
<section id="mediaFile" class="portlet col-simple">
|
||||
<div class="portlet-body col-simple">
|
||||
<iframe class="col-simple" id="iPreviewBill" data-src="Resources/mozilla/Pdf/web/viewer.html?file=<?= \urlencode(UriFactory::build('{/api}bill/render/preview?bill=' . $bill->id) . '&bill_type='); ?>{#iBillPreviewType}" loading="lazy" allowfullscreen></iframe>
|
||||
<iframe class="col-simple" id="iPreviewBill" data-src="Resources/mozilla/Pdf/web/viewer.html?file=<?= \urlencode(UriFactory::build('{/api}bill/render/preview?bill=' . $bill->id . '&csrf={$CSRF}') . '&bill_type='); ?>{#iBillPreviewType}" loading="lazy" allowfullscreen></iframe>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
@ -436,7 +436,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="col-xs-12 col-simple">
|
||||
<section id="mediaFile" class="portlet col-simple">
|
||||
<div class="portlet-body col-simple">
|
||||
<iframe class="col-simple" id="iBillArchive" src="Resources/mozilla/Pdf/web/viewer.html?file=<?= \urlencode(UriFactory::build('{/api}bill/render?id=' . $archive->id)); ?>" loading="lazy" allowfullscreen></iframe>
|
||||
<iframe class="col-simple" id="iBillArchive" src="Resources/mozilla/Pdf/web/viewer.html?file=<?= \urlencode(UriFactory::build('{/api}bill/render?id=' . $archive->id . '&csrf={$CSRF}')); ?>" loading="lazy" allowfullscreen></iframe>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
@ -555,7 +555,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Logs'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<table class="default sticky">
|
||||
<thead>
|
||||
|
|
@ -585,7 +585,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<td><a href="<?= $url; ?>"><?= $audit->createdAt->format('Y-m-d H:i'); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
73
Theme/Backend/finance-taxcombination-list.tpl.php
Normal file
73
Theme/Backend/finance-taxcombination-list.tpl.php
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Accounting
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
/**
|
||||
* @var \phpOMS\Views\View $this
|
||||
* @var \Modules\Tag\Models\CostCenter[] $taxcombination
|
||||
*/
|
||||
$taxcombination = $this->data['taxcombination'];
|
||||
|
||||
$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?{?}&offset=' . \end($taxcombination)->id . '&ptype=n';
|
||||
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('TaxCombinations'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<table class="default sticky">
|
||||
<thead>
|
||||
<tr>
|
||||
<td><?= $this->getHtml('ID', '0', '0'); ?>
|
||||
<td><?= $this->getHtml('Client'); ?>
|
||||
<td><?= $this->getHtml('Supplier'); ?>
|
||||
<td class="wf-100"><?= $this->getHtml('Item'); ?>
|
||||
<td><?= $this->getHtml('TaxCode'); ?>
|
||||
<td><?= $this->getHtml('Tax'); ?>
|
||||
<td><?= $this->getHtml('PL'); ?>
|
||||
<tbody>
|
||||
<?php $count = 0;
|
||||
foreach ($taxcombination as $key => $value) : ++$count;
|
||||
$url = UriFactory::build('{/base}/finance/tax/combination/view?{?}&id=' . $value->id); ?>
|
||||
<tr tabindex="0" data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?= $value->id; ?></a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?= $this->printHtml($value->clientCode->getValue()); ?></a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?= $this->printHtml($value->supplierCode->getValue()); ?></a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?= $this->printHtml($value->itemCode->getValue()); ?></a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?= $this->printHtml($value->taxCode->abbr); ?></a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?= $value->taxCode->percentageInvoice / 10000; ?> %</a>
|
||||
<td><a href="<?= $url; ?>">
|
||||
<?= $this->printHtml($value->account); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="7" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
<!--
|
||||
<div class="portlet-foot">
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build($previous); ?>"><?= $this->getHtml('Previous', '0', '0'); ?></a>
|
||||
<a tabindex="0" class="button" href="<?= UriFactory::build($next); ?>"><?= $this->getHtml('Next', '0', '0'); ?></a>
|
||||
</div>
|
||||
-->
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
146
Theme/Backend/finance-taxcombination-view.tpl.php
Normal file
146
Theme/Backend/finance-taxcombination-view.tpl.php
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Accounting
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\Billing\Models\Tax\BillTaxType;
|
||||
use Modules\Billing\Models\Tax\NullTaxCombination;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$taxcombination = $this->data['taxcombination'] ?? new NullTaxCombination();
|
||||
$isNew = $taxcombination->id === 0;
|
||||
|
||||
$combinationType = BillTaxType::getConstants();
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<form method="<?= $isNew ? 'PUT' : 'POST'; ?>" action="<?= UriFactory::build('{/api}finance/tax/combination?csrf={$CSRF}'); ?>">
|
||||
<div class="portlet-head"><?= $this->getHtml('TaxCode'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||
<input type="text" name="id" id="iId" value="<?= $taxcombination->id; ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iType"><?= $this->getHtml('Type'); ?></label>
|
||||
<select id="iType" name="type"
|
||||
data-action='[
|
||||
{"key": 1, "listener": "change", "action": [
|
||||
{"key": 1, "type": "dom.get", "base": "", "selector": "#iType"},
|
||||
{"key": 2, "type": "if", "conditions": [
|
||||
{
|
||||
"comp": "==",
|
||||
"value": "1",
|
||||
"jump": 3
|
||||
},
|
||||
{
|
||||
"comp": "==",
|
||||
"value": "2",
|
||||
"jump": 8
|
||||
}
|
||||
]},
|
||||
{"key": 3, "type": "dom.attr.change", "subtype": "add", "attr": "class", "value": "vh", "base": "", "selector": "#iSupplierGroup"},
|
||||
{"key": 4, "type": "dom.attr.change", "subtype": "add", "attr": "class", "value": "vh", "base": "", "selector": "#iItemPurchaseGroup"},
|
||||
{"key": 5, "type": "dom.attr.change", "subtype": "remove", "attr": "class", "value": "vh", "base": "", "selector": "#iItemSalesGroup"},
|
||||
{"key": 6, "type": "dom.attr.change", "subtype": "remove", "attr": "class", "value": "vh", "base": "", "selector": "#iClientGroup"},
|
||||
{"key": 7, "type": "jump", "jump": 12},
|
||||
{"key": 8, "type": "dom.attr.change", "subtype": "add", "attr": "class", "value": "vh", "base": "", "selector": "#iClientGroup"},
|
||||
{"key": 9, "type": "dom.attr.change", "subtype": "add", "attr": "class", "value": "vh", "base": "", "selector": "#iItemSalesGroup"},
|
||||
{"key": 10, "type": "dom.attr.change", "subtype": "remove", "attr": "class", "value": "vh", "base": "", "selector": "#iItemPurchaseGroup"},
|
||||
{"key": 11, "type": "dom.attr.change", "subtype": "remove", "attr": "class", "value": "vh", "base": "", "selector": "#iSupplierGroup"}
|
||||
]}
|
||||
]'>
|
||||
<?php foreach ($combinationType as $type) : ?>
|
||||
<option value="<?= $type; ?>"<?= $taxcombination->taxType === $type ? ' selected': ''; ?>><?= $this->getHtml(':combinationtype-' . $type); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="iClientGroup" class="form-group<?= $taxcombination->taxType === BillTaxType::PURCHASE ? ' vh' : ''; ?>">
|
||||
<label for="iClient"><?= $this->getHtml('Client'); ?></label>
|
||||
<select id="iClient" name="account_code">
|
||||
<option value=""<?= $taxcombination->clientCode === null ? ' selected' : ''; ?>>
|
||||
<?php foreach ($this->data['client_codes']->defaults as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->clientCode?->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->getValue()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="iItemSalesGroup" class="form-group<?= $taxcombination->taxType === BillTaxType::PURCHASE ? ' vh' : ''; ?>">
|
||||
<label for="iItemSales"><?= $this->getHtml('Item'); ?></label>
|
||||
<select id="iItemSales" name="item_code">
|
||||
<option value=""<?= $taxcombination->itemCode === null ? ' selected' : ''; ?>>
|
||||
<?php foreach ($this->data['item_codes_sales']->defaults as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->itemCode?->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->getValue()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="iSupplierGroup" class="form-group<?= $taxcombination->taxType === BillTaxType::SALES ? ' vh' : ''; ?>">
|
||||
<label for="iSupplier"><?= $this->getHtml('Supplier'); ?></label>
|
||||
<select id="iSupplier" name="account_code">
|
||||
<option value=""<?= $taxcombination->supplierCode === null ? ' selected' : ''; ?>>
|
||||
<?php foreach ($this->data['supplier_codes']->defaults as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->supplierCode?->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->getValue()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="iItemPurchaseGroup" class="form-group<?= $taxcombination->taxType === BillTaxType::SALES ? ' vh' : ''; ?>">
|
||||
<label for="iItemPurchase"><?= $this->getHtml('Item'); ?></label>
|
||||
<select id="iItemPurchase" name="item_code">
|
||||
<option value=""<?= $taxcombination->itemCode === null ? ' selected' : ''; ?>>
|
||||
<?php foreach ($this->data['item_codes_purchase']->defaults as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->itemCode->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->getValue()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iTaxCode"><?= $this->getHtml('TaxCode'); ?></label>
|
||||
<select id="iTaxCode" name="tax_code">
|
||||
<?php foreach ($this->data['tax_codes'] as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->taxCode->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->abbr); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iPLAccount"><?= $this->getHtml('PLAccount'); ?></label>
|
||||
<input type="text" name="account" id="iPLAccount" value="<?= $this->printHtml($taxcombination->taxAccount1); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iTax1Account"><?= $this->getHtml('Tax1Account'); ?></label>
|
||||
<input type="text" name="tax1" id="iTax1Account" value="<?= $this->printHtml($taxcombination->taxAccount1); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iTax2Account"><?= $this->getHtml('Tax2Account'); ?></label>
|
||||
<input type="text" name="tax2" id="iTax2Account" value="<?= $this->printHtml($taxcombination->taxAccount2); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php if ($isNew) : ?>
|
||||
<input id="iCreateSubmit" type="Submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||
<?php else : ?>
|
||||
<input id="iSaveSubmit" type="Submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\ItemManagement
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -21,8 +21,8 @@ $type = $this->data['type'];
|
|||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="portlet">
|
||||
<form id="paymentForm" method="POST" action="<?= UriFactory::build('{/api}bill/payment'); ?>"
|
||||
<section class="portlet">
|
||||
<form id="paymentForm" method="POST" action="<?= UriFactory::build('{/api}bill/payment?csrf={$CSRF}'); ?>"
|
||||
data-ui-container="#paymentTable tbody"
|
||||
data-add-form="paymentForm"
|
||||
data-add-tpl="#paymentTable tbody .oms-add-tpl-payment">
|
||||
|
|
@ -30,7 +30,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iName"><?= $this->getHtml('Name'); ?></label>
|
||||
<input type="text" name="code" id="iName" placeholder="" value="<?= $this->printHtml($type->title); ?>">
|
||||
<input type="text" name="code" id="iName" value="<?= $this->printHtml($type->title); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<?= $this->data['l11nView']->render(
|
||||
$this->data['l11nValues'],
|
||||
[],
|
||||
'{/api}bill/payment/l11n'
|
||||
'{/api}bill/payment/l11n?csrf={$CSRF}'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -20,7 +20,7 @@ echo $this->data['nav']->render(); ?>
|
|||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<section 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">
|
||||
|
|
@ -166,7 +166,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<?php $count = 0;
|
||||
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);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
|
||||
|
|
@ -191,6 +191,6 @@ echo $this->data['nav']->render(); ?>
|
|||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
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>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -352,7 +352,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<button type="button" formaction="">
|
||||
<i class="g-icon">book</i>
|
||||
</button><input name="item_number" autocomplete="off" type="text" value="<?= $element->itemNumber; ?>"<?= $disabled; ?>></span>
|
||||
<td><textarea name="item_description" autocomplete="off"<?= $disabled; ?>><?= $element->itemName; ?></textarea>
|
||||
<td><textarea name="item_description" autocomplete="off"<?= $disabled; ?>><?= $this->printTextarea($element->itemName); ?></textarea>
|
||||
<td><input name="item_quantity" autocomplete="off" type="number" step="any" value="<?= $element->quantity->sub($element->discountQ)->getAmount($element->container->quantityDecimals); ?>"<?= $disabled; ?>>
|
||||
<td><input name="item_discountp" autocomplete="off" type="number" step="any" value="<?= $element->singleDiscountP->getAmount(); ?>"<?= $disabled; ?>>
|
||||
<td><input name="item_discountr" autocomplete="off" type="number" step="any" value="<?= $element->singleDiscountR->getAmount(); ?>"<?= $disabled; ?>>
|
||||
|
|
@ -421,7 +421,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="col-xs-12 col-simple">
|
||||
<section id="mediaFile" class="portlet col-simple">
|
||||
<div class="portlet-body col-simple">
|
||||
<iframe class="col-simple" id="iPreviewBill" data-src="Resources/mozilla/Pdf/web/viewer.html?file=<?= \urlencode(UriFactory::build('{/api}bill/render/preview?bill=' . $bill->id) . '&bill_type='); ?>{#iBillPreviewType}" loading="lazy" allowfullscreen></iframe>
|
||||
<iframe class="col-simple" id="iPreviewBill" data-src="Resources/mozilla/Pdf/web/viewer.html?file=<?= \urlencode(UriFactory::build('{/api}bill/render/preview?bill=' . $bill->id . '&csrf={$CSRF}') . '&bill_type='); ?>{#iBillPreviewType}" loading="lazy" allowfullscreen></iframe>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
|
@ -438,7 +438,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div>
|
||||
<div class="col-xs-12 col-sm-3 box">
|
||||
<form id="iInvoiceRecognition"
|
||||
action="<?= UriFactory::build('{/api}bill/parse?id=' . $bill->id . '&async=0'); ?>"
|
||||
action="<?= UriFactory::build('{/api}bill/parse?id=' . $bill->id . '&async=0&csrf={$CSRF}'); ?>"
|
||||
method="post"
|
||||
data-redirect="<?= UriFactory::build('{%}'); ?>">
|
||||
<input type="submit" value="<?= $this->getHtml('Parse'); ?>">
|
||||
|
|
@ -453,7 +453,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="portlet-body col-simple">
|
||||
<iframe id="iBillArchive"
|
||||
class="col-simple"
|
||||
src="<?= UriFactory::build('{/api}media/export') . '?id=' . $archive->id; ?>"
|
||||
src="<?= UriFactory::build('{/api}media/export?csrf={$CSRF}') . '&id=' . $archive->id; ?>"
|
||||
loading="lazy" allowfullscreen></iframe>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -573,7 +573,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="tab">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<section class="portlet">
|
||||
<div class="portlet-head"><?= $this->getHtml('Logs'); ?><i class="g-icon download btn end-xs">download</i></div>
|
||||
<table class="default sticky">
|
||||
<thead>
|
||||
|
|
@ -603,7 +603,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<td><a href="<?= $url; ?>"><?= $audit->createdAt->format('Y-m-d H:i'); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -20,7 +20,7 @@ echo $this->data['nav']->render(); ?>
|
|||
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="portlet">
|
||||
<section 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">
|
||||
|
|
@ -165,7 +165,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<tbody>
|
||||
<?php $count = 0; foreach ($bills as $key => $value) :
|
||||
++$count;
|
||||
$url = UriFactory::build('{/base}/sales/bill?{?}&id=' . $value->id);
|
||||
$url = UriFactory::build('{/base}/sales/bill/view?{?}&id=' . $value->id);
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
|
||||
|
|
@ -190,6 +190,6 @@ echo $this->data['nav']->render(); ?>
|
|||
<?php endif; ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\ItemManagement
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -21,8 +21,8 @@ $type = $this->data['type'];
|
|||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="portlet">
|
||||
<form id="shippingForm" method="POST" action="<?= UriFactory::build('{/api}bill/shipping'); ?>"
|
||||
<section class="portlet">
|
||||
<form id="shippingForm" method="POST" action="<?= UriFactory::build('{/api}bill/shipping?csrf={$CSRF}'); ?>"
|
||||
data-ui-container="#shippingTable tbody"
|
||||
data-add-form="shippingForm"
|
||||
data-add-tpl="#shippingTable tbody .oms-add-tpl-shipping">
|
||||
|
|
@ -30,7 +30,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iName"><?= $this->getHtml('Name'); ?></label>
|
||||
<input type="text" name="code" id="iName" placeholder="" value="<?= $this->printHtml($type->title); ?>">
|
||||
<input type="text" name="code" id="iName" value="<?= $this->printHtml($type->title); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<input id="iSubmit" name="submit" type="submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ echo $this->data['nav']->render(); ?>
|
|||
<?= $this->data['l11nView']->render(
|
||||
$this->data['l11nValues'],
|
||||
[],
|
||||
'{/api}bill/shipping/l11n'
|
||||
'{/api}bill/shipping/l11n?csrf={$CSRF}'
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
|
|
@ -1,202 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
*
|
||||
* @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>
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Localization
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules/tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Billing\tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
@ -116,7 +116,7 @@ final class BillTest extends \PHPUnit\Framework\TestCase
|
|||
'billCity' => 'City',
|
||||
'billZip' => 'Zip',
|
||||
'billCountry' => 'Country',
|
||||
'external' => '',
|
||||
'external' => '',
|
||||
],
|
||||
$this->bill->jsonSerialize()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.1
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package tests
|
||||
* @copyright Dennis Eichhorn
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user