Automated formatting changes

This commit is contained in:
Formatter Bot 2021-02-07 11:48:08 +00:00
parent 12e69aedeb
commit 6b978f8a83
16 changed files with 114 additions and 114 deletions

View File

@ -15,9 +15,9 @@ declare(strict_types=1);
namespace Modules\Billing\Admin; namespace Modules\Billing\Admin;
use Modules\Billing\Models\BillType; use Modules\Billing\Models\BillType;
use Modules\Billing\Models\BillTypeMapper;
use Modules\Billing\Models\BillTypeL11n; use Modules\Billing\Models\BillTypeL11n;
use Modules\Billing\Models\BillTypeL11nMapper; use Modules\Billing\Models\BillTypeL11nMapper;
use Modules\Billing\Models\BillTypeMapper;
use phpOMS\Config\SettingsInterface; use phpOMS\Config\SettingsInterface;
use phpOMS\DataStorage\Database\DatabasePool; use phpOMS\DataStorage\Database\DatabasePool;
use phpOMS\Localization\ISO639x1Enum; use phpOMS\Localization\ISO639x1Enum;
@ -34,7 +34,7 @@ use phpOMS\Module\ModuleInfo;
*/ */
final class Installer extends InstallerAbstract final class Installer extends InstallerAbstract
{ {
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public static function install(DatabasePool $dbPool, ModuleInfo $info, SettingsInterface $cfgHandler) : void public static function install(DatabasePool $dbPool, ModuleInfo $info, SettingsInterface $cfgHandler) : void

View File

@ -8,56 +8,56 @@ use phpOMS\Router\RouteVerb;
return [ return [
'^.*/sales/invoice/create.*$' => [ '^.*/sales/invoice/create.*$' => [
[ [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceCreate', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceCreate',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::MODULE_NAME,
'type' => PermissionType::CREATE, 'type' => PermissionType::CREATE,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
], ],
], ],
'^.*/sales/invoice/list.*$' => [ '^.*/sales/invoice/list.*$' => [
[ [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceList', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
], ],
], ],
'^.*/sales/invoice\?.*$' => [ '^.*/sales/invoice\?.*$' => [
[ [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoice', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoice',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::SALES_INVOICE, 'state' => PermissionState::SALES_INVOICE,
], ],
], ],
], ],
'^.*/purchase/invoice/create.*$' => [ '^.*/purchase/invoice/create.*$' => [
[ [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::MODULE_NAME,
'type' => PermissionType::CREATE, 'type' => PermissionType::CREATE,
'state' => PermissionState::PURCHASE_INVOICE, 'state' => PermissionState::PURCHASE_INVOICE,
], ],
], ],
], ],
'^.*/purchase/invoice/list.*$' => [ '^.*/purchase/invoice/list.*$' => [
[ [
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaInvoiceList', 'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaInvoiceList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
'permission' => [ 'permission' => [
'module' => BackendController::MODULE_NAME, 'module' => BackendController::MODULE_NAME,
'type' => PermissionType::READ, 'type' => PermissionType::READ,
'state' => PermissionState::PURCHASE_INVOICE, 'state' => PermissionState::PURCHASE_INVOICE,
], ],
], ],
], ],

View File

