mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
E-Invoice - Fix minor problems discovered from Shipping Portal
This commit is contained in:
@@ -109,9 +109,6 @@ class UpdateCompanyEInvoiceInfoLogic extends AbstractControllerLogic
|
||||
//Update tin, msic code
|
||||
$this->updatesCompanyEInvoiceInfo->execute($company, $dto->tin, $dto->msicCode);
|
||||
|
||||
$query->tin = $dto->tin;
|
||||
$query->msic_code = $dto->msicCode;
|
||||
|
||||
return $this->response([]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class UpdatesCompanyEInvoiceRequest extends AbstractUpdateRecord
|
||||
*/
|
||||
public function execute(Company $model, bool $eInvoice)
|
||||
{
|
||||
if (is_null($model->e_invoice) && is_null($model->e_invoice_requested_at)) {
|
||||
if (is_null($model->e_invoice_requested_at)) {
|
||||
if($eInvoice){
|
||||
$model->e_invoice_requested_at = now();
|
||||
}
|
||||
|
||||
+40
-38
@@ -22,7 +22,7 @@
|
||||
</validation-wrapper-component>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row m-b-5" v-if="data.e_invoice !== null">
|
||||
<div class="row m-b-5" v-if="data.e_invoice !== 0 && data.e_invoice !== null">
|
||||
<div class="col">
|
||||
E-Invoice Info
|
||||
<div class="row m-b-15">
|
||||
@@ -135,40 +135,43 @@
|
||||
// },
|
||||
validations() {
|
||||
const companyType = this.data.type
|
||||
const isEInvoiceEnabled = this.data.e_invoice !== 0 && this.data.e_invoice !== null;
|
||||
return {
|
||||
parameters: {
|
||||
name: {
|
||||
required,
|
||||
},
|
||||
debtor: {},
|
||||
tin: {
|
||||
...(companyType === 0
|
||||
? {
|
||||
required,
|
||||
alphaNum,
|
||||
minLength: minLength(11),
|
||||
maxLength: maxLength(13)
|
||||
}
|
||||
: {}),
|
||||
...(companyType === 1
|
||||
? {
|
||||
required,
|
||||
alphaNum,
|
||||
minLength: minLength(10),
|
||||
maxLength: maxLength(12)
|
||||
}
|
||||
: {})
|
||||
},
|
||||
msic_code: {
|
||||
tin: isEInvoiceEnabled
|
||||
? {
|
||||
...(companyType === 0
|
||||
? {
|
||||
required,
|
||||
alphaNum,
|
||||
minLength: minLength(11),
|
||||
maxLength: maxLength(13)
|
||||
}
|
||||
: {}),
|
||||
...(companyType === 1
|
||||
? {
|
||||
required,
|
||||
alphaNum,
|
||||
minLength: minLength(10),
|
||||
maxLength: maxLength(12)
|
||||
}
|
||||
: {})
|
||||
}
|
||||
: {},
|
||||
msic_code: isEInvoiceEnabled ? {
|
||||
notZero, fiveDigits
|
||||
},
|
||||
}: {},
|
||||
|
||||
address_id: {},
|
||||
street_one: { required },
|
||||
street_one: isEInvoiceEnabled ? { required } : {},
|
||||
street_two: {},
|
||||
district_id: { required },
|
||||
state_id: { required },
|
||||
post_code: { required, notZero},
|
||||
district_id: isEInvoiceEnabled ? { required } : {},
|
||||
state_id: isEInvoiceEnabled ? { required } : {},
|
||||
post_code: isEInvoiceEnabled ? { required, notZero } : {},
|
||||
|
||||
}
|
||||
}
|
||||
@@ -185,22 +188,21 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'data': function(newData) { //cief todo: 90
|
||||
if (newData && newData.address_einvoice) {
|
||||
this.parameters.address_id = newData.address_einvoice.id;
|
||||
this.parameters.street_one = newData.address_einvoice.street_one;
|
||||
this.parameters.street_two = newData.address_einvoice.street_two;
|
||||
this.parameters.district_id = newData.address_einvoice.district.id;
|
||||
this.parameters.state_id = newData.address_einvoice.state.id;
|
||||
this.parameters.post_code = newData.address_einvoice.post_code;
|
||||
}
|
||||
}
|
||||
},
|
||||
// watch: {
|
||||
// 'data': function(newData) { //cief todo: 90
|
||||
// if (newData && newData.address_einvoice) {
|
||||
// this.parameters.address_id = newData.address_einvoice.id;
|
||||
// this.parameters.street_one = newData.address_einvoice.street_one;
|
||||
// this.parameters.street_two = newData.address_einvoice.street_two;
|
||||
// this.parameters.district_id = newData.address_einvoice.district.id;
|
||||
// this.parameters.state_id = newData.address_einvoice.state.id;
|
||||
// this.parameters.post_code = newData.address_einvoice.post_code;
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
methods: {
|
||||
successHandler(response) {
|
||||
// window.location.replace(this.route('customers', response.payload.data.reference));
|
||||
this.$emit('e-invoice-info', this.parameters);
|
||||
this.closeModal();
|
||||
},
|
||||
submitForm() {
|
||||
|
||||
Reference in New Issue
Block a user