Files
ERP_Distribution/Distribution/Models/SupplierPayment.cs
Kalana B. Thilakarathna b992d07689 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.
2026-10-19 21:36:01 +05:30

33 lines
1.1 KiB
C#

using System.ComponentModel.DataAnnotations.Schema;
namespace Distribution.Models
{
public class SupplierPayment : Template
{
public Guid FK_SupplierId { get; set; }
[ForeignKey("FK_SupplierId")]
public Supplier? Supplier { get; set; }
public decimal Amount { get; set; }
// Only Cash or Cheque are valid for outgoing payments. Credit is rejected at the service layer.
public PaymentMethod Method { get; set; }
// Cash: required. Null for Cheque.
public Guid? FK_BankAccountId { get; set; }
[ForeignKey("FK_BankAccountId")]
public BankAccount? BankAccount { get; set; }
// Cheque: required — the ChequePage this payment issued. Null for Cash.
public Guid? FK_ChequePageId { get; set; }
[ForeignKey("FK_ChequePageId")]
public ChequePage? ChequePage { get; set; }
public DateTime PaidAt { get; set; }
public Guid? PaidByUserId { get; set; }
public string? Notes { get; set; }
public ICollection<SupplierPaymentGRN> Allocations { get; set; } = [];
}
}