feat: add support for credit note status and acceptance functionality
This commit is contained in:
parent
83a7e7ee47
commit
91c7db7c7b
6 changed files with 13 additions and 8 deletions
|
|
@ -1257,6 +1257,7 @@ export default {
|
||||||
refundSuccess: 'Refund Success',
|
refundSuccess: 'Refund Success',
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
|
Waiting: 'Credit Note',
|
||||||
Pending: 'Pending Refund',
|
Pending: 'Pending Refund',
|
||||||
Success: 'Refund Completed',
|
Success: 'Refund Completed',
|
||||||
Canceled: 'Canceled',
|
Canceled: 'Canceled',
|
||||||
|
|
@ -1266,10 +1267,6 @@ export default {
|
||||||
Done: 'Done',
|
Done: 'Done',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
stats: {
|
|
||||||
Pending: 'Pending Refund',
|
|
||||||
Success: 'Refund Completed',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
invoice: {
|
invoice: {
|
||||||
|
|
|
||||||
|
|
@ -1237,6 +1237,7 @@ export default {
|
||||||
refundSuccess: 'คืนเงินเสร็จเรียบร้อย',
|
refundSuccess: 'คืนเงินเสร็จเรียบร้อย',
|
||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
|
Waiting: 'ใบลดหนี้',
|
||||||
Pending: 'รอคืนเงิน',
|
Pending: 'รอคืนเงิน',
|
||||||
Success: 'คืนเงินเสร็จสิ้น',
|
Success: 'คืนเงินเสร็จสิ้น',
|
||||||
Canceled: 'ยกเลิกรายการ',
|
Canceled: 'ยกเลิกรายการ',
|
||||||
|
|
@ -1246,10 +1247,6 @@ export default {
|
||||||
Done: 'คืนเงินเรียบร้อย',
|
Done: 'คืนเงินเรียบร้อย',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
stats: {
|
|
||||||
Pending: 'รอคืนเงิน',
|
|
||||||
Success: 'คืนเงินเสร็จสิ้น',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
|
|
||||||
invoice: {
|
invoice: {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ export const taskStatusOpts = [
|
||||||
];
|
];
|
||||||
|
|
||||||
export const pageTabs = [
|
export const pageTabs = [
|
||||||
|
{ label: CreditNoteStatus.Waiting, value: CreditNoteStatus.Waiting },
|
||||||
{ label: CreditNoteStatus.Pending, value: CreditNoteStatus.Pending },
|
{ label: CreditNoteStatus.Pending, value: CreditNoteStatus.Pending },
|
||||||
{ label: CreditNoteStatus.Success, value: CreditNoteStatus.Success },
|
{ label: CreditNoteStatus.Success, value: CreditNoteStatus.Success },
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -71,12 +71,19 @@ export async function updatePaybackStatus(
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function acceptCreditNote(id: string) {
|
||||||
|
const res = await api.post<Data>(`/${ENDPOINT}/${id}/accept`);
|
||||||
|
if (res.status < 400) return res.data;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
export const useCreditNote = defineStore('credit-note-store', () => {
|
export const useCreditNote = defineStore('credit-note-store', () => {
|
||||||
const data = ref<Data[]>([]);
|
const data = ref<Data[]>([]);
|
||||||
const page = ref<number>(1);
|
const page = ref<number>(1);
|
||||||
const pageMax = ref<number>(1);
|
const pageMax = ref<number>(1);
|
||||||
const pageSize = ref<number>(30);
|
const pageSize = ref<number>(30);
|
||||||
const stats = ref<Record<Status, number>>({
|
const stats = ref<Record<Status, number>>({
|
||||||
|
[Status.Waiting]: 0,
|
||||||
[Status.Pending]: 0,
|
[Status.Pending]: 0,
|
||||||
[Status.Success]: 0,
|
[Status.Success]: 0,
|
||||||
});
|
});
|
||||||
|
|
@ -94,6 +101,7 @@ export const useCreditNote = defineStore('credit-note-store', () => {
|
||||||
createCreditNote,
|
createCreditNote,
|
||||||
updateCreditNote,
|
updateCreditNote,
|
||||||
deleteCreditNote,
|
deleteCreditNote,
|
||||||
|
acceptCreditNote,
|
||||||
|
|
||||||
...manageAttachment(api, ENDPOINT),
|
...manageAttachment(api, ENDPOINT),
|
||||||
...manageFile<'slip'>(api, ENDPOINT),
|
...manageFile<'slip'>(api, ENDPOINT),
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ export type CreditNote = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum CreditNoteStatus {
|
export enum CreditNoteStatus {
|
||||||
|
Waiting = 'Waiting',
|
||||||
Pending = 'Pending',
|
Pending = 'Pending',
|
||||||
Success = 'Success',
|
Success = 'Success',
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -343,6 +343,7 @@ export type QuotationFull = {
|
||||||
updatedBy: UpdatedBy;
|
updatedBy: UpdatedBy;
|
||||||
|
|
||||||
agentPrice?: boolean;
|
agentPrice?: boolean;
|
||||||
|
isDebitNote?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type QuotationPayload = {
|
export type QuotationPayload = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue