template fixes + bug fixes + style fixes

This commit is contained in:
Dennis Eichhorn 2024-04-02 21:40:47 +00:00
parent 4ebb4bc285
commit d194aade27
21 changed files with 600 additions and 486 deletions

View File

@ -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": {

View File

@ -66,4 +66,16 @@ return [
],
],
],
'^.*/purchase/recognition/upload(\?.*$|$)' => [
[
'dest' => '\Modules\Billing\Controller\ApiPurchaseController:apiPurchaseBillUpload',
'verb' => RouteVerb::SET,
'csrf' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::PURCHASE_INVOICE,
],
],
],
];

View File

@ -51,7 +51,7 @@ return [
],
],
],
'^/sales/bill(\?.*$|$)' => [
'^/sales/bill/view(\?.*$|$)' => [
[
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoice',
'verb' => RouteVerb::GET,
@ -113,7 +113,7 @@ return [
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::SALES_INVOICE,
],
],
@ -181,7 +181,7 @@ return [
'verb' => RouteVerb::GET,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::PRIVATE_BILL_UPLOAD,
],
],

View File

@ -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;
}

View File

@ -358,7 +358,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;

View File

@ -23,12 +23,9 @@ 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 phpOMS\Account\PermissionType;
use phpOMS\Contract\RenderableInterface;
@ -67,7 +64,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()
$mapperQuery = BillMapper::getAll()
->with('type')
->with('type/l11n')
->with('client')
@ -76,23 +73,19 @@ final class BackendController extends Controller
->where('type/l11n/language', $response->header->l11n->language)
->sort('id', OrderType::DESC)
->where('unit', $this->app->unitId)
->where('client', null, '!=')
->limit(25);
if ($request->getData('ptype') === 'p') {
$view->data['bills'] = $mapperQuery
->where('id', $request->getDataInt('id') ?? 0, '<')
->where('client', null, '!=')
->execute();
$mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '<');
} elseif ($request->getData('ptype') === 'n') {
$view->data['bills'] = $mapperQuery->where('id', $request->getDataInt('id') ?? 0, '>')
->where('client', null, '!=')
->execute();
$mapperQuery->where('id', $request->getDataInt('offset') ?? 0, '>');
} else {
$view->data['bills'] = $mapperQuery->where('id', 0, '>')
->where('client', null, '!=')
->execute();
$mapperQuery->where('id', 0, '>');
}
$view->data['bills'] = $mapperQuery->execute();
return $view;
}
@ -114,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')
@ -123,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;
}
@ -162,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')
@ -179,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;
@ -198,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 */
@ -207,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);
}
@ -242,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;
@ -267,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;
}
@ -288,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;
}
@ -311,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;
}
@ -359,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')
@ -374,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(
@ -391,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 */
@ -400,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);
}
@ -428,14 +480,14 @@ 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();
$view->data['bills'] = BillMapper::getAll()->where('id', $request->getDataInt('offset') ?? 0, '<')->where('unit', $this->app->unitId)->limit(25)->executeGetArray();
} elseif ($request->getData('ptype') === 'n') {
$view->data['bills'] = StockBillMapper::getAll()->where('id', $request->getDataInt('id') ?? 0, '>')->where('unit', $this->app->unitId)->limit(25)->execute();
$view->data['bills'] = BillMapper::getAll()->where('id', $request->getDataInt('offset') ?? 0, '>')->where('unit', $this->app->unitId)->limit(25)->executeGetArray();
} else {
$view->data['bills'] = StockBillMapper::getAll()->where('id', 0, '>')->where('unit', $this->app->unitId)->limit(25)->execute();
$view->data['bills'] = BillMapper::getAll()->where('id', 0, '>')->where('unit', $this->app->unitId)->limit(25)->executeGetArray();
}
return $view;
@ -459,7 +511,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);
@ -483,7 +535,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;
}
@ -503,7 +555,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;
@ -527,7 +579,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')
@ -535,22 +587,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;
}
@ -573,7 +616,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')
@ -619,12 +662,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;
}
@ -658,7 +701,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;
@ -681,12 +724,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;
}
@ -720,7 +763,7 @@ 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;

View File

@ -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);

View File

