2,765
edits
No edit summary |
|||
Line 105:
BCE.AutoCount.Invoicing.Sales.CashSale.CashSale doc = cmd.AddNew();
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleDetail dtl;
BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity paymentDtl;▼
//doc.DocNo = "CS-00011";
Line 131 ⟶ 130:
dtl.TaxType = "S-10";
//FinalTotal is the total after 5 cents rounding
//PaymentMode 1 indicate the payment is by Cash▼
doc.PaymentMode = 1;▼
doc.CashPayment = doc.FinalTotal;▼
doc.CCApprovalCode = DBNull.Value;▼
doc.CashSalePayment.ARPayment.ToHomeRate = doc.CurrencyRate;▼
doc.CashSalePayment.ARPayment.ClearDetails();▼
try
Line 163 ⟶ 148:
==Edit Cash Sale that has payment==
<syntaxhighlight lang="c#">
private void MakeCashPayment(BCE.AutoCount.Invoicing.Sales.CashSale.CashSale cs, decimal cashAmt, BCE.Data.DBSetting dbSetting)
{
▲ //PaymentMode 1 indicate the payment in this Cash Sale is by Cash
cs.CashSalePayment = BCE.AutoCount.Invoicing.Sales.SalesPayment.Create(
cs.ReferPaymentDocKey, cs.DocKey,
BCE.AutoCount.Document.DocumentType.CashSale, dbSetting);
cs.CashSalePayment.DebtorCode = cs.DebtorCode;
cs.CashSalePayment.CurrencyCode = cs.CurrencyCode;
▲ BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity
payDtl.PaymentMethod = BCE.AutoCount.Invoicing.CommonFunction.GetFirstCashAccount(dbSetting);
payDtl.PaymentAmt = cashAmt;
if (cs.CashSalePayment.PaymentAmt > 0)
cs.ReferPaymentDocKey = cs.CashSalePayment.DocKey;
}
</syntaxhighlight>
|