feat: add supplier payment and allocation models, API, and frontend components
- Created `SupplierPayment` and `SupplierPaymentGRN` models for managing supplier payments and their allocations. - Implemented API endpoints for listing and creating supplier payments. - Developed frontend components for displaying and recording supplier payments, including a dialog for payment creation. - Integrated GRN allocations into the payment creation process, ensuring total allocations match the payment amount. - Added pagination and loading states for the payments list.
This commit is contained in:
@@ -15,6 +15,7 @@ export { sysConfig, ITEM_TRACKING_KEYS, GRN_TAX_KEYS, grnTaxSettings, DEFAULT_GR
|
||||
export { bankAccounts } from './bank-accounts'
|
||||
export { chequeBooks, chequePages } from './cheques'
|
||||
export { receivedCheques } from './received-cheques'
|
||||
export { supplierPayments } from './supplier-payments'
|
||||
export { getPaginatedItems } from './paginated'
|
||||
|
||||
export type { PageParams } from './master'
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import { api } from '@/lib/api'
|
||||
import type {
|
||||
CreateSupplierPaymentRequest,
|
||||
PagedSupplierPaymentsResponse,
|
||||
SupplierPaymentResponse,
|
||||
} from '@/types/payments'
|
||||
|
||||
export const supplierPayments = {
|
||||
list: (supplierId: string, params?: { page?: number; pageSize?: number }) =>
|
||||
api
|
||||
.get<PagedSupplierPaymentsResponse>(`/suppliers/${supplierId}/payments`, { params })
|
||||
.then(r => r.data),
|
||||
|
||||
create: (supplierId: string, body: CreateSupplierPaymentRequest) =>
|
||||
api
|
||||
.post<SupplierPaymentResponse>(`/suppliers/${supplierId}/payments`, body)
|
||||
.then(r => r.data),
|
||||
}
|
||||
Reference in New Issue
Block a user