mirror of
https://github.com/Karaka-Management/oms-Billing.git
synced 2026-01-10 14:48:42 +00:00
ui fixes
This commit is contained in:
parent
d194aade27
commit
b4c27b65e9
|
|
@ -285,6 +285,12 @@ final class Installer extends InstallerAbstract
|
|||
->where('name', 'sales_tax_code')
|
||||
->execute();
|
||||
|
||||
/** @var \Modules\Attribute\Models\AttributeType $itemAttributePurchase */
|
||||
$itemAttributePurchase = ItemAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'purchase_tax_code')
|
||||
->execute();
|
||||
|
||||
/** @var \Modules\Attribute\Models\AttributeType $clientAttributeSales */
|
||||
$clientAttributeSales = ClientAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
|
|
@ -298,7 +304,10 @@ final class Installer extends InstallerAbstract
|
|||
->execute();
|
||||
|
||||
foreach ($taxes as $tax) {
|
||||
$itemValue = $itemAttributeSales->getDefaultByValue($tax['item_code']);
|
||||
$itemValue = $tax['type'] === 1
|
||||
? $itemAttributeSales->getDefaultByValue($tax['item_code'])
|
||||
: $itemAttributePurchase->getDefaultByValue($tax['item_code']);
|
||||
|
||||
$accountValue = $tax['type'] === 1
|
||||
? $clientAttributeSales->getDefaultByValue($tax['account_code'])
|
||||
: $supplierAttributeSales->getDefaultByValue($tax['account_code']);
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ return [
|
|||
'dest' => '\Modules\Billing\Controller\ApiBillController:apiMediaRender',
|
||||
'verb' => RouteVerb::GET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -35,6 +36,7 @@ return [
|
|||
'dest' => '\Modules\Billing\Controller\ApiBillController:apiPreviewRender',
|
||||
'verb' => RouteVerb::GET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -47,6 +49,7 @@ return [
|
|||
'dest' => '\Modules\Billing\Controller\ApiPriceController:apiPriceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -59,6 +62,7 @@ return [
|
|||
'dest' => '\Modules\Billing\Controller\ApiPurchaseController:apiInvoiceParse',
|
||||
'verb' => RouteVerb::SET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::MODIFY,
|
||||
|
|
@ -71,6 +75,7 @@ return [
|
|||
'dest' => '\Modules\Billing\Controller\ApiPurchaseController:apiPurchaseBillUpload',
|
||||
'verb' => RouteVerb::SET,
|
||||
'csrf' => true,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -33,6 +34,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -44,6 +46,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesArchive',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -55,6 +58,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingSalesInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -67,6 +71,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -78,6 +83,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -89,6 +95,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseArchive',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -100,6 +107,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -111,6 +119,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingPurchaseInvoiceUpload',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -123,6 +132,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockInvoiceCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -134,6 +144,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -145,6 +156,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockArchive',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -156,6 +168,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewBillingStockInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -168,6 +181,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillDashboard',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -179,6 +193,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillUpload',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -190,6 +205,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivateBillingPurchaseInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -201,6 +217,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillDashboard',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -212,6 +229,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivatePurchaseBillUpload',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -223,6 +241,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPrivateBillingPurchaseInvoice',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -235,6 +254,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPaymentList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -246,6 +266,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewPaymentView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -257,6 +278,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewShippingList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -268,6 +290,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewShippingView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
|
|
@ -280,6 +303,7 @@ return [
|
|||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewTaxCombinationList',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
@ -287,10 +311,23 @@ return [
|
|||
],
|
||||
],
|
||||
],
|
||||
'^/finance/tax/combination/view(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewTaxCombinationView',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::READ,
|
||||
'state' => PermissionCategory::TAX,
|
||||
],
|
||||
],
|
||||
],
|
||||
'^/finance/tax/combination/create(\?.*$|$)' => [
|
||||
[
|
||||
'dest' => '\Modules\Billing\Controller\BackendController:viewTaxCombinationCreate',
|
||||
'verb' => RouteVerb::GET,
|
||||
'active' => true,
|
||||
'permission' => [
|
||||
'module' => BackendController::NAME,
|
||||
'type' => PermissionType::CREATE,
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ final class ApiAttributeController extends Controller
|
|||
use \Modules\Attribute\Controller\ApiAttributeTraitController;
|
||||
|
||||
/**
|
||||
* Api method to create item attribute
|
||||
* Api method to create Attribute
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -217,7 +217,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttribute
|
||||
* Api method to update bill Attribute
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -268,7 +268,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to delete BillAttribute
|
||||
* Api method to delete bill Attribute
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -305,7 +305,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttributeTypeL11n
|
||||
* Api method to update bill AttributeTypeL11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -363,7 +363,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttributeType
|
||||
* Api method to update bill AttributeType
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -393,7 +393,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to delete BillAttributeType
|
||||
* Api method to delete bill AttributeType
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -423,7 +423,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttributeValue
|
||||
* Api method to update bill AttributeValue
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -460,7 +460,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to delete BillAttributeValue
|
||||
* Api method to delete bill AttributeValue
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -491,7 +491,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to update BillAttributeValueL11n
|
||||
* Api method to update bill AttributeValueL11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -521,7 +521,7 @@ final class ApiAttributeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to delete BillAttributeValueL11n
|
||||
* Api method to delete bill AttributeValueL11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
|
|||
|
|
@ -101,6 +101,8 @@ final class ApiBillController extends Controller
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function apiBillEmail(RequestAbstract $request, array $data = []) : void
|
||||
|
|
@ -939,7 +941,7 @@ final class ApiBillController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to validate bill creation from request
|
||||
* Method to validate add Media to bill request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -1539,7 +1541,7 @@ final class ApiBillController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to create bill files
|
||||
* Api method to create Note
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute from request.
|
||||
* Method to create BillType from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -98,7 +98,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate BillType create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -119,7 +119,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Api method to create item attribute l11n
|
||||
* Api method to create BillType l11n
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -146,7 +146,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute l11n from request.
|
||||
* Method to create BillType l11n from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -165,7 +165,7 @@ final class ApiBillTypeController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute l11n create request
|
||||
* Validate BillType l11n create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ final class ApiPriceController extends Controller
|
|||
*/
|
||||
|
||||
/** @var \Modules\Billing\Models\Price\Price[] $prices */
|
||||
$prices = $queryMapper->execute();
|
||||
$prices = $queryMapper->executeGetArray();
|
||||
|
||||
// Find base price
|
||||
$basePrice = null;
|
||||
|
|
@ -247,7 +247,7 @@ final class ApiPriceController extends Controller
|
|||
&& $price->clientsection->id === 0
|
||||
&& $price->clienttype->id === 0
|
||||
&& $price->promocode === ''
|
||||
&& $price->priceNew->value < ($basePrice?->priceNew->value ?? \PHP_INT_MAX)
|
||||
&& $price->priceNew->value < ($basePrice?->priceNew?->value ?? \PHP_INT_MAX)
|
||||
) {
|
||||
$basePrice = $price;
|
||||
}
|
||||
|
|
@ -362,7 +362,7 @@ final class ApiPriceController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute from request.
|
||||
* Method to create Price from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -407,14 +407,14 @@ final class ApiPriceController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate Price create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
* @return array<string, bool>
|
||||
*
|
||||
* @todo consider to prevent name 'default'?
|
||||
* Might not be possible because it is used internally as well (see apiItemCreate in ItemManagement)
|
||||
* Might not be possible because it is used internally as well (see apiItemCreate in ItemManagement)
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ final class ApiPurchaseController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute from request.
|
||||
* Method to upload supplier Bill from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
|
|
@ -203,7 +203,7 @@ final class ApiPurchaseController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate supplier Bill upload request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -284,7 +284,7 @@ final class ApiPurchaseController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate Bill parse request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
|
|||
|
|
@ -126,6 +126,8 @@ final class ApiTaxController extends Controller
|
|||
*
|
||||
* @return void
|
||||
*
|
||||
* @api
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function apiTaxCombinationCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : void
|
||||
|
|
@ -143,7 +145,7 @@ final class ApiTaxController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Method to create item attribute from request.
|
||||
* Method to create TaxCombination from request.
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
@ -169,7 +171,7 @@ final class ApiTaxController extends Controller
|
|||
}
|
||||
|
||||
/**
|
||||
* Validate item attribute create request
|
||||
* Validate TaxCombination create request
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
*
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ use Modules\Billing\Models\SettingsEnum;
|
|||
use Modules\Billing\Models\ShippingTermL11nMapper;
|
||||
use Modules\Billing\Models\ShippingTermMapper;
|
||||
use Modules\Billing\Models\Tax\TaxCombinationMapper;
|
||||
use Modules\ClientManagement\Models\Attribute\ClientAttributeTypeMapper;
|
||||
use Modules\Finance\Models\TaxCodeMapper;
|
||||
use Modules\ItemManagement\Models\Attribute\ItemAttributeTypeMapper;
|
||||
use Modules\SupplierManagement\Models\Attribute\SupplierAttributeTypeMapper;
|
||||
use phpOMS\Account\PermissionType;
|
||||
use phpOMS\Contract\RenderableInterface;
|
||||
use phpOMS\DataStorage\Database\Query\OrderType;
|
||||
|
|
@ -797,6 +801,53 @@ final class BackendController extends Controller
|
|||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which shows the sales dashboard
|
||||
*
|
||||
* @param RequestAbstract $request Request
|
||||
* @param ResponseAbstract $response Response
|
||||
* @param array $data Generic data
|
||||
*
|
||||
* @return RenderableInterface Response can be rendered
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function viewTaxCombinationCreate(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
|
||||
{
|
||||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$view->setTemplate('/Modules/Billing/Theme/Backend/finance-taxcombination-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005103001, $request, $response);
|
||||
|
||||
$view->data['client_codes'] = ClientAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'sales_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['supplier_codes'] = SupplierAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'purchase_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['item_codes_sales'] = ItemAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'sales_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['item_codes_purchase'] = ItemAttributeTypeMapper::get()
|
||||
->with('defaults')
|
||||
->where('name', 'purchase_tax_code')
|
||||
->limit(1)
|
||||
->execute();
|
||||
|
||||
$view->data['tax_codes'] = TaxCodeMapper::getAll()
|
||||
->executeGetArray();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method which shows the sales dashboard
|
||||
*
|
||||
|
|
@ -814,11 +865,13 @@ final class BackendController extends Controller
|
|||
$view->setTemplate('/Modules/Billing/Theme/Backend/finance-taxcombination-view');
|
||||
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1005103001, $request, $response);
|
||||
|
||||
$view->data['taxcombination'] = TaxCombinationMapper::getAll()
|
||||
$view->data['taxcombination'] = TaxCombinationMapper::get()
|
||||
->with('clientCode')
|
||||
->with('supplierCode')
|
||||
->with('itemCode')
|
||||
->executeGetArray();
|
||||
->with('taxCode')
|
||||
->where('id', (int) $request->getData('id'))
|
||||
->execute();
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use Modules\ItemManagement\Models\ItemMapper;
|
|||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* Billelement mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ use Modules\SupplierManagement\Models\SupplierMapper;
|
|||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* Bill mapper class.
|
||||
*
|
||||
* WARNING: This mapper may use a trigger to update the sequence number on insert.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* Item mapper class.
|
||||
* PaymentTermL11n mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11nType;
|
||||
|
||||
/**
|
||||
* Item mapper class.
|
||||
* PaymentTerm mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use phpOMS\Localization\Defaults\CountryMapper;
|
|||
use phpOMS\Stdlib\Base\FloatInt;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* PurchaseBill mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ use phpOMS\DataStorage\Database\Query\OrderType;
|
|||
use phpOMS\Stdlib\Base\FloatInt;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* SalesBill mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11n;
|
||||
|
||||
/**
|
||||
* Item mapper class.
|
||||
* ShippingTermL11n mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
|||
use phpOMS\Localization\BaseStringL11nType;
|
||||
|
||||
/**
|
||||
* Item mapper class.
|
||||
* ShippingTerm mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Modules\Billing\Models;
|
|||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* StockBill mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace Modules\Billing\Models;
|
|||
use phpOMS\DataStorage\Database\Mapper\DataMapperFactory;
|
||||
|
||||
/**
|
||||
* Mapper class.
|
||||
* Subscription mapper class.
|
||||
*
|
||||
* @package Modules\Billing\Models
|
||||
* @license OMS License 2.0
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ return ['Billing' => [
|
|||
'Files' => 'Files',
|
||||
'TaxCode' => 'Steuerkz.',
|
||||
'PL' => 'GuV',
|
||||
':combinationtype-1' => 'Verkauf',
|
||||
':combinationtype-2' => 'Einkauf',
|
||||
'PLAccount' => 'GuV-Konto',
|
||||
'Tax1Account' => 'Steuerkonto 1',
|
||||
'Tax2Account' => 'Steuerkonto 2',
|
||||
'TaxCombinations' => 'Steuerkomb.',
|
||||
'PaymentTerms' => 'Zahlungsbedingungen',
|
||||
'ShippingTerms' => 'Lieferbedingungen',
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ return ['Billing' => [
|
|||
'Files' => 'Files',
|
||||
'TaxCode' => 'Tax Code',
|
||||
'PL' => 'PL',
|
||||
':combinationtype-1' => 'Sales',
|
||||
':combinationtype-2' => 'Purchase',
|
||||
'PLAccount' => 'PL Account',
|
||||
'Tax1Account' => 'Tax Account 1',
|
||||
'Tax2Account' => 'Tax Account 2',
|
||||
'TaxCombinations' => 'Tax Combinations',
|
||||
'PaymentTerms' => 'Payment Terms',
|
||||
'ShippingTerms' => 'Shipping Terms',
|
||||
|
|
|
|||
146
Theme/Backend/finance-taxcombination-view.tpl.php
Normal file
146
Theme/Backend/finance-taxcombination-view.tpl.php
Normal file
|
|
@ -0,0 +1,146 @@
|
|||
<?php
|
||||
/**
|
||||
* Jingga
|
||||
*
|
||||
* PHP Version 8.2
|
||||
*
|
||||
* @package Modules\Accounting
|
||||
* @copyright Dennis Eichhorn
|
||||
* @license OMS License 2.0
|
||||
* @version 1.0.0
|
||||
* @link https://jingga.app
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Modules\Billing\Models\Tax\BillTaxType;
|
||||
use Modules\Billing\Models\Tax\NullTaxCombination;
|
||||
use phpOMS\Uri\UriFactory;
|
||||
|
||||
$taxcombination = $this->data['taxcombination'] ?? new NullTaxCombination();
|
||||
$isNew = $taxcombination->id === 0;
|
||||
|
||||
$combinationType = BillTaxType::getConstants();
|
||||
|
||||
/** @var \phpOMS\Views\View $this */
|
||||
echo $this->data['nav']->render(); ?>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<section class="portlet">
|
||||
<form method="<?= $isNew ? 'PUT' : 'POST'; ?>" action="<?= UriFactory::build('{/api}finance/tax/combination?csrf={$CSRF}'); ?>">
|
||||
<div class="portlet-head"><?= $this->getHtml('TaxCode'); ?></div>
|
||||
<div class="portlet-body">
|
||||
<div class="form-group">
|
||||
<label for="iId"><?= $this->getHtml('ID', '0', '0'); ?></label>
|
||||
<input type="text" name="id" id="iId" value="<?= $taxcombination->id; ?>" disabled>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iType"><?= $this->getHtml('Type'); ?></label>
|
||||
<select id="iType" name="type"
|
||||
data-action='[
|
||||
{"key": 1, "listener": "change", "action": [
|
||||
{"key": 1, "type": "dom.get", "base": "", "selector": "#iType"},
|
||||
{"key": 2, "type": "if", "conditions": [
|
||||
{
|
||||
"comp": "==",
|
||||
"value": "1",
|
||||
"jump": 3
|
||||
},
|
||||
{
|
||||
"comp": "==",
|
||||
"value": "2",
|
||||
"jump": 8
|
||||
}
|
||||
]},
|
||||
{"key": 3, "type": "dom.attr.change", "subtype": "add", "attr": "class", "value": "vh", "base": "", "selector": "#iSupplierGroup"},
|
||||
{"key": 4, "type": "dom.attr.change", "subtype": "add", "attr": "class", "value": "vh", "base": "", "selector": "#iItemPurchaseGroup"},
|
||||
{"key": 5, "type": "dom.attr.change", "subtype": "remove", "attr": "class", "value": "vh", "base": "", "selector": "#iItemSalesGroup"},
|
||||
{"key": 6, "type": "dom.attr.change", "subtype": "remove", "attr": "class", "value": "vh", "base": "", "selector": "#iClientGroup"},
|
||||
{"key": 7, "type": "jump", "jump": 12},
|
||||
{"key": 8, "type": "dom.attr.change", "subtype": "add", "attr": "class", "value": "vh", "base": "", "selector": "#iClientGroup"},
|
||||
{"key": 9, "type": "dom.attr.change", "subtype": "add", "attr": "class", "value": "vh", "base": "", "selector": "#iItemSalesGroup"},
|
||||
{"key": 10, "type": "dom.attr.change", "subtype": "remove", "attr": "class", "value": "vh", "base": "", "selector": "#iItemPurchaseGroup"},
|
||||
{"key": 11, "type": "dom.attr.change", "subtype": "remove", "attr": "class", "value": "vh", "base": "", "selector": "#iSupplierGroup"}
|
||||
]}
|
||||
]'>
|
||||
<?php foreach ($combinationType as $type) : ?>
|
||||
<option value="<?= $type; ?>"<?= $taxcombination->taxType === $type ? ' selected': ''; ?>><?= $this->getHtml(':combinationtype-' . $type); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="iClientGroup" class="form-group<?= $taxcombination->taxType === BillTaxType::PURCHASE ? ' vh' : ''; ?>">
|
||||
<label for="iClient"><?= $this->getHtml('Client'); ?></label>
|
||||
<select id="iClient" name="account_code">
|
||||
<option value=""<?= $taxcombination->clientCode === null ? ' selected' : ''; ?>>
|
||||
<?php foreach ($this->data['client_codes']->defaults as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->clientCode?->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->getValue()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="iItemSalesGroup" class="form-group<?= $taxcombination->taxType === BillTaxType::PURCHASE ? ' vh' : ''; ?>">
|
||||
<label for="iItemSales"><?= $this->getHtml('Item'); ?></label>
|
||||
<select id="iItemSales" name="item_code">
|
||||
<option value=""<?= $taxcombination->itemCode === null ? ' selected' : ''; ?>>
|
||||
<?php foreach ($this->data['item_codes_sales']->defaults as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->itemCode?->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->getValue()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="iSupplierGroup" class="form-group<?= $taxcombination->taxType === BillTaxType::SALES ? ' vh' : ''; ?>">
|
||||
<label for="iSupplier"><?= $this->getHtml('Supplier'); ?></label>
|
||||
<select id="iSupplier" name="account_code">
|
||||
<option value=""<?= $taxcombination->supplierCode === null ? ' selected' : ''; ?>>
|
||||
<?php foreach ($this->data['supplier_codes']->defaults as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->supplierCode?->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->getValue()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="iItemPurchaseGroup" class="form-group<?= $taxcombination->taxType === BillTaxType::SALES ? ' vh' : ''; ?>">
|
||||
<label for="iItemPurchase"><?= $this->getHtml('Item'); ?></label>
|
||||
<select id="iItemPurchase" name="item_code">
|
||||
<option value=""<?= $taxcombination->itemCode === null ? ' selected' : ''; ?>>
|
||||
<?php foreach ($this->data['item_codes_purchase']->defaults as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->itemCode->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->getValue()); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iTaxCode"><?= $this->getHtml('TaxCode'); ?></label>
|
||||
<select id="iTaxCode" name="tax_code">
|
||||
<?php foreach ($this->data['tax_codes'] as $code) : ?>
|
||||
<option value="<?= $code->id; ?>"<?= $taxcombination->taxCode->id === $code->id ? ' selected': ''; ?>><?= $this->printHtml($code->abbr); ?>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iPLAccount"><?= $this->getHtml('PLAccount'); ?></label>
|
||||
<input type="text" name="account" id="iPLAccount" value="<?= $this->printHtml($taxcombination->taxAccount1); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iTax1Account"><?= $this->getHtml('Tax1Account'); ?></label>
|
||||
<input type="text" name="tax1" id="iTax1Account" value="<?= $this->printHtml($taxcombination->taxAccount1); ?>">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="iTax2Account"><?= $this->getHtml('Tax2Account'); ?></label>
|
||||
<input type="text" name="tax2" id="iTax2Account" value="<?= $this->printHtml($taxcombination->taxAccount2); ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-foot">
|
||||
<?php if ($isNew) : ?>
|
||||
<input id="iCreateSubmit" type="Submit" value="<?= $this->getHtml('Create', '0', '0'); ?>">
|
||||
<?php else : ?>
|
||||
<input id="iSaveSubmit" type="Submit" value="<?= $this->getHtml('Save', '0', '0'); ?>">
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user