@ -141,7 +141,7 @@ class BillMapper extends DataMapperFactory
'referral' => [
'mapper' => AccountMapper::class,
'external' => 'billing_bill_referral',
]
],
];
/**

View File

@ -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();
}
}

View File

@ -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();
}
/**
@ -287,7 +287,7 @@ final class SalesBillMapper extends BillMapper
->with('account')
->with('mainAddress')
->where('id', $clientIds, 'IN')
->execute();
->executeGetArray();
}
return [$clients, $data];
@ -334,7 +334,7 @@ final class SalesBillMapper extends BillMapper
->where('type/l11n/language', $language)
->where('billDate', $start, '>=')
->where('billDate', $end, '<=')
->execute();
->executeGetArray();
}
/**
@ -348,7 +348,7 @@ final class SalesBillMapper extends BillMapper
->with('bill/type')
->where('bill/client', $client)
->where('bill/type/transferStock', true)
->execute();
->executeGetArray();
}
/**
@ -376,7 +376,7 @@ final class SalesBillMapper extends BillMapper
LIMIT {$limit};
SQL;
$query = new Builder(self::$db);
$query = new Builder(self::$db);
$results = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
if ($results === false) {
@ -425,7 +425,7 @@ final class SalesBillMapper extends BillMapper
ORDER BY billing_bill_element_item, year ASC, month ASC;
SQL;
$query = new Builder(self::$db);
$query = new Builder(self::$db);
$results = $query->raw($sql)->execute()?->fetchAll(\PDO::FETCH_ASSOC) ?? [];
if ($results === false) {
@ -637,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')}'
@ -658,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;

View File

@ -39,5 +39,6 @@ abstract class SettingsEnum extends Enum
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';
}

View File

@ -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();
}
}

View File

@ -13,84 +13,87 @@
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',
'TaxCode' => 'Steuerkz.',
'PL' => 'GuV',
'TaxCombinations' => 'Steuerkomb.',
'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',
'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.',
]];

View File

@ -13,84 +13,87 @@
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',
'TaxCode' => 'Tax Code',
'PL' => 'PL',
'TaxCombinations' => 'Tax Combinations',
'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',
'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.',
]];

View File

@ -20,8 +20,8 @@ use phpOMS\Uri\UriFactory;
*/
$taxcombination = $this->data['taxcombination'];
$previous = empty($taxcombination) ? '{/base}/finance/tax/combination/list' : '{/base}/finance/tax/combination/list?{?}&id=' . \reset($taxcombination)->id . '&ptype=p';
$next = empty($taxcombination) ? '{/base}/finance/tax/combination/list' : '{/base}/finance/tax/combination/list?{?}&id=' . \end($taxcombination)->id . '&ptype=n';
$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">

View File

@ -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; ?>">

View 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>

View File

@ -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?csrf={$CSRF}') . '?id=' . $archive->id; ?>"
src="<?= UriFactory::build('{/api}media/export?csrf={$CSRF}') . '&id=' . $archive->id; ?>"
loading="lazy" allowfullscreen></iframe>
</div>
</section>

View File

@ -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; ?>">

View File

