mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-02-06 03:28:41 +00:00
Automated formatting changes
This commit is contained in:
parent
12e69aedeb
commit
6b978f8a83
|
|
@ -15,9 +15,9 @@ declare(strict_types=1);
|
|||
namespace Modules\Billing\Admin;
|
||||
|
||||
use Modules\Billing\Models\BillType;
|
||||
use Modules\Billing\Models\BillTypeMapper;
|
||||
use Modules\Billing\Models\BillTypeL11n;
|
||||
use Modules\Billing\Models\BillTypeL11nMapper;
|
||||
use Modules\Billing\Models\BillTypeMapper;
|
||||
use phpOMS\Config\SettingsInterface;
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
use phpOMS\Localization\ISO639x1Enum;
|
||||
|
|
@ -34,7 +34,7 @@ use phpOMS\Module\ModuleInfo;
|
|||
*/
|
||||
final class Installer extends InstallerAbstract
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static function install(DatabasePool $dbPool, ModuleInfo $info, SettingsInterface $cfgHandler) : void
|
||||
|
|
|
|||
|
|
@ -8,56 +8,56 @@ use phpOMS\Router\RouteVerb;
|
|||
return [
|
||||
'^.*/sales/invoice/create.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionState::SALES_INVOICE,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionState::SALES_INVOICE,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/sales/invoice/list.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoiceList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SALES_INVOICE,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SALES_INVOICE,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/sales/invoice\?.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SALES_INVOICE,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::SALES_INVOICE,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/invoice/create.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionState::PURCHASE_INVOICE,
|
||||
'type' => PermissionType::CREATE,
|
||||
'state' => PermissionState::PURCHASE_INVOICE,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^.*/purchase/invoice/list.*$' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaInvoiceList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaInvoiceList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'permission' => [
|
||||
'module' => BackendController::MODULE_NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::PURCHASE_INVOICE,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionState::PURCHASE_INVOICE,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
|
|||
|
|
@ -16,22 +16,19 @@ namespace Modules\Billing\Controller;
|
|||
|
||||
use Modules\Admin\Models\NullAccount;
|
||||
use Modules\Billing\Models\Bill;
|
||||
use Modules\Billing\Models\BillMapper;
|
||||
use Modules\Billing\Models\BillElement;
|
||||
use Modules\Billing\Models\BillElementMapper;
|
||||
use Modules\Billing\Models\BillMapper;
|
||||
use Modules\Billing\Models\NullBillType;
|
||||
use Modules\ClientManagement\Models\ClientMapper;
|
||||
use Modules\ClientManagement\Models\NullClient;
|
||||
use phpOMS\Message\Http\HttpRequest;
|
||||
use phpOMS\Message\Http\HttpResponse;
|
||||
use Modules\ItemManagement\Models\ItemMapper;
|
||||
use phpOMS\Localization\Money;
|
||||
use phpOMS\Message\Http\RequestStatusCode;
|
||||
use phpOMS\Message\NotificationLevel;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
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.
|
||||
|
|
@ -90,9 +87,9 @@ final class ApiController extends Controller
|
|||
$bill->number = '{y}-{id}'; // @todo: use admin defined format
|
||||
$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.)
|
||||
$bill->billCountry = $request->getData('billtocountry') ?? $client->mainAddress->getCountry();
|
||||
$bill->type = new NullBillType((int) $request->getData('type'));
|
||||
$bill->client = new NullClient((int) $request->getData('client'));
|
||||
$bill->billCountry = $request->getData('billtocountry') ?? $client->mainAddress->getCountry();
|
||||
$bill->type = new NullBillType((int) $request->getData('type'));
|
||||
$bill->client = new NullClient((int) $request->getData('client'));
|
||||
$bill->performanceDate = new \DateTime($request->getData('performancedate') ?? 'now');
|
||||
|
||||
return $bill;
|
||||
|
|
@ -168,7 +165,7 @@ final class ApiController extends Controller
|
|||
*/
|
||||
public function createBillElementFromRequest(RequestAbstract $request, ResponseAbstract $response, $data = null) : BillElement
|
||||
{
|
||||
$element = new BillElement();
|
||||
$element = new BillElement();
|
||||
$element->bill = (int) $request->getData('bill');
|
||||
$element->item = $request->getData('item', 'int');
|
||||
|
||||
|
|
@ -179,11 +176,11 @@ final class ApiController extends Controller
|
|||
$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?
|
||||
$element->itemNumber = $item->number;
|
||||
$element->itemName = $item->getL11n('name1')->description;
|
||||
$element->quantity = $request->getData('quantity', 'int');
|
||||
$element->itemName = $item->getL11n('name1')->description;
|
||||
$element->quantity = $request->getData('quantity', 'int');
|
||||
|
||||
$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);
|
||||
|
||||
// discounts
|
||||
|
|
@ -193,7 +190,7 @@ final class ApiController extends Controller
|
|||
}
|
||||
|
||||
$element->singlePurchasePriceNet = new Money($item->purchasePrice->getInt());
|
||||
$element->totalPurchasePriceNet = clone $element->singlePurchasePriceNet;
|
||||
$element->totalPurchasePriceNet = clone $element->singlePurchasePriceNet;
|
||||
$element->totalPurchasePriceNet->mult($element->quantity);
|
||||
|
||||
return $element;
|
||||
|
|
|
|||
|
|
@ -15,13 +15,11 @@ declare(strict_types=1);
|
|||
namespace Modules\Billing\Controller;
|
||||
|
||||
use Modules\Billing\Models\BillMapper;
|
||||
use Modules\Billing\Models\BillTypeL11n;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\Message\RequestAbstract;
|
||||
use phpOMS\Message\ResponseAbstract;
|
||||
use phpOMS\Views\View;
|
||||
use Modules\Billing\Models\BillType;
|
||||
use Modules\Billing\Models\BillTypeL11n;
|
||||
use phpOMS\DataStorage\Database\RelationType;
|
||||
|
||||
/**
|
||||
* Billing class.
|
||||
|
|
|
|||
|
|
@ -51,7 +51,9 @@ class Bill implements \JsonSerializable
|
|||
* @var int|BillType
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public int|BillType $type = 0;
|
||||
public int |
|
||||
|
||||
BillType $type = 0;
|
||||
|
||||
/**
|
||||
* Bill status.
|
||||
|
|
@ -246,15 +248,15 @@ class Bill implements \JsonSerializable
|
|||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->net = new Money(0);
|
||||
$this->gross = new Money(0);
|
||||
$this->costs = new Money(0);
|
||||
$this->net = new Money(0);
|
||||
$this->gross = new Money(0);
|
||||
$this->costs = new Money(0);
|
||||
$this->profit = new Money(0);
|
||||
|
||||
$this->createdAt = new \DateTimeImmutable();
|
||||
$this->createdAt = new \DateTimeImmutable();
|
||||
$this->performanceDate = new \DateTime();
|
||||
$this->createdBy = new NullAccount();
|
||||
$this->referer = new NullAccount();
|
||||
$this->createdBy = new NullAccount();
|
||||
$this->referer = new NullAccount();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -83,10 +83,10 @@ class BillElement implements \JsonSerializable
|
|||
public function __construct()
|
||||
{
|
||||
$this->singleSalesPriceNet = new Money();
|
||||
$this->totalSalesPriceNet = new Money();
|
||||
$this->totalSalesPriceNet = new Money();
|
||||
|
||||
$this->singlePurchasePriceNet = new Money();
|
||||
$this->totalPurchasePriceNet = new Money();
|
||||
$this->totalPurchasePriceNet = new Money();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace Modules\Billing\Models;
|
||||
|
||||
use Modules\ClientManagement\Models\ClientMapper;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
|
||||
/**
|
||||
|
|
@ -34,18 +33,18 @@ final class BillElementMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
'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_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_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_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_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_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_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_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_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_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_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_bill' => ['name' => 'billing_out_element_bill', 'type' => 'int', 'internal' => 'bill'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ use Modules\Admin\Models\AccountMapper;
|
|||
use Modules\ClientManagement\Models\ClientMapper;
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
use phpOMS\Localization\Money;
|
||||
use phpOMS\DataStorage\Database\RelationType;
|
||||
use phpOMS\Localization\Defaults\CountryMapper;
|
||||
use phpOMS\Localization\Money;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
|
|
@ -39,41 +39,41 @@ final class BillMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
'billing_out_id' => ['name' => 'billing_out_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'billing_out_number' => ['name' => 'billing_out_number', 'type' => 'string', 'internal' => 'number'],
|
||||
'billing_out_type' => ['name' => 'billing_out_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'billing_out_info' => ['name' => 'billing_out_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'billing_out_status' => ['name' => 'billing_out_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'billing_out_shipTo' => ['name' => 'billing_out_shipTo', 'type' => 'string', 'internal' => 'shipTo'],
|
||||
'billing_out_shipFAO' => ['name' => 'billing_out_shipFAO', 'type' => 'string', 'internal' => 'shipFAO'],
|
||||
'billing_out_shipAddr' => ['name' => 'billing_out_shipAddr', 'type' => 'string', 'internal' => 'shipAddress'],
|
||||
'billing_out_shipCity' => ['name' => 'billing_out_shipCity', 'type' => 'string', 'internal' => 'shipCity'],
|
||||
'billing_out_shipZip' => ['name' => 'billing_out_shipZip', 'type' => 'string', 'internal' => 'shipZip'],
|
||||
'billing_out_shipCountry' => ['name' => 'billing_out_shipCountry', 'type' => 'string', 'internal' => 'shipCountry'],
|
||||
'billing_out_billTo' => ['name' => 'billing_out_billTo', 'type' => 'string', 'internal' => 'billTo'],
|
||||
'billing_out_billFAO' => ['name' => 'billing_out_billFAO', 'type' => 'string', 'internal' => 'billFAO'],
|
||||
'billing_out_billAddr' => ['name' => 'billing_out_billAddr', 'type' => 'string', 'internal' => 'billAddress'],
|
||||
'billing_out_billCity' => ['name' => 'billing_out_billCity', 'type' => 'string', 'internal' => 'billCity'],
|
||||
'billing_out_billZip' => ['name' => 'billing_out_billZip', 'type' => 'string', 'internal' => 'billZip'],
|
||||
'billing_out_billCountry' => ['name' => 'billing_out_billCountry', 'type' => 'string', 'internal' => 'billCountry'],
|
||||
'billing_out_gross' => ['name' => 'billing_out_gross', 'type' => 'Serializable', 'internal' => 'gross'],
|
||||
'billing_out_net' => ['name' => 'billing_out_net', 'type' => 'Serializable', 'internal' => 'net'],
|
||||
'billing_out_costs' => ['name' => 'billing_out_costs', 'type' => 'Serializable', 'internal' => 'costs'],
|
||||
'billing_out_profit' => ['name' => 'billing_out_profit', 'type' => 'Serializable', 'internal' => 'profit'],
|
||||
'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' => ['name' => 'billing_out_referral_name', 'type' => 'string', 'internal' => 'referralName'],
|
||||
'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_text' => ['name' => 'billing_out_payment_text', 'type' => 'string', 'internal' => 'paymentText'],
|
||||
'billing_out_paymentterms' => ['name' => 'billing_out_paymentterms', 'type' => 'int', 'internal' => 'terms'],
|
||||
'billing_out_id' => ['name' => 'billing_out_id', 'type' => 'int', 'internal' => 'id'],
|
||||
'billing_out_number' => ['name' => 'billing_out_number', 'type' => 'string', 'internal' => 'number'],
|
||||
'billing_out_type' => ['name' => 'billing_out_type', 'type' => 'int', 'internal' => 'type'],
|
||||
'billing_out_info' => ['name' => 'billing_out_info', 'type' => 'string', 'internal' => 'info'],
|
||||
'billing_out_status' => ['name' => 'billing_out_status', 'type' => 'int', 'internal' => 'status'],
|
||||
'billing_out_shipTo' => ['name' => 'billing_out_shipTo', 'type' => 'string', 'internal' => 'shipTo'],
|
||||
'billing_out_shipFAO' => ['name' => 'billing_out_shipFAO', 'type' => 'string', 'internal' => 'shipFAO'],
|
||||
'billing_out_shipAddr' => ['name' => 'billing_out_shipAddr', 'type' => 'string', 'internal' => 'shipAddress'],
|
||||
'billing_out_shipCity' => ['name' => 'billing_out_shipCity', 'type' => 'string', 'internal' => 'shipCity'],
|
||||
'billing_out_shipZip' => ['name' => 'billing_out_shipZip', 'type' => 'string', 'internal' => 'shipZip'],
|
||||
'billing_out_shipCountry' => ['name' => 'billing_out_shipCountry', 'type' => 'string', 'internal' => 'shipCountry'],
|
||||
'billing_out_billTo' => ['name' => 'billing_out_billTo', 'type' => 'string', 'internal' => 'billTo'],
|
||||
'billing_out_billFAO' => ['name' => 'billing_out_billFAO', 'type' => 'string', 'internal' => 'billFAO'],
|
||||
'billing_out_billAddr' => ['name' => 'billing_out_billAddr', 'type' => 'string', 'internal' => 'billAddress'],
|
||||
'billing_out_billCity' => ['name' => 'billing_out_billCity', 'type' => 'string', 'internal' => 'billCity'],
|
||||
'billing_out_billZip' => ['name' => 'billing_out_billZip', 'type' => 'string', 'internal' => 'billZip'],
|
||||
'billing_out_billCountry' => ['name' => 'billing_out_billCountry', 'type' => 'string', 'internal' => 'billCountry'],
|
||||
'billing_out_gross' => ['name' => 'billing_out_gross', 'type' => 'Serializable', 'internal' => 'gross'],
|
||||
'billing_out_net' => ['name' => 'billing_out_net', 'type' => 'Serializable', 'internal' => 'net'],
|
||||
'billing_out_costs' => ['name' => 'billing_out_costs', 'type' => 'Serializable', 'internal' => 'costs'],
|
||||
'billing_out_profit' => ['name' => 'billing_out_profit', 'type' => 'Serializable', 'internal' => 'profit'],
|
||||
'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' => ['name' => 'billing_out_referral_name', 'type' => 'string', 'internal' => 'referralName'],
|
||||
'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_text' => ['name' => 'billing_out_payment_text', 'type' => 'string', 'internal' => 'paymentText'],
|
||||
'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_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_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_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_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_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_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],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -221,12 +221,10 @@ final class BillMapper extends DataMapperAbstract
|
|||
|
||||
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 getNewestItemInvoices(int $id, int $limit = 10) : array
|
||||
|
|
@ -287,7 +285,7 @@ final class BillMapper extends DataMapperAbstract
|
|||
->groupBy(ClientMapper::getTable() . '_' . $depth . '.clientmgmt_client_id');
|
||||
|
||||
$clients = ClientMapper::getAllByQuery($query, RelationType::ALL, $depth);
|
||||
$data = ClientMapper::getDataLastQuery();
|
||||
$data = ClientMapper::getDataLastQuery();
|
||||
|
||||
return [$clients, $data];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,12 @@ use phpOMS\Stdlib\Base\Enum;
|
|||
abstract class BillStatus extends Enum
|
||||
{
|
||||
public const ACTIVE = 1;
|
||||
|
||||
public const ARCHIVED = 2;
|
||||
|
||||
public const DELETED = 4;
|
||||
|
||||
public const DONE = 8;
|
||||
|
||||
public const DRAFT = 16;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ use phpOMS\Localization\ISO639x1Enum;
|
|||
*/
|
||||
class BillType
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* Id
|
||||
*
|
||||
* @var int
|
||||
|
|
@ -34,7 +34,7 @@ class BillType
|
|||
*/
|
||||
protected int $id = 0;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Localization
|
||||
*
|
||||
* @var int|int[]|BillTypeL11n|BillTypeL11n[]
|
||||
|
|
@ -69,7 +69,7 @@ class BillType
|
|||
* Set l11n
|
||||
*
|
||||
* @param string|BillTypeL11n $l11n Tag article l11n
|
||||
* @param string $lang Language
|
||||
* @param string $lang Language
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
@ -83,7 +83,7 @@ class BillType
|
|||
$this->l11n->name = $l11n;
|
||||
} elseif (\is_string($l11n)) {
|
||||
$this->l11n = new BillTypeL11n();
|
||||
$this->l11n->name = $l11n;
|
||||
$this->l11n->name = $l11n;
|
||||
$this->l11n->setLanguage($lang);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ class BillTypeL11n implements \JsonSerializable, ArrayableInterface
|
|||
* @var int
|
||||
* @since 1.0.0
|
||||
*/
|
||||
protected int|BillType $type = 0;
|
||||
protected int |
|
||||
|
||||
BillType $type = 0;
|
||||
|
||||
/**
|
||||
* Language.
|
||||
|
|
@ -63,12 +65,12 @@ class BillTypeL11n implements \JsonSerializable, ArrayableInterface
|
|||
* Constructor.
|
||||
*
|
||||
* @param int|BillType $type Attribute type
|
||||
* @param string $name Localized name
|
||||
* @param string $name Localized name
|
||||
* @param string $language Language
|
||||
*
|
||||
* @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->name = $name;
|
||||
|
|
@ -146,7 +148,7 @@ class BillTypeL11n implements \JsonSerializable, ArrayableInterface
|
|||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'name' => $this->name,
|
||||
'type' => $this->type,
|
||||
'language' => $this->language,
|
||||
];
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ final class BillTypeL11nMapper extends DataMapperAbstract
|
|||
* @since 1.0.0
|
||||
*/
|
||||
protected static array $columns = [
|
||||
'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_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_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'],
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ namespace Modules\Billing\Models;
|
|||
*/
|
||||
final class NullBillType extends BillType
|
||||
{
|
||||
/**
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param int $id Model id
|
||||
|
|
|
|||
|
|
@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
|
|||
abstract class PermissionState extends Enum
|
||||
{
|
||||
public const SALES_INVOICE = 1;
|
||||
|
||||
public const PURCHASE_INVOICE = 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@
|
|||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
|
||||
$footerView = new \phpOMS\Views\PaginationView($this->l11nManager, $this->request, $this->response);
|
||||
$footerView->setTemplate('/Web/Templates/Lists/Footer/PaginationBig');
|
||||
$footerView->setPages(20);
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ declare(strict_types=1);
|
|||
* @var \phpOMS\Views\View $this
|
||||
*/
|
||||
|
||||
$bill = $this->getData('bill');
|
||||
$bill = $this->getData('bill');
|
||||
$elements = $bill->getElements();
|
||||
|
||||
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><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><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="number" min="0">
|
||||
<td><input type="number" min="0" max="100" step="any">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user