mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 12:33:56 +00:00
E-Invoice - Fix a problem reported by Sin Yee on MSIC field format not exactly 5 digits in some cases
This commit is contained in:
@@ -158,11 +158,15 @@
|
||||
}
|
||||
|
||||
function notZero(value) {
|
||||
return value !== 0 && value !== '0' && value !== null && value !== undefined
|
||||
return value !== 0 && value !== '0' && value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
function fiveDigits(value) {
|
||||
return /^\d{5}$/.test(value)
|
||||
return /^\d{5}$/.test(value);
|
||||
}
|
||||
|
||||
function allowZeroOrFiveDigits(value) {
|
||||
return Number(value) === 0 || /^\d{5}$/.test(value);
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -246,7 +250,7 @@
|
||||
},
|
||||
msic_code: companyType === 1 ? {
|
||||
notZero, fiveDigits
|
||||
}: {},
|
||||
} : { allowZeroOrFiveDigits },
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+7
-3
@@ -118,11 +118,15 @@
|
||||
}
|
||||
|
||||
function notZero(value) {
|
||||
return value !== 0 && value !== '0' && value !== null && value !== undefined
|
||||
return value !== 0 && value !== '0' && value !== null && value !== undefined;
|
||||
}
|
||||
|
||||
function fiveDigits(value) {
|
||||
return /^\d{5}$/.test(value)
|
||||
return /^\d{5}$/.test(value);
|
||||
}
|
||||
|
||||
function allowZeroOrFiveDigits(value) {
|
||||
return Number(value) === 0 || /^\d{5}$/.test(value);
|
||||
}
|
||||
|
||||
export default {
|
||||
@@ -181,7 +185,7 @@
|
||||
: {},
|
||||
msic_code: isEInvoiceEnabled && companyType === 1 ? {
|
||||
notZero, fiveDigits
|
||||
}: {},
|
||||
}: { allowZeroOrFiveDigits },
|
||||
|
||||
address_id: {},
|
||||
street_one: isEInvoiceEnabled ? { required } : {},
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
<span class="btn-block" v-if="['fiveDigits'].includes(param)">
|
||||
{{ errorMessages[param] }}
|
||||
</span>
|
||||
<span class="btn-block" v-if="['allowZeroOrFiveDigits'].includes(param)">
|
||||
{{ errorMessages[param] }}
|
||||
</span>
|
||||
</small>
|
||||
</div>
|
||||
</template>
|
||||
@@ -31,7 +34,8 @@
|
||||
sameAs: 'this field must match the',
|
||||
maxValue: 'this value must not exceeds',
|
||||
alphaNum: 'this value must be alphanumeric',
|
||||
fiveDigits: 'this value must be exactly 5 digits', //custom
|
||||
fiveDigits: 'this value must be exactly 5 digits',
|
||||
allowZeroOrFiveDigits: 'this value must be exactly 5 digits or 0',
|
||||
// notZero: 'this value cannot be zero',
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user