fix/refactor: quotation installment (#121)

* refactor/feat: i18n

* chore: clean log

* refactor: type

* refactor: installment and product table state relation

* refactor: handle split custom

---------

Co-authored-by: Thanaphon Frappet <thanaphon@frappet.com>
This commit is contained in:
puriphatt 2024-12-06 11:01:52 +07:00 committed by GitHub
parent 57aabf1deb
commit 1b4c06b182
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 357 additions and 77 deletions

View file

@ -24,13 +24,13 @@ const templates = {
}) => {
if (context?.paymentType === 'Full') {
return [
`**** เงื่อนไขเพิ่มเติม`,
`- เงื่อนไขการชำระเงิน แบบเต็มจำนวน`,
'**** เงื่อนไขเพิ่มเติม',
'- เงื่อนไขการชำระเงิน แบบเต็มจำนวน',
`&nbsp; จำนวน ${formatNumberDecimal(context?.amount || 0, 2)}`,
].join('<br/>');
} else {
return [
`**** เงื่อนไขเพิ่มเติม`,
'**** เงื่อนไขเพิ่มเติม',
`- เงื่อนไขการชำระเงิน แบบแบ่งจ่าย${context?.paymentType === 'SplitCustom' ? ' กำหนดเอง ' : ' '}${context?.installments?.length} งวด`,
...(context?.installments?.map(
(v) =>
@ -63,7 +63,7 @@ export function convertTemplate(
? template.converter(context?.[name as TemplateName] as any)
: template.converter,
);
console.log(ret);
// console.log(ret);
}
return ret;