@ -16,22 +16,19 @@ namespace Modules\Billing\Controller;
use Modules\Admin\Models\NullAccount; use Modules\Admin\Models\NullAccount;
use Modules\Billing\Models\Bill; use Modules\Billing\Models\Bill;
use Modules\Billing\Models\BillMapper;
use Modules\Billing\Models\BillElement; use Modules\Billing\Models\BillElement;
use Modules\Billing\Models\BillElementMapper; use Modules\Billing\Models\BillElementMapper;
use Modules\Billing\Models\BillMapper;
use Modules\Billing\Models\NullBillType; use Modules\Billing\Models\NullBillType;
use Modules\ClientManagement\Models\ClientMapper;
use Modules\ClientManagement\Models\NullClient; use Modules\ClientManagement\Models\NullClient;
use phpOMS\Message\Http\HttpRequest; use Modules\ItemManagement\Models\ItemMapper;
use phpOMS\Message\Http\HttpResponse; use phpOMS\Localization\Money;
use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\NotificationLevel; use phpOMS\Message\NotificationLevel;
use phpOMS\Message\RequestAbstract; use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract; use phpOMS\Message\ResponseAbstract;
use phpOMS\Model\Message\FormValidation; use phpOMS\Model\Message\FormValidation;
use phpOMS\Utils\Parser\Markdown\Markdown;
use Modules\ItemManagement\Models\ItemMapper;
use phpOMS\Localization\Money;
use Modules\ClientManagement\Models\ClientMapper;
/** /**
* Billing class. * Billing class.
@ -90,9 +87,9 @@ final class ApiController extends Controller
$bill->number = '{y}-{id}'; // @todo: use admin defined format $bill->number = '{y}-{id}'; // @todo: use admin defined format
$bill->billTo = $request->getData('billto') $bill->billTo = $request->getData('billto')
?? ($client->profile->account->name1 . (!empty($client->profile->account->name2) ? ', ' . $client->profile->account->name2 : '')); // @todo: use defaultInvoiceAddress or mainAddress. also consider to use billto1, billto2, billto3 (for multiple lines e.g. name2, fao etc.) ?? ($client->profile->account->name1 . (!empty($client->profile->account->name2) ? ', ' . $client->profile->account->name2 : '')); // @todo: use defaultInvoiceAddress or mainAddress. also consider to use billto1, billto2, billto3 (for multiple lines e.g. name2, fao etc.)
$bill->billCountry = $request->getData('billtocountry') ?? $client->mainAddress->getCountry(); $bill->billCountry = $request->getData('billtocountry') ?? $client->mainAddress->getCountry();
$bill->type = new NullBillType((int) $request->getData('type')); $bill->type = new NullBillType((int) $request->getData('type'));
$bill->client = new NullClient((int) $request->getData('client')); $bill->client = new NullClient((int) $request->getData('client'));
$bill->performanceDate = new \DateTime($request->getData('performancedate') ?? 'now'); $bill->performanceDate = new \DateTime($request->getData('performancedate') ?? 'now');
return $bill; return $bill;
@ -168,7 +165,7 @@ final class ApiController extends Controller
*/ */
public function createBillElementFromRequest(RequestAbstract $request, ResponseAbstract $response, $data = null) : BillElement public function createBillElementFromRequest(RequestAbstract $request, ResponseAbstract $response, $data = null) : BillElement
{ {
$element = new BillElement(); $element = new BillElement();
$element->bill = (int) $request->getData('bill'); $element->bill = (int) $request->getData('bill');
$element->item = $request->getData('item', 'int'); $element->item = $request->getData('item', 'int');
@ -179,11 +176,11 @@ final class ApiController extends Controller
$item = ItemMapper::withConditional('language', $response->getLanguage())::get($element->item); $item = ItemMapper::withConditional('language', $response->getLanguage())::get($element->item);
// @todo: which item name should be stored in the database? server language (problem for international company with subsidiaries)? customer default language/customer invoice language? // @todo: which item name should be stored in the database? server language (problem for international company with subsidiaries)? customer default language/customer invoice language?
$element->itemNumber = $item->number; $element->itemNumber = $item->number;
$element->itemName = $item->getL11n('name1')->description; $element->itemName = $item->getL11n('name1')->description;
$element->quantity = $request->getData('quantity', 'int'); $element->quantity = $request->getData('quantity', 'int');
$element->singleSalesPriceNet = new Money($request->getData('singlesalespricenet', 'int') ?? $item->salesPrice->getInt()); $element->singleSalesPriceNet = new Money($request->getData('singlesalespricenet', 'int') ?? $item->salesPrice->getInt());
$element->totalSalesPriceNet = clone $element->singleSalesPriceNet; $element->totalSalesPriceNet = clone $element->singleSalesPriceNet;
$element->totalSalesPriceNet->mult($element->quantity); $element->totalSalesPriceNet->mult($element->quantity);
// discounts // discounts
@ -193,7 +190,7 @@ final class ApiController extends Controller
} }
$element->singlePurchasePriceNet = new Money($item->purchasePrice->getInt()); $element->singlePurchasePriceNet = new Money($item->purchasePrice->getInt());
$element->totalPurchasePriceNet = clone $element->singlePurchasePriceNet; $element->totalPurchasePriceNet = clone $element->singlePurchasePriceNet;
$element->totalPurchasePriceNet->mult($element->quantity); $element->totalPurchasePriceNet->mult($element->quantity);
return $element; return $element;

