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',
|
||||
},
|
||||
status: {
|
||||
Waiting: 'Credit Note',
|
||||
Pending: 'Pending Refund',
|
||||
Success: 'Refund Completed',
|
||||
Canceled: 'Canceled',
|
||||
|
|
@ -1266,10 +1267,6 @@ export default {
|
|||
Done: 'Done',
|
||||
},
|
||||
},
|
||||
stats: {
|
||||
Pending: 'Pending Refund',
|
||||
Success: 'Refund Completed',
|
||||
},
|
||||
},
|
||||
|
||||
invoice: {
|
||||
|
|
|
|||
|
|
@ -1237,6 +1237,7 @@ export default {
|
|||
refundSuccess: 'คืนเงินเสร็จเรียบร้อย',
|
||||
},
|
||||
status: {
|
||||
Waiting: 'ใบลดหนี้',
|
||||
Pending: 'รอคืนเงิน',
|
||||
Success: 'คืนเงินเสร็จสิ้น',
|
||||
Canceled: 'ยกเลิกรายการ',
|
||||
|
|
@ -1246,10 +1247,6 @@ export default {
|
|||
Done: 'คืนเงินเรียบร้อย',
|
||||
},
|
||||
},
|
||||
stats: {
|
||||
Pending: 'รอคืนเงิน',
|
||||
Success: 'คืนเงินเสร็จสิ้น',
|
||||
},
|
||||
},
|
||||
|
||||
invoice: {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export const taskStatusOpts = [
|
|||
];
|
||||
|
||||
export const pageTabs = [
|
||||
{ label: CreditNoteStatus.Waiting, value: CreditNoteStatus.Waiting },
|
||||
{ label: CreditNoteStatus.Pending, value: CreditNoteStatus.Pending },
|
||||
{ label: CreditNoteStatus.Success, value: CreditNoteStatus.Success },
|
||||
];
|
||||
|
|
|
|||
|
|
@ -71,12 +71,19 @@ export async function updatePaybackStatus(
|
|||
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', () => {
|
||||
const data = ref<Data[]>([]);
|
||||
const page = ref<number>(1);
|
||||
const pageMax = ref<number>(1);
|
||||
const pageSize = ref<number>(30);
|
||||
const stats = ref<Record<Status, number>>({
|
||||
[Status.Waiting]: 0,
|
||||
[Status.Pending]: 0,
|
||||
[Status.Success]: 0,
|
||||
});
|
||||
|
|
@ -94,6 +101,7 @@ export const useCreditNote = defineStore('credit-note-store', () => {
|
|||
createCreditNote,
|
||||
updateCreditNote,
|
||||
deleteCreditNote,
|
||||
acceptCreditNote,
|
||||
|
||||
...manageAttachment(api, ENDPOINT),
|
||||
...manageFile<'slip'>(api, ENDPOINT),
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ export type CreditNote = {
|
|||
};
|
||||
|
||||
export enum CreditNoteStatus {
|
||||
Waiting = 'Waiting',
|
||||
Pending = 'Pending',
|
||||
Success = 'Success',
|
||||
}
|
||||
|
|
|
|||
|
|
@ -343,6 +343,7 @@ export type QuotationFull = {
|
|||
updatedBy: UpdatedBy;
|
||||
|
||||
agentPrice?: boolean;
|
||||
isDebitNote?: boolean;
|
||||
};
|
||||
|
||||
export type QuotationPayload = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue