-
Notifications
You must be signed in to change notification settings - Fork 13
PaymentEntry
lasalesi edited this page Jun 16, 2017
·
4 revisions
Get the client initialised first
if (client != null)
{
List<ERPObject> paymnets = client.ListObjects(DocType.PaymentEntry);
listPaymentEntries.Items.Clear();
foreach (ERPObject o in paymnets)
{
listPaymentEntries.Items.Add(o.Name);
}
}
if (client != null)
{
ERPObject obj = client.GetObject(DocType.PaymentEntry, paymentName);
PaymentEntry payment = new PaymentEntry(obj);
txtPaymentPartyType.Text = payment.PartyType;
numPaymentAmount.Value = Convert.ToDecimal(payment.PaidAmount);
txtPaymentReference.Text = payment.ReferenceNo;
datePaymentDate.Value = payment.ReferenceDate;
}
Note: the following fields are mandatory:
- Account Paid From,
- Account Currency
- Account Paid To
- Account Currency
- Paid Amount
- Exchange Rate
- Paid Amount
- Received Amount
- Exchange Rate
- Received Amount
Use something like this to create a new reference item
if (client != null)
{
PaymentEntryReference r = new PaymentEntryReference();
r.ReferenceDocType = "Sales Invoice";
r.Parent = listPaymentEntries.SelectedItem.ToString();
r.ReferenceName = txtPaymentEntryReference.Text;
r.TotalAmount = Convert.ToDouble(numPaymentAmount.Value);
r.OutstandingAmount = Convert.ToDouble(numPaymentAmount.Value);
r.AllocatedAmount = Convert.ToDouble(numPaymentAmount.Value);
ERPObject obj = r.Object;
client.InsertObject(obj);
}