@ -1,202 +0,0 @@
<?php
/**
* Jingga
*
* PHP Version 8.2
*
* @package Modules\Billing
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1);
use phpOMS\Localization\ISO3166NameEnum;
use phpOMS\Localization\ISO3166TwoEnum;
use phpOMS\Uri\UriFactory;
$bills = $this->data['bills'] ?? [];
echo $this->data['nav']->render(); ?>
<div class="row">
<div class="col-xs-12">
<div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Bills'); ?><i class="g-icon download btn end-xs">download</i></div>
<div class="slider">
<table id="billList" class="default sticky">
<thead>
<tr>
<td><label class="checkbox" for="iBillSelect-">
<input type="checkbox" id="iBillSelect-" name="billselect">
<span class="checkmark"></span>
</label>
<td><?= $this->getHtml('ID', '0', '0'); ?>
<label for="billList-sort-1">
<input type="radio" name="billList-sort" id="billList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-2">
<input type="radio" name="billList-sort" id="billList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('External'); ?>
<label for="billList-sort-1">
<input type="radio" name="billList-sort" id="billList-sort-1">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-2">
<input type="radio" name="billList-sort" id="billList-sort-2">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Type'); ?>
<label for="billList-sort-3">
<input type="radio" name="billList-sort" id="billList-sort-3">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-4">
<input type="radio" name="billList-sort" id="billList-sort-4">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('SupplierID'); ?>
<label for="billList-sort-5">
<input type="radio" name="billList-sort" id="billList-sort-5">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-6">
<input type="radio" name="billList-sort" id="billList-sort-6">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Supplier'); ?>
<label for="billList-sort-7">
<input type="radio" name="billList-sort" id="billList-sort-7">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-8">
<input type="radio" name="billList-sort" id="billList-sort-8">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Address'); ?>
<label for="billList-sort-9">
<input type="radio" name="billList-sort" id="billList-sort-9">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-10">
<input type="radio" name="billList-sort" id="billList-sort-10">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Postal'); ?>
<label for="billList-sort-11">
<input type="radio" name="billList-sort" id="billList-sort-11">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-12">
<input type="radio" name="billList-sort" id="billList-sort-12">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('City'); ?>
<label for="billList-sort-13">
<input type="radio" name="billList-sort" id="billList-sort-13">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-14">
<input type="radio" name="billList-sort" id="billList-sort-14">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td class="wf-100"><?= $this->getHtml('Country'); ?>
<label for="billList-sort-15">
<input type="radio" name="billList-sort" id="billList-sort-15">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-16">
<input type="radio" name="billList-sort" id="billList-sort-16">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Gross'); ?>
<label for="billList-sort-7">
<input type="radio" name="billList-sort" id="billList-sort-7">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-18">
<input type="radio" name="billList-sort" id="billList-sort-18">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<td><?= $this->getHtml('Date'); ?>
<label for="billList-sort-23">
<input type="radio" name="billList-sort" id="billList-sort-23">
<i class="sort-asc g-icon">expand_less</i>
</label>
<label for="billList-sort-24">
<input type="radio" name="billList-sort" id="billList-sort-24">
<i class="sort-desc g-icon">expand_more</i>
</label>
<label>
<i class="filter g-icon">filter_alt</i>
</label>
<tbody>
<?php $count = 0;
foreach ($bills as $key => $value) :
++$count;
$url = UriFactory::build('{/base}/private/purchase/bill?{?}&id=' . $value->id);
?>
<tr data-href="<?= $url; ?>">
<td><label class="checkbox" for="iBillSelect-<?= $key; ?>">
<input type="checkbox" id="iBillSelect-<?= $key; ?>" name="billselect">
<span class="checkmark"></span>
</label>
<td><a href="<?= $url; ?>"><?= $value->getNumber(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->external; ?></a>
<td><a href="<?= $url; ?>"><?= $value->type->getL11n(); ?></a>
<td><a class="content" href="<?= $supplier = UriFactory::build('purchase/supplier/view?{?}&id=' . $value->supplier->id); ?>"><?= $value->supplier->number; ?></a>
<td><a class="content" href="<?= $supplier; ?>"><?= $this->printHtml($value->billTo); ?></a>
<td><a href="<?= $url;
?>"><?= $value->billAddress; ?></a>
<td><a href="<?= $url; ?>"><?= $value->billZip; ?></a>
<td><a href="<?= $url; ?>"><?= $value->billCity; ?></a>
<td><a href="<?= $url; ?>"><?= empty($value->billCountry)
? ''
: ISO3166NameEnum::getByName(
ISO3166TwoEnum::getName($value->billCountry)
); ?></a>
<td><a href="<?= $url; ?>"><?= $value->grossSales->getAmount(); ?></a>
<td><a href="<?= $url; ?>"><?= $value->billDate?->format('Y-m-d'); ?></a>
<?php endforeach; ?>
<?php if ($count === 0) : ?>
<tr><td colspan="12" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
<?php endif; ?>
</table>
</div>
</div>
</div>
</div>

View File

@ -116,7 +116,7 @@ final class BillTest extends \PHPUnit\Framework\TestCase
'billCity' => 'City',
'billZip' => 'Zip',
'billCountry' => 'Country',
'external' => '',
'external' => '',
],
$this->bill->jsonSerialize()
);