Difference between revisions of "Programmer:Sales Invoice"

Jump to navigation Jump to search
no edit summary
 
# NetTotal must not be negative amount
# Negative Quantity is allowed, if it does not violate the NetTotal rule.
# Changing Unit Price of '''Item Package''' directly will affect the accuracy of Sales Analysis and Profit Margin Report.
#:To change the Price of an Item Package, it is required to change at the detail level.
 
==Assemblies version 1.8, 1.9==
}
</syntaxhighlight>
{{Note|'''Non-Stock Item''' can either with or without ItemCode, it depends on the setting & preference ofin customer Account Book.}}
 
<br/>
==Transfer from Delivery Order with ItemCode and Item Package==
<syntaxhighlight lang="csharp">
public void TransferFromDeliveryOrderWithItemPackage(BCE.Data.DBSetting dbSetting)
{
string docNo = "DO-00001";
BCE.AutoCount.Invoicing.Sales.TransferFrom transferFrom = BCE.AutoCount.Invoicing.Sales.TransferFrom.DeliveryOrder;
 
BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand cmd =
BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand.Create(dbSetting);
BCE.AutoCount.Invoicing.Sales.Invoice.Invoice doc = cmd.AddNew();
BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceDetail dtl;
 
//Transfer Item Package
//PackA is Package Code
if (!doc.PartialTransfer(transferFrom, docNo, "PackA", 1))
{
//Log error - failed
}
 
//Transfer Item Package with DtlKey in DODtl
//When there are 2 or more same Package Code in Delivery Order,
//using DtlKey to ensure a specific Item (Item Package) is transferred
//Without DtlKey, it will go by sequence of the item.
if (!doc.PartialTransfer(transferFrom, docNo, "PackB", 1, 13485))
{
//Log error - failed
}
 
//Transfer ItemCode from D/O
//FG0001 is the ItemCode
//UNIT is the UOM
//1 is qty to transfer
//0 is FocQty to transfer
if (!doc.PartialTransfer(transferFrom, docNo, "FG0001", "UNIT", 1, 0))
{
//Log error
}
 
//Transfer ItemCode from D/O with specific DtlKey in DODtl
if (!doc.PartialTransfer(transferFrom, docNo, "FG0002", "UNIT", 1, 0, 13487))
{
//Log error
}
 
 
//Add new Item Package in Invoice
dtl = doc.AddPackage("PackC");
dtl.Qty = 2;
//Do not change UnitPrice at Package level, as the UnitPrice of package must be the sum of items' unit price.
//Change unit Price of items in Package
foreach (System.Data.DataRow row in doc.DataTablePackageDetail.Rows)
{
//Write a function to assign price to the ItemCode
//Eg.
//row["UnitPrice"] = GetPackageItemsPrice(row["ItemCode"].ToString());
}
 
//Add new ItemCode in Invoice
dtl = doc.AddDetail();
dtl.ItemCode = "FG0003";
dtl.UOM = "UNIT";
dtl.Qty = 2;
dtl.UnitPrice = 50.00M;
 
try
{
doc.Save();
//Success
}
catch (BCE.Application.AppException ex)
{
BCE.Application.AppMessage.ShowErrorMessage(ex.Message);
//Fail
}
}
</syntaxhighlight>
 
{{SeeAlsoSale}}
authors, Bureaucrats, Confirmed users, Rollbackers, Administrators
2,374
edits
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu