Programmer:Cash Sale with Payment: Difference between revisions
Content added Content deleted
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
==Rules in Sale Cash Sale== |
|||
# NetTotal must not be negative amount |
# NetTotal must not be negative amount |
||
# Negative Quantity is allowed, if it does not violate the NetTotal rule. |
# Negative Quantity is allowed, if it does not violate the NetTotal rule. |
||
== |
==References of AutoCount Accounting version 1.8== |
||
BCE.AutoCount.dll |
|||
<pre> |
|||
BCE.AutoCount. |
BCE.AutoCount.CommonAccounting.dll |
||
BCE.AutoCount. |
BCE.AutoCount.MainEntry.dll |
||
BCE.Utils.dll |
|||
</pre> |
|||
BCE.Utils.UI.dll |
|||
'''BCE.AutoCount.Invoicing.dll''' |
|||
'''BCE.AutoCount.Invoicing.Sales.dll''' |
|||
== |
==Sale Invoice API Usage== |
||
===New=== |
|||
<syntaxhighlight lang="csharp"> |
|||
public void NewCashSale(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand cmd = |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand.Create(dbSetting); |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSale doc = cmd.AddNew(); |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleDetail dtl; |
|||
doc.DebtorCode = "300-C001"; |
|||
===Classes of source=== |
|||
doc.DocNo = "CS-00011"; |
|||
doc.DocDate = DateTime.Today.Date; |
|||
dtl = doc.AddDetail(); |
|||
dtl.ItemCode = "FG00001"; |
|||
dtl.Qty = 1; |
|||
dtl.UOM = "UNIT"; |
|||
dtl.UnitPrice = 50.20M; |
|||
dtl = doc.AddDetail(); |
|||
dtl.ItemCode = "FG00002"; |
|||
dtl.Qty = 10; |
|||
dtl.UOM = "UNIT"; |
|||
dtl.UnitPrice = 60.20M; |
|||
dtl.Discount = "30%"; |
|||
doc.Save(); |
|||
} |
|||
</syntaxhighlight> |
|||
===Edit=== |
|||
<syntaxhighlight lang="csharp"> |
<syntaxhighlight lang="csharp"> |
||
public void EditCashSale(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand cmd = |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand.Create(dbSetting); |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSale doc = cmd.Edit("CS-00011"); |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleDetail dtl; |
|||
if (doc != null) |
|||
{ |
|||
doc.ClearDetails(); |
|||
dtl = doc.AddDetail(); |
|||
dtl.ItemCode = "FG00001"; |
|||
dtl.Qty = 1; |
|||
dtl.UOM = "UNIT"; |
|||
dtl.UnitPrice = 50.20M; |
|||
dtl = doc.AddDetail(); |
|||
dtl.ItemCode = "FG00003"; |
|||
dtl.Qty = 10; |
|||
dtl.UOM = "UNIT"; |
|||
dtl.UnitPrice = 6.30M; |
|||
dtl.Discount = "30%"; |
|||
doc.Save(); |
|||
} |
|||
} |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
=== |
===Cancel=== |
||
<syntaxhighlight lang="csharp"> |
|||
public void CancelCashSale(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand cmd = |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand.Create(dbSetting); |
|||
cmd.CancelDocument("CS-00011", BCE.AutoCount.Authentication |
|||
.UserAuthentication.GetOrCreate(dbSetting).LoginUserID); |
|||
} |
|||
</syntaxhighlight> |
|||
===Delete=== |
|||
<syntaxhighlight lang="csharp"> |
|||
public void DeleteCashSale(BCE.Data.DBSetting dbSetting) |
|||
{ |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand cmd = |
|||
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand.Create(dbSetting); |
|||
cmd.Delete("CS-00011"); |
|||
} |
|||
</syntaxhighlight> |
|||
Revision as of 04:06, 22 January 2018
Rules in Sale Cash Sale
- NetTotal must not be negative amount
- Negative Quantity is allowed, if it does not violate the NetTotal rule.
References of AutoCount Accounting version 1.8
BCE.AutoCount.dll BCE.AutoCount.CommonAccounting.dll BCE.AutoCount.MainEntry.dll BCE.Utils.dll BCE.Utils.UI.dll BCE.AutoCount.Invoicing.dll BCE.AutoCount.Invoicing.Sales.dll
Sale Invoice API Usage
New
public void NewCashSale(BCE.Data.DBSetting dbSetting)
{
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand cmd =
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand.Create(dbSetting);
BCE.AutoCount.Invoicing.Sales.CashSale.CashSale doc = cmd.AddNew();
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleDetail dtl;
doc.DebtorCode = "300-C001";
doc.DocNo = "CS-00011";
doc.DocDate = DateTime.Today.Date;
dtl = doc.AddDetail();
dtl.ItemCode = "FG00001";
dtl.Qty = 1;
dtl.UOM = "UNIT";
dtl.UnitPrice = 50.20M;
dtl = doc.AddDetail();
dtl.ItemCode = "FG00002";
dtl.Qty = 10;
dtl.UOM = "UNIT";
dtl.UnitPrice = 60.20M;
dtl.Discount = "30%";
doc.Save();
}
Edit
public void EditCashSale(BCE.Data.DBSetting dbSetting)
{
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand cmd =
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand.Create(dbSetting);
BCE.AutoCount.Invoicing.Sales.CashSale.CashSale doc = cmd.Edit("CS-00011");
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleDetail dtl;
if (doc != null)
{
doc.ClearDetails();
dtl = doc.AddDetail();
dtl.ItemCode = "FG00001";
dtl.Qty = 1;
dtl.UOM = "UNIT";
dtl.UnitPrice = 50.20M;
dtl = doc.AddDetail();
dtl.ItemCode = "FG00003";
dtl.Qty = 10;
dtl.UOM = "UNIT";
dtl.UnitPrice = 6.30M;
dtl.Discount = "30%";
doc.Save();
}
}
Cancel
public void CancelCashSale(BCE.Data.DBSetting dbSetting)
{
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand cmd =
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand.Create(dbSetting);
cmd.CancelDocument("CS-00011", BCE.AutoCount.Authentication
.UserAuthentication.GetOrCreate(dbSetting).LoginUserID);
}
Delete
public void DeleteCashSale(BCE.Data.DBSetting dbSetting)
{
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand cmd =
BCE.AutoCount.Invoicing.Sales.CashSale.CashSaleCommand.Create(dbSetting);
cmd.Delete("CS-00011");
}
See Also
- Programmer:Quotation
- Programmer:Sales Order
- Programmer:Delivery Order
- Programmer:Sales Invoice
- Programmer:Cash Sale with Payment
Go to top
|
Resources For AutoCount Software Developers
|