Files
ERP_Distribution/Distribution/Models/Payment.cs
T
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

32 lines
1.2 KiB
C#

using System.ComponentModel.DataAnnotations.Schema;
namespace Distribution.Models
{
public class Payment : Template
{
public Guid FK_InvoiceId { get; set; }
[ForeignKey("FK_InvoiceId")]
public Invoice Invoice { get; set; }
public decimal Amount { get; set; }
public PaymentMethod Method { get; set; }
public EntryMode EntryMode { get; set; } = EntryMode.RealTime;
public string? ChequeNumber { get; set; }
public DateTime? ChequeDate { get; set; }
public DateTime CollectedAt { get; set; }
public Guid CollectedBy { get; set; }
public Guid? RecordedBy { get; set; }
// Cash/Bank account that received the funds. Required when Method = Cash;
// for Cheque, the FK_ReceivedCheque below carries the deposit account once deposited.
public Guid? FK_BankAccountId { get; set; }
[ForeignKey("FK_BankAccountId")]
public BankAccount? BankAccount { get; set; }
// Cheque record auto-created when Method = Cheque. Null for Cash/Credit payments.
public Guid? FK_ReceivedChequeId { get; set; }
[ForeignKey("FK_ReceivedChequeId")]
public ReceivedCheque? ReceivedCheque { get; set; }
}
}