b992d07689
- 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.
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
using Distribution.Models;
|
|
|
|
namespace Distribution.Features.SupplierPayment;
|
|
|
|
public record SupplierPaymentAllocationRequest(
|
|
Guid GoodsReceiptId,
|
|
decimal AllocatedAmount);
|
|
|
|
public record CreateSupplierPaymentRequest(
|
|
decimal Amount,
|
|
PaymentMethod Method,
|
|
// One or more GRNs this payment covers. Sum of AllocatedAmount must equal Amount.
|
|
List<SupplierPaymentAllocationRequest> Allocations,
|
|
// Cash: required.
|
|
Guid? BankAccountId = null,
|
|
// Cheque: required — an Unused page from an Active cheque book.
|
|
Guid? ChequePageId = null,
|
|
string? Notes = null,
|
|
Guid? PaidByUserId = null);
|
|
|
|
public record SupplierPaymentAllocationResponse(
|
|
Guid GoodsReceiptId,
|
|
decimal AllocatedAmount);
|
|
|
|
public record SupplierPaymentResponse(
|
|
Guid Id,
|
|
Guid SupplierId,
|
|
decimal Amount,
|
|
PaymentMethod Method,
|
|
Guid? BankAccountId,
|
|
Guid? ChequePageId,
|
|
string? ChequeNo,
|
|
DateTime PaidAt,
|
|
Guid? PaidByUserId,
|
|
string? Notes,
|
|
List<SupplierPaymentAllocationResponse> Allocations,
|
|
DateTime CreatedAt);
|
|
|
|
public record PagedSupplierPaymentsResponse(
|
|
List<SupplierPaymentResponse> Items,
|
|
int Page,
|
|
int PageSize,
|
|
int Total);
|