View File

@ -15,13 +15,11 @@ declare(strict_types=1);
namespace Modules\Billing\Controller; namespace Modules\Billing\Controller;
use Modules\Billing\Models\BillMapper; use Modules\Billing\Models\BillMapper;
use Modules\Billing\Models\BillTypeL11n;
use phpOMS\Contract\RenderableInterface; use phpOMS\Contract\RenderableInterface;
use phpOMS\Message\RequestAbstract; use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract; use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View; use phpOMS\Views\View;
use Modules\Billing\Models\BillType;
use Modules\Billing\Models\BillTypeL11n;
use phpOMS\DataStorage\Database\RelationType;
/** /**
* Billing class. * Billing class.

View File

@ -51,7 +51,9 @@ class Bill implements \JsonSerializable
* @var int|BillType * @var int|BillType
* @since 1.0.0 * @since 1.0.0
*/ */
public int|BillType $type = 0; public int |
BillType $type = 0;
/** /**
* Bill status. * Bill status.
@ -246,15 +248,15 @@ class Bill implements \JsonSerializable
*/ */
public function __construct() public function __construct()
{ {
$this->net = new Money(0); $this->net = new Money(0);
$this->gross = new Money(0); $this->gross = new Money(0);
$this->costs = new Money(0); $this->costs = new Money(0);
$this->profit = new Money(0); $this->profit = new Money(0);
$this->createdAt = new \DateTimeImmutable(); $this->createdAt = new \DateTimeImmutable();
$this->performanceDate = new \DateTime(); $this->performanceDate = new \DateTime();
$this->createdBy = new NullAccount(); $this->createdBy = new NullAccount();
$this->referer = new NullAccount(); $this->referer = new NullAccount();
} }
/** /**

View File

@ -83,10 +83,10 @@ class BillElement implements \JsonSerializable
public function __construct() public function __construct()
{ {
$this->singleSalesPriceNet = new Money(); $this->singleSalesPriceNet = new Money();
$this->totalSalesPriceNet = new Money(); $this->totalSalesPriceNet = new Money();
$this->singlePurchasePriceNet = new Money(); $this->singlePurchasePriceNet = new Money();
$this->totalPurchasePriceNet = new Money(); $this->totalPurchasePriceNet = new Money();
} }
/** /**

View File

@ -14,7 +14,6 @@ declare(strict_types=1);
namespace Modules\Billing\Models; namespace Modules\Billing\Models;
use Modules\ClientManagement\Models\ClientMapper;
use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\DataMapperAbstract;
/** /**
@ -34,18 +33,18 @@ final class BillElementMapper extends DataMapperAbstract
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $columns = [ protected static array $columns = [
'billing_out_element_id' => ['name' => 'billing_out_element_id', 'type' => 'int', 'internal' => 'id'], 'billing_out_element_id' => ['name' => 'billing_out_element_id', 'type' => 'int', 'internal' => 'id'],
'billing_out_element_order' => ['name' => 'billing_out_element_order', 'type' => 'int', 'internal' => 'order'], 'billing_out_element_order' => ['name' => 'billing_out_element_order', 'type' => 'int', 'internal' => 'order'],
'billing_out_element_item' => ['name' => 'billing_out_element_item', 'type' => 'int', 'internal' => 'item'], 'billing_out_element_item' => ['name' => 'billing_out_element_item', 'type' => 'int', 'internal' => 'item'],
'billing_out_element_item_number' => ['name' => 'billing_out_element_item_number', 'type' => 'string', 'internal' => 'itemNumber'], 'billing_out_element_item_number' => ['name' => 'billing_out_element_item_number', 'type' => 'string', 'internal' => 'itemNumber'],
'billing_out_element_item_name' => ['name' => 'billing_out_element_item_name', 'type' => 'string', 'internal' => 'itemName'], 'billing_out_element_item_name' => ['name' => 'billing_out_element_item_name', 'type' => 'string', 'internal' => 'itemName'],
'billing_out_element_item_desc' => ['name' => 'billing_out_element_item_desc', 'type' => 'string', 'internal' => 'itemDescription'], 'billing_out_element_item_desc' => ['name' => 'billing_out_element_item_desc', 'type' => 'string', 'internal' => 'itemDescription'],
'billing_out_element_quantity' => ['name' => 'billing_out_element_quantity', 'type' => 'int', 'internal' => 'quantity'], 'billing_out_element_quantity' => ['name' => 'billing_out_element_quantity', 'type' => 'int', 'internal' => 'quantity'],
'billing_out_element_single_salesprice_net' => ['name' => 'billing_out_element_single_salesprice_net', 'type' => 'Serializable', 'internal' => 'singleSalesPriceNet'], 'billing_out_element_single_salesprice_net' => ['name' => 'billing_out_element_single_salesprice_net', 'type' => 'Serializable', 'internal' => 'singleSalesPriceNet'],
'billing_out_element_single_purchaseprice_net' => ['name' => 'billing_out_element_single_purchaseprice_net', 'type' => 'Serializable', 'internal' => 'singlePurchasePriceNet'], 'billing_out_element_single_purchaseprice_net' => ['name' => 'billing_out_element_single_purchaseprice_net', 'type' => 'Serializable', 'internal' => 'singlePurchasePriceNet'],
'billing_out_element_total_salesprice_net' => ['name' => 'billing_out_element_total_salesprice_net', 'type' => 'Serializable', 'internal' => 'totalSalesPriceNet'], 'billing_out_element_total_salesprice_net' => ['name' => 'billing_out_element_total_salesprice_net', 'type' => 'Serializable', 'internal' => 'totalSalesPriceNet'],
'billing_out_element_total_purchaseprice_net' => ['name' => 'billing_out_element_total_purchaseprice_net', 'type' => 'Serializable', 'internal' => 'totalPurchasePriceNet'], 'billing_out_element_total_purchaseprice_net' => ['name' => 'billing_out_element_total_purchaseprice_net', 'type' => 'Serializable', 'internal' => 'totalPurchasePriceNet'],
'billing_out_element_bill' => ['name' => 'billing_out_element_bill', 'type' => 'int', 'internal' => 'bill'], 'billing_out_element_bill' => ['name' => 'billing_out_element_bill', 'type' => 'int', 'internal' => 'bill'],
]; ];
/** /**

View File

@ -18,9 +18,9 @@ use Modules\Admin\Models\AccountMapper;
use Modules\ClientManagement\Models\ClientMapper; use Modules\ClientManagement\Models\ClientMapper;
use phpOMS\DataStorage\Database\DataMapperAbstract; use phpOMS\DataStorage\Database\DataMapperAbstract;
use phpOMS\DataStorage\Database\Query\Builder; use phpOMS\DataStorage\Database\Query\Builder;
use phpOMS\Localization\Money;
use phpOMS\DataStorage\Database\RelationType; use phpOMS\DataStorage\Database\RelationType;
use phpOMS\Localization\Defaults\CountryMapper; use phpOMS\Localization\Defaults\CountryMapper;
use phpOMS\Localization\Money;
/** /**
* Mapper class. * Mapper class.
@ -39,41 +39,41 @@ final class BillMapper extends DataMapperAbstract
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $columns = [ protected static array $columns = [
'billing_out_id' => ['name' => 'billing_out_id', 'type' => 'int', 'internal' => 'id'], 'billing_out_id' => ['name' => 'billing_out_id', 'type' => 'int', 'internal' => 'id'],
'billing_out_number' => ['name' => 'billing_out_number', 'type' => 'string', 'internal' => 'number'], 'billing_out_number' => ['name' => 'billing_out_number', 'type' => 'string', 'internal' => 'number'],
'billing_out_type' => ['name' => 'billing_out_type', 'type' => 'int', 'internal' => 'type'], 'billing_out_type' => ['name' => 'billing_out_type', 'type' => 'int', 'internal' => 'type'],
'billing_out_info' => ['name' => 'billing_out_info', 'type' => 'string', 'internal' => 'info'], 'billing_out_info' => ['name' => 'billing_out_info', 'type' => 'string', 'internal' => 'info'],
'billing_out_status' => ['name' => 'billing_out_status', 'type' => 'int', 'internal' => 'status'], 'billing_out_status' => ['name' => 'billing_out_status', 'type' => 'int', 'internal' => 'status'],
'billing_out_shipTo' => ['name' => 'billing_out_shipTo', 'type' => 'string', 'internal' => 'shipTo'], 'billing_out_shipTo' => ['name' => 'billing_out_shipTo', 'type' => 'string', 'internal' => 'shipTo'],
'billing_out_shipFAO' => ['name' => 'billing_out_shipFAO', 'type' => 'string', 'internal' => 'shipFAO'], 'billing_out_shipFAO' => ['name' => 'billing_out_shipFAO', 'type' => 'string', 'internal' => 'shipFAO'],
'billing_out_shipAddr' => ['name' => 'billing_out_shipAddr', 'type' => 'string', 'internal' => 'shipAddress'], 'billing_out_shipAddr' => ['name' => 'billing_out_shipAddr', 'type' => 'string', 'internal' => 'shipAddress'],
'billing_out_shipCity' => ['name' => 'billing_out_shipCity', 'type' => 'string', 'internal' => 'shipCity'], 'billing_out_shipCity' => ['name' => 'billing_out_shipCity', 'type' => 'string', 'internal' => 'shipCity'],
'billing_out_shipZip' => ['name' => 'billing_out_shipZip', 'type' => 'string', 'internal' => 'shipZip'], 'billing_out_shipZip' => ['name' => 'billing_out_shipZip', 'type' => 'string', 'internal' => 'shipZip'],
'billing_out_shipCountry' => ['name' => 'billing_out_shipCountry', 'type' => 'string', 'internal' => 'shipCountry'], 'billing_out_shipCountry' => ['name' => 'billing_out_shipCountry', 'type' => 'string', 'internal' => 'shipCountry'],
'billing_out_billTo' => ['name' => 'billing_out_billTo', 'type' => 'string', 'internal' => 'billTo'], 'billing_out_billTo' => ['name' => 'billing_out_billTo', 'type' => 'string', 'internal' => 'billTo'],
'billing_out_billFAO' => ['name' => 'billing_out_billFAO', 'type' => 'string', 'internal' => 'billFAO'], 'billing_out_billFAO' => ['name' => 'billing_out_billFAO', 'type' => 'string', 'internal' => 'billFAO'],
'billing_out_billAddr' => ['name' => 'billing_out_billAddr', 'type' => 'string', 'internal' => 'billAddress'], 'billing_out_billAddr' => ['name' => 'billing_out_billAddr', 'type' => 'string', 'internal' => 'billAddress'],
'billing_out_billCity' => ['name' => 'billing_out_billCity', 'type' => 'string', 'internal' => 'billCity'], 'billing_out_billCity' => ['name' => 'billing_out_billCity', 'type' => 'string', 'internal' => 'billCity'],
'billing_out_billZip' => ['name' => 'billing_out_billZip', 'type' => 'string', 'internal' => 'billZip'], 'billing_out_billZip' => ['name' => 'billing_out_billZip', 'type' => 'string', 'internal' => 'billZip'],
'billing_out_billCountry' => ['name' => 'billing_out_billCountry', 'type' => 'string', 'internal' => 'billCountry'], 'billing_out_billCountry' => ['name' => 'billing_out_billCountry', 'type' => 'string', 'internal' => 'billCountry'],
'billing_out_gross' => ['name' => 'billing_out_gross', 'type' => 'Serializable', 'internal' => 'gross'], 'billing_out_gross' => ['name' => 'billing_out_gross', 'type' => 'Serializable', 'internal' => 'gross'],
'billing_out_net' => ['name' => 'billing_out_net', 'type' => 'Serializable', 'internal' => 'net'], 'billing_out_net' => ['name' => 'billing_out_net', 'type' => 'Serializable', 'internal' => 'net'],
'billing_out_costs' => ['name' => 'billing_out_costs', 'type' => 'Serializable', 'internal' => 'costs'], 'billing_out_costs' => ['name' => 'billing_out_costs', 'type' => 'Serializable', 'internal' => 'costs'],
'billing_out_profit' => ['name' => 'billing_out_profit', 'type' => 'Serializable', 'internal' => 'profit'], 'billing_out_profit' => ['name' => 'billing_out_profit', 'type' => 'Serializable', 'internal' => 'profit'],
'billing_out_currency' => ['name' => 'billing_out_currency', 'type' => 'int', 'internal' => 'currency'], 'billing_out_currency' => ['name' => 'billing_out_currency', 'type' => 'int', 'internal' => 'currency'],
'billing_out_referral' => ['name' => 'billing_out_referral', 'type' => 'int', 'internal' => 'referral'], 'billing_out_referral' => ['name' => 'billing_out_referral', 'type' => 'int', 'internal' => 'referral'],
'billing_out_referral_name' => ['name' => 'billing_out_referral_name', 'type' => 'string', 'internal' => 'referralName'], 'billing_out_referral_name' => ['name' => 'billing_out_referral_name', 'type' => 'string', 'internal' => 'referralName'],
'billing_out_reference' => ['name' => 'billing_out_reference', 'type' => 'int', 'internal' => 'reference'], 'billing_out_reference' => ['name' => 'billing_out_reference', 'type' => 'int', 'internal' => 'reference'],
'billing_out_payment' => ['name' => 'billing_out_payment', 'type' => 'int', 'internal' => 'payment'], 'billing_out_payment' => ['name' => 'billing_out_payment', 'type' => 'int', 'internal' => 'payment'],
'billing_out_payment_text' => ['name' => 'billing_out_payment_text', 'type' => 'string', 'internal' => 'paymentText'], 'billing_out_payment_text' => ['name' => 'billing_out_payment_text', 'type' => 'string', 'internal' => 'paymentText'],
'billing_out_paymentterms' => ['name' => 'billing_out_paymentterms', 'type' => 'int', 'internal' => 'terms'], 'billing_out_paymentterms' => ['name' => 'billing_out_paymentterms', 'type' => 'int', 'internal' => 'terms'],
'billing_out_paymentterms_text' => ['name' => 'billing_out_paymentterms_text', 'type' => 'string', 'internal' => 'termsText'], 'billing_out_paymentterms_text' => ['name' => 'billing_out_paymentterms_text', 'type' => 'string', 'internal' => 'termsText'],
'billing_out_ship_type' => ['name' => 'billing_out_ship_type', 'type' => 'int', 'internal' => 'shipping'], 'billing_out_ship_type' => ['name' => 'billing_out_ship_type', 'type' => 'int', 'internal' => 'shipping'],
'billing_out_ship_text' => ['name' => 'billing_out_ship_text', 'type' => 'string', 'internal' => 'shippingText'], 'billing_out_ship_text' => ['name' => 'billing_out_ship_text', 'type' => 'string', 'internal' => 'shippingText'],
'billing_out_client' => ['name' => 'billing_out_client', 'type' => 'int', 'internal' => 'client'], 'billing_out_client' => ['name' => 'billing_out_client', 'type' => 'int', 'internal' => 'client'],
'billing_out_created_by' => ['name' => 'billing_out_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true], 'billing_out_created_by' => ['name' => 'billing_out_created_by', 'type' => 'int', 'internal' => 'createdBy', 'readonly' => true],
'billing_out_performance_date' => ['name' => 'billing_out_performance_date', 'type' => 'DateTime', 'internal' => 'performanceDate', 'readonly' => true], 'billing_out_performance_date' => ['name' => 'billing_out_performance_date', 'type' => 'DateTime', 'internal' => 'performanceDate', 'readonly' => true],
'billing_out_created_at' => ['name' => 'billing_out_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true], 'billing_out_created_at' => ['name' => 'billing_out_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt', 'readonly' => true],
]; ];
/** /**
@ -221,12 +221,10 @@ final class BillMapper extends DataMapperAbstract
public static function getItemRetentionRate(int $id, \DateTime $start, \DateTime $end) : float public static function getItemRetentionRate(int $id, \DateTime $start, \DateTime $end) : float
{ {
} }
public static function getItemLivetimeValue(int $id, \DateTime $start, \DateTime $end) : Money public static function getItemLivetimeValue(int $id, \DateTime $start, \DateTime $end) : Money
{ {
} }
public static function getNewestItemInvoices(int $id, int $limit = 10) : array public static function getNewestItemInvoices(int $id, int $limit = 10) : array
@ -287,7 +285,7 @@ final class BillMapper extends DataMapperAbstract
->groupBy(ClientMapper::getTable() . '_' . $depth . '.clientmgmt_client_id'); ->groupBy(ClientMapper::getTable() . '_' . $depth . '.clientmgmt_client_id');
$clients = ClientMapper::getAllByQuery($query, RelationType::ALL, $depth); $clients = ClientMapper::getAllByQuery($query, RelationType::ALL, $depth);
$data = ClientMapper::getDataLastQuery(); $data = ClientMapper::getDataLastQuery();
return [$clients, $data]; return [$clients, $data];
} }

View File

@ -27,8 +27,12 @@ use phpOMS\Stdlib\Base\Enum;
abstract class BillStatus extends Enum abstract class BillStatus extends Enum
{ {
public const ACTIVE = 1; public const ACTIVE = 1;
public const ARCHIVED = 2; public const ARCHIVED = 2;
public const DELETED = 4; public const DELETED = 4;
public const DONE = 8; public const DONE = 8;
public const DRAFT = 16; public const DRAFT = 16;
} }

View File

@ -26,7 +26,7 @@ use phpOMS\Localization\ISO639x1Enum;
*/ */
class BillType class BillType
{ {
/** /**
* Id * Id
* *
* @var int * @var int
@ -34,7 +34,7 @@ class BillType
*/ */
protected int $id = 0; protected int $id = 0;
/** /**
* Localization * Localization
* *
* @var int|int[]|BillTypeL11n|BillTypeL11n[] * @var int|int[]|BillTypeL11n|BillTypeL11n[]
@ -69,7 +69,7 @@ class BillType
* Set l11n * Set l11n
* *
* @param string|BillTypeL11n $l11n Tag article l11n * @param string|BillTypeL11n $l11n Tag article l11n
* @param string $lang Language * @param string $lang Language
* *
* @return void * @return void
* *
@ -83,7 +83,7 @@ class BillType
$this->l11n->name = $l11n; $this->l11n->name = $l11n;
} elseif (\is_string($l11n)) { } elseif (\is_string($l11n)) {
$this->l11n = new BillTypeL11n(); $this->l11n = new BillTypeL11n();
$this->l11n->name = $l11n; $this->l11n->name = $l11n;
$this->l11n->setLanguage($lang); $this->l11n->setLanguage($lang);
} }
} }

View File

@ -41,7 +41,9 @@ class BillTypeL11n implements \JsonSerializable, ArrayableInterface
* @var int * @var int
* @since 1.0.0 * @since 1.0.0
*/ */
protected int|BillType $type = 0; protected int |
BillType $type = 0;
/** /**
* Language. * Language.
@ -63,12 +65,12 @@ class BillTypeL11n implements \JsonSerializable, ArrayableInterface
* Constructor. * Constructor.
* *
* @param int|BillType $type Attribute type * @param int|BillType $type Attribute type
* @param string $name Localized name * @param string $name Localized name
* @param string $language Language * @param string $language Language
* *
* @since 1.0.0 * @since 1.0.0
*/ */
public function __construct(int|BillType $type = 0, string $name = '', string $language = ISO639x1Enum::_EN) public function __construct(int | BillType $type = 0, string $name = '', string $language = ISO639x1Enum::_EN)
{ {
$this->type = $type; $this->type = $type;
$this->name = $name; $this->name = $name;
@ -146,7 +148,7 @@ class BillTypeL11n implements \JsonSerializable, ArrayableInterface
{ {
return [ return [
'id' => $this->id, 'id' => $this->id,
'name' => $this->name, 'name' => $this->name,
'type' => $this->type, 'type' => $this->type,
'language' => $this->language, 'language' => $this->language,
]; ];

View File

@ -33,10 +33,10 @@ final class BillTypeL11nMapper extends DataMapperAbstract
* @since 1.0.0 * @since 1.0.0
*/ */
protected static array $columns = [ protected static array $columns = [
'billing_type_l11n_id' => ['name' => 'billing_type_l11n_id', 'type' => 'int', 'internal' => 'id'], 'billing_type_l11n_id' => ['name' => 'billing_type_l11n_id', 'type' => 'int', 'internal' => 'id'],
'billing_type_l11n_name' => ['name' => 'billing_type_l11n_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], 'billing_type_l11n_name' => ['name' => 'billing_type_l11n_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true],
'billing_type_l11n_type' => ['name' => 'billing_type_l11n_type', 'type' => 'int', 'internal' => 'type'], 'billing_type_l11n_type' => ['name' => 'billing_type_l11n_type', 'type' => 'int', 'internal' => 'type'],
'billing_type_l11n_language' => ['name' => 'billing_type_l11n_language', 'type' => 'string', 'internal' => 'language'], 'billing_type_l11n_language' => ['name' => 'billing_type_l11n_language', 'type' => 'string', 'internal' => 'language'],
]; ];
/** /**

View File

@ -24,7 +24,7 @@ namespace Modules\Billing\Models;
*/ */
final class NullBillType extends BillType final class NullBillType extends BillType
{ {
/** /**
* Constructor * Constructor
* *
* @param int $id Model id * @param int $id Model id

View File

@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionState extends Enum abstract class PermissionState extends Enum
{ {
public const SALES_INVOICE = 1; public const SALES_INVOICE = 1;
public const PURCHASE_INVOICE = 2; public const PURCHASE_INVOICE = 2;
} }

View File

@ -12,7 +12,6 @@
*/ */
declare(strict_types=1); declare(strict_types=1);
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response); $footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response);
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig'); $footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
$footerView->setPages(20); $footerView->setPages(20);

View File

@ -16,7 +16,7 @@ declare(strict_types=1);
* @var \phpOMS\Views\View $this * @var \phpOMS\Views\View $this
*/ */
$bill = $this->getData('bill'); $bill = $this->getData('bill');
$elements = $bill->getElements(); $elements = $bill->getElements();
echo $this->getData('nav')->render(); ?> echo $this->getData('nav')->render(); ?>
@ -153,7 +153,7 @@ echo $this->getData('nav')->render(); ?>
<td><i class="fa fa-plus add"></i> <i class="fa fa-chevron-up order-up"></i> <i class="fa fa-chevron-down order-down"></i> <td><i class="fa fa-plus add"></i> <i class="fa fa-chevron-up order-up"></i> <i class="fa fa-chevron-down order-down"></i>
<td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" value="<?= $element->itemNumber; ?>" required></span> <td><span class="input"><button type="button" formaction=""><i class="fa fa-book"></i></button><input type="text" value="<?= $element->itemNumber; ?>" required></span>
<td><textarea required><?= $element->itemName; ?></textarea> <td><textarea required><?= $element->itemName; ?></textarea>
<td><input type="number" min="0" value="<?= $element->quantity ?>" required> <td><input type="number" min="0" value="<?= $element->quantity; ?>" required>
<td><input type="text" value="<?= $element->singleSalesPriceNet->getCurrency(); ?>"> <td><input type="text" value="<?= $element->singleSalesPriceNet->getCurrency(); ?>">
<td><input type="number" min="0"> <td><input type="number" min="0">
<td><input type="number" min="0" max="100" step="any"> <td><input type="number" min="0" max="100" step="any">