mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 04:24:12 +00:00
Merge branch 'dillon/90-e-invoice-shipping-portal-e' into dillon/90-e-invoice-shipping-portal-b-2
This commit is contained in:
@@ -66,3 +66,7 @@ COMMANDS_V2_ENABLED=false
|
||||
|
||||
STORAGE_FEE_LAUNCH_DATE="2023-12-11 00:00:00"
|
||||
SST_START_DATE="2024-04-01 00:00:00"
|
||||
|
||||
E_INVOICE_START_DATE="2025-07-01 00:00:00"
|
||||
MAINTENANCE_MESSAGE_TITLE="We'll be back online on 00:00 1/7/2025"
|
||||
MAINTENANCE_MESSAGE="Sorry for the inconvenience but we're performing some maintenance at the moment."
|
||||
|
||||
@@ -23,7 +23,7 @@ class AddressObject implements DataTransferObject
|
||||
/** @var int */
|
||||
private $districtId;
|
||||
|
||||
/** @var int */
|
||||
/** @var string */
|
||||
private $postCode;
|
||||
|
||||
/** @var int */
|
||||
@@ -42,12 +42,12 @@ class AddressObject implements DataTransferObject
|
||||
* @param int $countryId
|
||||
* @param int $stateId
|
||||
* @param int $districtId
|
||||
* @param int $postCode
|
||||
* @param string $postCode
|
||||
* @param int $type
|
||||
* @param int $status
|
||||
* @param null|string $reference
|
||||
*/
|
||||
public function __construct(string $streetOne, ?string $streetTwo, int $countryId, int $stateId, int $districtId, int $postCode, int $type, int $status, ?string $reference = null)
|
||||
public function __construct(string $streetOne, ?string $streetTwo, int $countryId, int $stateId, int $districtId, string $postCode, int $type, int $status, ?string $reference = null)
|
||||
{
|
||||
$this->streetOne = $streetOne;
|
||||
$this->streetTwo = $streetTwo;
|
||||
@@ -101,9 +101,9 @@ class AddressObject implements DataTransferObject
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
* @return string
|
||||
*/
|
||||
public function getPostCode(): int
|
||||
public function getPostCode(): string
|
||||
{
|
||||
return $this->postCode;
|
||||
}
|
||||
@@ -133,4 +133,4 @@ class AddressObject implements DataTransferObject
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,12 +8,19 @@ use App\Classes\Modules\Companies\Services\UpdatesCompanyDebtor;
|
||||
use App\Classes\Modules\Addresses\Services\UpsertsAddress;
|
||||
use App\Classes\Modules\Addresses\Services\FetchesDistrict;
|
||||
use App\Classes\Modules\Companies\Services\UpdatesCompanyModuleName;
|
||||
use App\Classes\Modules\Addresses\Standards\Rules\CanCreateAddress;
|
||||
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
|
||||
use App\Classes\Modules\Documents\Services\FetchesDocument;
|
||||
use App\Classes\Modules\Documents\Services\UpdatesDocumentReference;
|
||||
use App\Classes\Modules\Documents\Services\CreatesDocument;
|
||||
use App\Classes\Modules\Documents\Services\CreatesFiles;
|
||||
use App\Classes\Modules\Companies\Services\UpdatesCompanyEInvoiceInfo;
|
||||
use App\Classes\Modules\Companies\Standards\Rules\CanUpdateCompany;
|
||||
use App\Classes\Modules\Addresses\Standards\Rules\CanCreateAddress;
|
||||
use App\Classes\Modules\Addresses\DataTransferObjects\AddressObject;
|
||||
use App\Classes\Modules\Companies\DataTransferObjects\CompanyObject;
|
||||
use App\Classes\Modules\Companies\DataTransferObjects\UpdateCompanyDetailsDTO;
|
||||
use App\Classes\Modules\Documents\DataTransferObjects\DocumentObject;
|
||||
use App\Classes\ValueObjects\Constants\CompanyType;
|
||||
use App\Classes\ValueObjects\Constants\DocumentType;
|
||||
use App\Classes\ValueObjects\Constants\AddressType;
|
||||
use App\Classes\ValueObjects\Constants\ApprovalStatus;
|
||||
use App\Http\Resources\CompanyResource;
|
||||
@@ -59,6 +66,19 @@ class UpdateCompanyDetailsLogic extends AbstractControllerLogic
|
||||
/** @var UpdatesCompanyModuleName */
|
||||
private $updatesCompanyModuleName;
|
||||
|
||||
/** @var FetchesDocument */
|
||||
private $fetchesDocument;
|
||||
|
||||
/** @var UpdatesDocumentReference */
|
||||
private $updatesDocumentReference;
|
||||
|
||||
/** @var CreatesDocument */
|
||||
private $createsDocument;
|
||||
|
||||
/** @var CreatesFiles */
|
||||
private $createsFile;
|
||||
|
||||
|
||||
/**
|
||||
* UpdateCompanyDetailsLogic constructor.
|
||||
* @param CanUpdateCompany $canUpdateCompany
|
||||
@@ -69,7 +89,10 @@ class UpdateCompanyDetailsLogic extends AbstractControllerLogic
|
||||
* @param FetchesDistrict $fetchesDistrict
|
||||
* @param UpsertsAddress $upsertsAddress
|
||||
* @param UpdatesCompanyEInvoiceInfo $updatesCompanyEInvoiceInfo;
|
||||
* @param UpdatesCompanyModuleName $updatesCompanyModuleName
|
||||
* @param FetchesDocument $fetchesDocument
|
||||
* @param UpdatesDocumentReference $updatesDocumentReference
|
||||
* @param CreatesDocument $createsDocument
|
||||
* @param CreatesFiles $createsFile
|
||||
*/
|
||||
public function __construct(
|
||||
CanUpdateCompany $canUpdateCompany,
|
||||
@@ -80,7 +103,11 @@ class UpdateCompanyDetailsLogic extends AbstractControllerLogic
|
||||
FetchesDistrict $fetchesDistrict,
|
||||
UpsertsAddress $upsertsAddress,
|
||||
UpdatesCompanyEInvoiceInfo $updatesCompanyEInvoiceInfo,
|
||||
UpdatesCompanyModuleName $updatesCompanyModuleName
|
||||
UpdatesCompanyModuleName $updatesCompanyModuleName,
|
||||
FetchesDocument $fetchesDocument,
|
||||
UpdatesDocumentReference $updatesDocumentReference,
|
||||
CreatesDocument $createsDocument,
|
||||
CreatesFiles $createsFile
|
||||
)
|
||||
{
|
||||
$this->canUpdateCompany = $canUpdateCompany;
|
||||
@@ -92,6 +119,10 @@ class UpdateCompanyDetailsLogic extends AbstractControllerLogic
|
||||
$this->upsertsAddress = $upsertsAddress;
|
||||
$this->updatesCompanyEInvoiceInfo = $updatesCompanyEInvoiceInfo;
|
||||
$this->updatesCompanyModuleName = $updatesCompanyModuleName;
|
||||
$this->fetchesDocument = $fetchesDocument;
|
||||
$this->updatesDocumentReference = $updatesDocumentReference;
|
||||
$this->createsDocument = $createsDocument;
|
||||
$this->createsFile = $createsFile;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -127,6 +158,32 @@ class UpdateCompanyDetailsLogic extends AbstractControllerLogic
|
||||
$this->updatesCompanyEInvoiceInfo->execute($company, $dto->tin, $dto->msicCode);
|
||||
}
|
||||
|
||||
//Update Identification Card / SSM Registration
|
||||
if($dto->identificationId){
|
||||
$document = $this->fetchesDocument->execute(['id' => $dto->identificationId]);
|
||||
$this->updatesDocumentReference->execute($document, $dto->identificationReference);
|
||||
}
|
||||
else{
|
||||
if($dto->identificationReference){
|
||||
$pathToFile = base_path('resources/assets/images/ssm_ic_placeholder.png');
|
||||
$mimeType = mime_content_type($pathToFile);
|
||||
$fileContents = file_get_contents($pathToFile);
|
||||
$base64 = base64_encode($fileContents);
|
||||
$base64File = "data:$mimeType;base64,$base64";
|
||||
$files = [$base64File];
|
||||
|
||||
/** @var Document $document */
|
||||
$company = $this->fetchesCompany->execute(['id' => $dto->id]);
|
||||
|
||||
$object = new DocumentObject($company->type === CompanyType::COMPANY_BUSINESS ?
|
||||
DocumentType::SSM_REGISTRATION : DocumentType::IDENTITY_CARD, $files,
|
||||
$dto->identificationReference, ApprovalStatus::PENDING_VERIFICATION, 'identifications');
|
||||
|
||||
$document = $this->createsDocument->execute($company, $object);
|
||||
$this->createsFile->execute($document, $object);
|
||||
}
|
||||
}
|
||||
|
||||
return $this->resourceResponse(new CompanyResource($company));
|
||||
}
|
||||
}
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Classes\Modules\Companies\ControllersLogic;
|
||||
|
||||
|
||||
use App\Classes\General\Abstracts\AbstractControllerLogic;
|
||||
use App\Classes\Modules\Companies\Services\UpdatesCompanyEInvoiceRequest;
|
||||
use App\Classes\Modules\Companies\Services\FetchesCompanyModule;
|
||||
use App\Classes\Modules\Companies\DataTransferObjects\EInvoiceRequestDTO;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class UpdateCompanyEInvoiceRequestChangeLogic extends AbstractControllerLogic
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
protected function notification():array {
|
||||
return [
|
||||
'title' => 'Updated EInvoice Request',
|
||||
'message' => 'You have successfully updated company E-Invoice request'
|
||||
];
|
||||
}
|
||||
|
||||
/** @var FetchesCompanyModule */
|
||||
private $fetchesCompanyModule;
|
||||
|
||||
/** @var UpdatesCompanyEInvoiceRequest */
|
||||
private $updatesCompanyEInvoiceRequest;
|
||||
|
||||
|
||||
/**
|
||||
* UpdateCompanyEInvoiceRequestChangeLogic constructor.
|
||||
* @param FetchesCompanyModule $fetchesCompanyModule
|
||||
* @param UpdatesCompanyEInvoiceRequest $updatesCompanyEInvoiceRequest
|
||||
*/
|
||||
public function __construct(FetchesCompanyModule $fetchesCompanyModule, UpdatesCompanyEInvoiceRequest $updatesCompanyEInvoiceRequest)
|
||||
{
|
||||
$this->fetchesCompanyModule = $fetchesCompanyModule;
|
||||
$this->updatesCompanyEInvoiceRequest = $updatesCompanyEInvoiceRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @return JsonResponse
|
||||
* @throws \App\Classes\Exceptions\AccessForbiddenException
|
||||
* @throws \App\Classes\Exceptions\MalformedRequestException
|
||||
* @throws \App\Classes\Exceptions\RequestValidationException
|
||||
*/
|
||||
public function logic(Request $request) : JsonResponse
|
||||
{
|
||||
$dto = new EInvoiceRequestDTO($request->all());
|
||||
$companyModule = $this->fetchesCompanyModule->execute(['id' => $dto->companyModuleId]);
|
||||
|
||||
if($companyModule->company->e_invoice === 1){
|
||||
$this->updatesCompanyEInvoiceRequest->execute($companyModule->company, $dto->eInvoiceRequest);
|
||||
}
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ class EInvoiceInfoDTO implements DataTransferObject
|
||||
public int $companyModuleId;
|
||||
public string $streetOne;
|
||||
public string $streetTwo;
|
||||
public int $postCode;
|
||||
public string $postCode;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
@@ -24,7 +24,7 @@ class EInvoiceInfoDTO implements DataTransferObject
|
||||
$this->companyModuleId = (int) ($data['company_module_id'] ?? 0);
|
||||
$this->streetOne = (string) ($data['street_one'] ?? '');
|
||||
$this->streetTwo = (string) ($data['street_two'] ?? '');
|
||||
$this->postCode = (int) ($data['post_code'] ?? 0);
|
||||
$this->postCode = (string) ($data['post_code'] ?? '');
|
||||
}
|
||||
|
||||
public function toArray(): array
|
||||
|
||||
@@ -20,7 +20,10 @@ class UpdateCompanyDetailsDTO implements DataTransferObject
|
||||
public int $companyId;
|
||||
public string $streetOne;
|
||||
public string $streetTwo;
|
||||
public int $postCode;
|
||||
public string $postCode;
|
||||
|
||||
public string $identificationReference;
|
||||
public int $identificationId;
|
||||
|
||||
public function __construct(array $data)
|
||||
{
|
||||
@@ -38,7 +41,9 @@ class UpdateCompanyDetailsDTO implements DataTransferObject
|
||||
$this->companyId = (int) ($data['company_id'] ?? 0);
|
||||
$this->streetOne = (string) ($data['street_one'] ?? '');
|
||||
$this->streetTwo = (string) ($data['street_two'] ?? '');
|
||||
$this->postCode = (int) ($data['post_code'] ?? 0);
|
||||
$this->postCode = (string) ($data['post_code'] ?? '');
|
||||
$this->identificationReference = (string) ($data['identification_reference'] ?? '');
|
||||
$this->identificationId = (int) ($data['identification_id'] ?? 0);
|
||||
}
|
||||
|
||||
public function toArray(): array
|
||||
@@ -59,6 +64,9 @@ class UpdateCompanyDetailsDTO implements DataTransferObject
|
||||
'street_one' => $this->streetOne,
|
||||
'street_two' => $this->streetTwo,
|
||||
'post_code' => $this->postCode,
|
||||
|
||||
'identification_reference' => $this->identificationReference,
|
||||
'identification_id' => $this->identificationId,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,12 +17,18 @@ class UpdatesCompanyEInvoiceRequest extends AbstractUpdateRecord
|
||||
*/
|
||||
public function execute(Company $model, bool $eInvoice)
|
||||
{
|
||||
if (is_null($model->e_invoice_requested_at)) {
|
||||
if($eInvoice){
|
||||
$model->e_invoice_requested_at = now();
|
||||
if($eInvoice){
|
||||
if (is_null($model->e_invoice_requested_at)) {
|
||||
if($eInvoice){
|
||||
$model->e_invoice_requested_at = now();
|
||||
}
|
||||
}
|
||||
$model->e_invoice = 1;
|
||||
}
|
||||
else{
|
||||
$model->e_invoice_requested_at = null;
|
||||
$model->e_invoice = 0;
|
||||
}
|
||||
$model->e_invoice = $eInvoice;
|
||||
|
||||
return $this->handler($model);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ class ExportsAllCustomersInfoForLarkSystem implements FromQuery, WithMapping, Wi
|
||||
'Email',
|
||||
'Registration Date',
|
||||
'Last Order Date',
|
||||
'Debtor Code',
|
||||
'Credit Term Customer',
|
||||
'Custom Segments',
|
||||
];
|
||||
}
|
||||
@@ -45,6 +47,10 @@ class ExportsAllCustomersInfoForLarkSystem implements FromQuery, WithMapping, Wi
|
||||
{
|
||||
$companyModule = $company->companyModules->first();
|
||||
$marking = $companyModule ? $companyModule->getMarking() : '';
|
||||
$creditTermCustomer = '';
|
||||
if ($companyModule && $companyModule->connections->first()) {
|
||||
$creditTermCustomer = $companyModule->connections->first()->is_credit_term ? 'YES' : 'NO';
|
||||
}
|
||||
|
||||
$employeeEmail = '';
|
||||
if ($companyModule && $companyModule->employees->first()) {
|
||||
@@ -68,6 +74,8 @@ class ExportsAllCustomersInfoForLarkSystem implements FromQuery, WithMapping, Wi
|
||||
$employeeEmail,
|
||||
$company->created_at ? $company->created_at->toDateString() : '',
|
||||
$company->updated_at ? $company->updated_at->toDateString() : '',
|
||||
$company->debtor,
|
||||
$creditTermCustomer,
|
||||
$segments,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Companies;
|
||||
|
||||
use App\Classes\Modules\Companies\ControllersLogic\UpdateCompanyEInvoiceInfoLogic;
|
||||
use App\Classes\Modules\Companies\ControllersLogic\UpdateCompanyEInvoiceRequestLogic;
|
||||
use App\Classes\Modules\Companies\ControllersLogic\UpdateCompanyEInvoiceRequestChangeLogic;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@@ -18,7 +19,7 @@ class UpdateCompanyEInvoiceInfoController
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param UpdateCompanyEInvoiceRequestLogic $logic
|
||||
* @return JsonResponse
|
||||
@@ -26,4 +27,13 @@ class UpdateCompanyEInvoiceInfoController
|
||||
public function updateRequest(Request $request, UpdateCompanyEInvoiceRequestLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
* @param UpdateCompanyEInvoiceRequestChangeLogic $logic
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function updateChangeOfMindRequest(Request $request, UpdateCompanyEInvoiceRequestChangeLogic $logic): JsonResponse {
|
||||
return $logic->execute($request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,5 +75,6 @@ class Kernel extends HttpKernel
|
||||
'storage.invoice.check.bytransactions' => \App\Http\Middleware\CheckForStorageInvoiceByTransactions::class,
|
||||
'storage.invoice.check.bygroup' => \App\Http\Middleware\CheckForStorageInvoiceByGroup::class,
|
||||
'storage.invoice.check.bypackinglists' => \App\Http\Middleware\CheckForStorageInvoiceByPackingLists::class,
|
||||
'admin' => \App\Http\Middleware\EnsureUserIsAdmin::class, //cief todo: 90 - maintenance
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Classes\ValueObjects\Constants\RoleTypes;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Tymon\JWTAuth\Facades\JWTAuth;
|
||||
|
||||
class EnsureUserIsAdmin
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
|
||||
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function handle(Request $request, Closure $next)
|
||||
{
|
||||
$maintenanceTitle = env('MAINTENANCE_MESSAGE_TITLE', null);
|
||||
if (!empty($maintenanceTitle)) {
|
||||
$user = JWTAuth::parseToken()->authenticate();
|
||||
if(!in_array($user->type, RoleTypes::ADMIN_ROLES)){
|
||||
return response()->view('errors.503', [], 503);
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class AddressEInvoiceResource extends JsonResource
|
||||
'street_two' => $this->street_two,
|
||||
'district' => $this->district,
|
||||
'state' => $this->state,
|
||||
'post_code' => (int) $this->postcode,
|
||||
'post_code' => (string) $this->postcode,
|
||||
'country' => $this->country,
|
||||
'billing' => (int) $this->billing
|
||||
];
|
||||
|
||||
@@ -20,7 +20,7 @@ class EInvoiceInfoResource extends JsonResource
|
||||
'street_two' => $this->street_two,
|
||||
'district' => $this->district,
|
||||
'state' => $this->state,
|
||||
'post_code' => (int) $this->postcode,
|
||||
'post_code' => (string) $this->postcode,
|
||||
'country' => $this->country,
|
||||
'billing' => (int) $this->billing,
|
||||
'msic_code' => (string) $this->msic_code,
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'title' => env('MAINTENANCE_MESSAGE_TITLE', "We'll be back soon!"),
|
||||
'message' => env('MAINTENANCE_MESSAGE', "Sorry for the inconvenience but we're performing some maintenance at the moment."),
|
||||
];
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
@@ -54,7 +54,7 @@
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
<div class="col-5 p-l-5">
|
||||
<validation-wrapper-component :validator="$v.parameters.post_code" v-money="integer">
|
||||
<validation-wrapper-component :validator="$v.parameters.post_code">
|
||||
<label class="text-primary">Post Code</label>
|
||||
<input class="form-control" name="post_code" v-model="parameters.post_code">
|
||||
</validation-wrapper-component>
|
||||
@@ -81,6 +81,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col text-right">
|
||||
<a
|
||||
id="e-invoice-request-link"
|
||||
href="javascript:void(0);"
|
||||
class="fs-12 text-complete text-underline pointer"
|
||||
@click="updateChangeOfMind()"
|
||||
>
|
||||
I don't need now
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" v-if="step === 2">
|
||||
@@ -207,7 +219,7 @@
|
||||
? {
|
||||
required,
|
||||
alphaNum,
|
||||
minLength: minLength(11),
|
||||
minLength: minLength(10), //was 11
|
||||
maxLength: maxLength(13)
|
||||
}
|
||||
: {}),
|
||||
@@ -216,7 +228,7 @@
|
||||
required,
|
||||
alphaNum,
|
||||
minLength: minLength(10),
|
||||
maxLength: maxLength(12)
|
||||
maxLength: maxLength(13) ///was 12
|
||||
}
|
||||
: {})
|
||||
},
|
||||
@@ -239,6 +251,10 @@
|
||||
successHandler(response){
|
||||
this.$emit('eInvoiceInfoUpdated', response.payload.data);
|
||||
this.closeModal();
|
||||
},
|
||||
updateChangeOfMind(){
|
||||
this.$emit('eInvoiceChangeOfMindRequest');
|
||||
this.closeModal();
|
||||
}
|
||||
},
|
||||
mixins: [ModalFormHandler],
|
||||
|
||||
+30
-19
@@ -101,7 +101,7 @@
|
||||
:company-module-id="company.company_module.id"
|
||||
:company-type="company.type"
|
||||
v-on:eInvoiceInfoUpdated="updatedEInvoiceInfo($event)"
|
||||
v-on:close="createAddress = !createAddress">
|
||||
v-on:eInvoiceChangeOfMindRequest="changeOfMindEInvoiceRequest()">
|
||||
</e-invoice-info-form-component>
|
||||
</modal-component>
|
||||
</div>
|
||||
@@ -135,7 +135,8 @@
|
||||
return {
|
||||
section: 'orderListSection',
|
||||
isLoading: true,
|
||||
company: null
|
||||
company: null,
|
||||
parameters : {}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -163,25 +164,30 @@
|
||||
this.isLoading = false;
|
||||
this.company = response.payload.data;
|
||||
|
||||
if(!this.$store.getters.isAdmin){
|
||||
if(this.company.company_module.e_invoice === null){
|
||||
this.$nextTick(() => {
|
||||
$('#modal-einvoice-request').modal('show');
|
||||
});
|
||||
}
|
||||
else if( this.company.company_module.e_invoice && (this.company.company_module.tin === null || this.company.company_module.msic_code === null) )
|
||||
{
|
||||
this.$nextTick(() => {
|
||||
$('#modal-einvoice-info').modal('show');
|
||||
});
|
||||
}
|
||||
if(section == this.section + 'ChangeOfMind'){
|
||||
this.$store.dispatch('reloadList', {'name': this.section});
|
||||
}
|
||||
else{
|
||||
if( this.company.company_module.e_invoice && (this.company.company_module.tin === null || this.company.company_module.msic_code === null) )
|
||||
{
|
||||
this.$nextTick(() => {
|
||||
$('#modal-einvoice-info').modal('show');
|
||||
});
|
||||
if(!this.$store.getters.isAdmin){
|
||||
if(this.company.company_module.e_invoice === null){
|
||||
this.$nextTick(() => {
|
||||
$('#modal-einvoice-request').modal('show');
|
||||
});
|
||||
}
|
||||
else if( this.company.company_module.e_invoice && (this.company.company_module.tin === null || this.company.company_module.msic_code === null) )
|
||||
{
|
||||
this.$nextTick(() => {
|
||||
$('#modal-einvoice-info').modal('show');
|
||||
});
|
||||
}
|
||||
}
|
||||
else{
|
||||
if( this.company.company_module.e_invoice && (this.company.company_module.tin === null || this.company.company_module.msic_code === null) )
|
||||
{
|
||||
this.$nextTick(() => {
|
||||
$('#modal-einvoice-info').modal('show');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -193,6 +199,11 @@
|
||||
updatedEInvoiceInfo(info){
|
||||
this.$store.dispatch('reloadList', {'name': this.section});
|
||||
},
|
||||
changeOfMindEInvoiceRequest(){
|
||||
this.parameters.company_module_id = this.company.company_module.id;
|
||||
this.parameters.e_invoice_request = false;
|
||||
this.submit((this.route('api.company.einvoice.request.change')), 'post', this.section + 'ChangeOfMind', true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<small class="bold" v-for="(object, param) in validator.$params" v-if="!validator[param]">
|
||||
{{errorMessages[param]}}
|
||||
<span v-if="object && object.type === 'minLength'">{{object.min}} characters</span>
|
||||
<span v-if="object && object.type === 'maxLength'">{{object.max}} characters</span>
|
||||
<span v-if="object && object.type === 'sameAs'">{{object.eq}} field</span>
|
||||
<span v-if="object && object.type === 'minValue'">{{object.min}}</span>
|
||||
<span v-if="object && object.type === 'maxValue'">{{errorMessages[param]}} {{object.max}}</span>
|
||||
@@ -25,6 +26,7 @@
|
||||
required: 'this field is required',
|
||||
email: 'enter a valid email address',
|
||||
minLength: 'this field must have at least',
|
||||
maxLength: 'this field must have at most',
|
||||
minValue: 'this field must at least be',
|
||||
sameAs: 'this field must match the',
|
||||
numeric: 'this field can only contain numbers',
|
||||
|
||||
+17
-4
@@ -30,6 +30,16 @@
|
||||
<div class="b-grey b-a w-100 text-center p-l-15 p-r-15 p-t-10 p-b-10 pointer fs-15" :class="[{'b-primary': parameters.type === 1}]" @click="updateType(1)">Company<br>Business</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-b-15">
|
||||
<div class="col">
|
||||
<validation-wrapper-component :validator="$v.parameters.identification_reference">
|
||||
<label class="text-primary">{{ data.type === 0 ? 'Identification Card' : 'SSM Registration' }}</label>
|
||||
<input class="form-control" v-model="parameters.identification_reference">
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row m-b-5" v-if="data.company_module.e_invoice !== 0 && data.company_module.e_invoice !== null">
|
||||
<div class="col">
|
||||
E-Invoice Info
|
||||
@@ -85,7 +95,7 @@
|
||||
<div class="row m-b-15">
|
||||
<div class="col-6 p-r-5">
|
||||
<validation-wrapper-component selectable :validator="$v.parameters.state_id">
|
||||
<label>State</label>
|
||||
<label class="text-primary">State</label>
|
||||
<selectable-component :endpoint="route('api.address.state.list')" section="stateListSection" valueColumn="id" :labelColumn="['name']" v-model="parameters.state_id"></selectable-component>
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
@@ -142,6 +152,8 @@
|
||||
district_id: this.data.company_module.address_einvoice ? this.data.company_module.address_einvoice.district.id : null,
|
||||
state_id: this.data.company_module.address_einvoice ? this.data.company_module.address_einvoice.state.id : null,
|
||||
post_code: this.data.company_module.address_einvoice ? this.data.company_module.address_einvoice.post_code : null,
|
||||
identification_id: this.data.identification ? this.data.identification.id : null,
|
||||
identification_reference: this.data.identification ? this.data.identification.reference : null,
|
||||
}
|
||||
};
|
||||
},
|
||||
@@ -164,7 +176,7 @@
|
||||
? {
|
||||
required,
|
||||
alphaNum,
|
||||
minLength: minLength(11),
|
||||
minLength: minLength(10), //was 11
|
||||
maxLength: maxLength(13)
|
||||
}
|
||||
: {}),
|
||||
@@ -173,7 +185,7 @@
|
||||
required,
|
||||
alphaNum,
|
||||
minLength: minLength(10),
|
||||
maxLength: maxLength(12)
|
||||
maxLength: maxLength(13) //was 12
|
||||
}
|
||||
: {})
|
||||
}
|
||||
@@ -188,12 +200,13 @@
|
||||
district_id: isEInvoiceEnabled ? { required } : {},
|
||||
state_id: isEInvoiceEnabled ? { required } : {},
|
||||
post_code: isEInvoiceEnabled ? { required, notZero } : {},
|
||||
|
||||
identification_reference: {},
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
successHandler(response) {
|
||||
this.$store.dispatch('reloadList', {'name': 'orderListSection'});
|
||||
this.closeModal();
|
||||
},
|
||||
submitForm() {
|
||||
|
||||
@@ -13,6 +13,11 @@ export default {
|
||||
let statusCode = response.status,
|
||||
success = response.ok;
|
||||
|
||||
// console.log('statusCode: ' + statusCode); //cief todo: 90 - maintenance
|
||||
if(statusCode == 503){
|
||||
window.location.href = '/maintenance';
|
||||
}
|
||||
|
||||
response.json().then(response => {
|
||||
|
||||
if(!success){
|
||||
|
||||
@@ -22,8 +22,9 @@
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<h1>We'll be back soon!</h1>
|
||||
<p>Sorry for the inconvenience but we're performing some maintenance at the moment. We'll be back online shortly!</p>
|
||||
<h1>{{ config('maintenance.title') }}</h1>
|
||||
<img src="{{ asset('images/maintenance.png') }}" alt="Maintenance" style="max-width: 300px; margin-bottom: 20px;">
|
||||
<p>{{ config('maintenance.message') }}</p>
|
||||
<p>— CIEF IZYIM</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
+26
-25
@@ -27,55 +27,56 @@ Route::group(['middleware' => 'api', 'prefix' => 'v1', 'as' => 'api.'], function
|
||||
require __DIR__ . '/feedback.php';
|
||||
|
||||
Route::group(['middleware' => 'valid.token'], function () {
|
||||
Route::group(['middleware' => 'admin'], function () { //cief todo: 90 - maintenance
|
||||
|
||||
Route::get('/storage/{fileName}/fetch', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file');
|
||||
Route::get('/storage/{fileName}/fetch', 'Documents\RenderDocumentController@fileStorageServe')->where(['fileName' => '.*'])->name('storage.document.file');
|
||||
|
||||
Route::post('online_payment/callback', 'Billplz\CallbackBillplzController@callback')->name('online_payment.callback');
|
||||
Route::post('online_payment/callback', 'Billplz\CallbackBillplzController@callback')->name('online_payment.callback');
|
||||
|
||||
Route::post('/import/update-debtor/f614e339d7058904a831aad742e24d55', 'Imports\ImportUpdateDebtorController@import')->name('debtor.import');
|
||||
Route::post('/import/update-debtor/f614e339d7058904a831aad742e24d55', 'Imports\ImportUpdateDebtorController@import')->name('debtor.import');
|
||||
|
||||
require __DIR__ . '/company.php';
|
||||
require __DIR__ . '/company.php';
|
||||
|
||||
require __DIR__ . '/document.php';
|
||||
require __DIR__ . '/document.php';
|
||||
|
||||
require __DIR__ . '/bank.php';
|
||||
require __DIR__ . '/bank.php';
|
||||
|
||||
require __DIR__ . '/currency.php';
|
||||
require __DIR__ . '/currency.php';
|
||||
|
||||
require __DIR__ . '/address.php';
|
||||
require __DIR__ . '/address.php';
|
||||
|
||||
require __DIR__ . '/transaction.php';
|
||||
require __DIR__ . '/transaction.php';
|
||||
|
||||
require __DIR__ . '/receipt.php';
|
||||
require __DIR__ . '/receipt.php';
|
||||
|
||||
require __DIR__ . '/order.php';
|
||||
require __DIR__ . '/order.php';
|
||||
|
||||
require __DIR__ . '/packing_list.php';
|
||||
require __DIR__ . '/packing_list.php';
|
||||
|
||||
require __DIR__ . '/remark.php';
|
||||
require __DIR__ . '/remark.php';
|
||||
|
||||
require __DIR__ . '/transport.php';
|
||||
require __DIR__ . '/transport.php';
|
||||
|
||||
require __DIR__ . '/schedule.php';
|
||||
require __DIR__ . '/schedule.php';
|
||||
|
||||
require __DIR__ . '/segment.php';
|
||||
require __DIR__ . '/segment.php';
|
||||
|
||||
require __DIR__ . '/announcement.php';
|
||||
require __DIR__ . '/announcement.php';
|
||||
|
||||
require __DIR__ . '/report.php';
|
||||
require __DIR__ . '/report.php';
|
||||
|
||||
require __DIR__ . '/wallet.php';
|
||||
require __DIR__ . '/wallet.php';
|
||||
|
||||
require __DIR__ . '/contact.php';
|
||||
require __DIR__ . '/contact.php';
|
||||
|
||||
require __DIR__ . '/help_menu.php';
|
||||
require __DIR__ . '/help_menu.php';
|
||||
|
||||
require __DIR__ . '/permits_reminder.php';
|
||||
require __DIR__ . '/permits_reminder.php';
|
||||
|
||||
require __DIR__ . '/job.php';
|
||||
|
||||
require __DIR__ . '/rule.php';
|
||||
require __DIR__ . '/job.php';
|
||||
|
||||
require __DIR__ . '/rule.php';
|
||||
});
|
||||
});
|
||||
|
||||
require __DIR__ . '/announcement.php';
|
||||
|
||||
@@ -47,4 +47,5 @@ Route::group(['prefix' => 'company', 'as' => 'company.', 'namespace' => 'Compani
|
||||
Route::get('/e-invoice/info/{id}', [FetchCompanyEInvoiceInfoController::class, 'fetch'])->name('einvoice.info');
|
||||
Route::post('/e-invoice/info/update', [UpdateCompanyEInvoiceInfoController::class, 'updateInfo'])->name('einvoice.info.update');
|
||||
Route::post('/e-invoice/request/update', [UpdateCompanyEInvoiceInfoController::class, 'updateRequest'])->name('einvoice.request.update');
|
||||
Route::post('/e-invoice/request/update/changeofmind', [UpdateCompanyEInvoiceInfoController::class, 'updateChangeOfMindRequest'])->name('einvoice.request.change');
|
||||
});
|
||||
|
||||
@@ -1402,3 +1402,8 @@ Route::get('/group-transaction-with-completed-payments', function () {
|
||||
Route::get('/downloads', function () {
|
||||
return view('pages.downloads.index');
|
||||
})->name('admin.downloads');
|
||||
|
||||
|
||||
Route::get('/maintenance', function () {
|
||||
return response()->view('errors.503', [], 503);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user