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
|
|
@ -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