Access Sales Tutorial

Introduction
In this part of the tutorial, you will learn about accessing a Sales document via code
In the first part of the tutorial, an example on how to programmatically add, edit and delete a Sales Order will be discussed while in the second part of the tutorial, an example on how to programmatically add, edit and delete an Invoice document will be discussed. Note: For all the property table, the red entries are compulsory property

 

 

Accessing Sales Order
Similarly to previous tutorials, we begin with creating an object that works as the data access bridge between the database with the data we wish to add, edit or delete. For Sales Order this bridge is the SalesOrderCommand class

Code Snippet
BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand cmd = BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand.Create(myDBSetting)
After creating the object acting as the bridge, you may call the specific methods you need to create, edit or delete a Sales Order
Action Method Name
Add AddNew
Edit Edit
Delete Delete

The following examples illustrates how to use the above methods to do each specific task:

 

 

Add Sales Order
Add Code Snippet

 

public void AddSalesOrder()

{

    BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand cmd = BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand.Create(myDBSetting);

 

    BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrder doc = cmd.AddNew();

    doc.DocNo = “SO-1234″;

    doc.DebtorCode = “300-A001″;

    doc.ShipInfo = “COURIER”;

 

    BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderDetail detail = doc.AddDetail();

    detail.Description = “PRINT COURSE BOOK”;

    detail.Qty = 100;

    detail.SubTotal = 1000;

 

    detail = doc.AddDetail();

    detail.Description = “PRINT NAMECARD”;

 

     doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);

}

 

 

 

Edit Sales Order

Edit Code Snippet

public void EditSalesOrder()

{

    BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand cmd = BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand.Create(myDBSetting);

 

    BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrder doc = cmd.Edit(“SO-1234″);

 

    if (doc != null)

    {

        doc.ShipInfo = “123″;

        doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);

    }

}

 

 

Delete Sales Order

Delete Code Snippet

public void DeleteSalesOrder()

{

    BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand cmd = BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand.Create(myDBSetting);

    cmd.Delete(“SO-1234″);

}

 

 

SalesOrder Class Properties
SalesOrder Properties

Field Name Type(Length) Read-Only Description
Action BCE.AutoCount.Invoicing.Action O Returns the Invoicing.Action object of this document
Agent BCE.Data.DBString(12)   The agent assign to this document
Attention BCE.Data.DBString(40)   The attention assign to this document
AuditTrail BCE.AutoCount.Common.AuditTrail O Returns the AuditTrail object of this document
BranchCode BCE.Data.DBString(20)   The branch code assign to this document
CalcDiscountOnUnitPrice Boolean   The status flag for calculate discount on unit price
Cancelled Boolean O Returns true if the document is cancelled
CanSync Boolean   The status flag for allowing sync
CanTransferByValue Boolean   The status flag for allowing transfer by value
Command BCE.AutoCount.Invoicing.InvoicingCommonCommand O Returns the Command object of this document
CreatedTimeStamp BCE.Data.DBDateTime O Returns the creation time of this document
CreatedUserID BCE.Data.DBString(10) O Returns the document creator user id
CreditorCode BCE.Data.DBString(5)   The currency code assign to this document
CurrencyRate BCE.Data.DBDecimal(18,8)   The currency rate assign to this document
DataSet DataSet O Returns the DataSet object of this document
DataTableDetail DataTable O Returns the Detail table of this document
DataTableMaster DataTable O Returns the Master table of this document
DataTablePackageDetail DataTable O Returns the Item Package Detail table of this document
DataViewDetail DataView O Returns the default dataview of Detail table of this document
DebtorCode BCE.Data.DBString(12)   The debtor code assign to this document
DebtorName BCE.Data.DBString(80)   The debtor name assign to this document
DecimalSetting BCE.AutoCount.Settings.DecimalSetting O Returns the DecimalSetting accessor
DeliverAddr1 BCE.Data.DBString(40)   The deliver address part 1 assign to this document
DeliverAddr2 BCE.Data.DBString(40)   The deliver address part 2 assign to this document
DeliverAddr3 BCE.Data.DBString(40)   The deliver address part 3 assign to this document
DeliverAddr4 BCE.Data.DBString(40)   The deliver address part 4 assign to this document
DeliverContact BCE.Data.DBString(40)   The deliver contact assign to this document
DeliverFax1 BCE.Data.DBString(25)   The deliver fax1 assign to this document
DeliverPhone1 BCE.Data.DBString(25)   The deliver phone1 assign to this document
Description BCE.Data.DBString(80)   The description assign to this document
DetailCount Int O Returns the number of detail records
DisplayTerm BCE.Data.DBString(30)   The display term assign to this document
DocDate BCE.Data.DBDateTime   The document date assign to this document
DocKey Long O Returns the document key of this document
DocNo BCE.Data.DBString(20)   The document number assign to this document
DocNoFormatName String   The document number format name assign to this document
DocType String O Returns the document type of this document
EnableAutoLoadItemDetail Boolean   Enable or disable automatic load item detail
EnableAutoPrice Boolean   Enable or disable automatic price book
EnableMultiDimensionalPriceBook Boolean   Enable or disable Multi-Dimensional Price Book
EnableNoDetailItemChecking Boolean   Enable or disable detail item checking
EnableZeroNetTotalChecking Boolean   Enable or disable zero net total checking
ExTax BCE.Data.DBDecimal(18,4) O Returns exclusive tax amount
ExternalLink BCE.AutoCount.Common.ExternalLink O Returns the ExternalLink accessor
ExternalLinkText BCE.Data.DBString   The ExternalLink text assign to this document
Fax1 BCE.Data.DBString(25)   The fax1 assign to this document
FinalTotal BCE.Data.DBString(18,4) O Returns the final total amount
Footer1Amt BCE.Data.DBDecimal(18,4)   The footer 1 amount assign to this document
Footer1LocalAmt BCE.Data.DBDecimal(18,4) O Returns the footer 1 amount in local currency
Footer1LocalTax BCE.Data.DBDecimal(18,4) O Returns the footer 1 tax amount in local currency
Footer1Param BCE.Data.DBDecimal(18,4)   The footer 1 parameter assign to this document
Footer1Tax BCE.Data.DBDecimal(18,4)   The footer 1 tax amount assign to this document
Footer1TaxType BCE.Data.DBString(14)   The footer 1 tax type assign to this document
Footer2Amt BCE.Data.DBDecimal(18,4)   The footer 2 amount assign to this document
Footer2LocalAmt BCE.Data.DBDecimal(18,4) O Returns the footer 2 amount in local currency
Footer2LocalTax BCE.Data.DBDecimal(18,4) O Returns the footer 2 tax amount in local currency
Footer2Param BCE.Data.DBDecimal(18,4)   The footer 2 parameter assign to this document
Footer2Tax BCE.Data.DBDecimal(18,4)   The footer 2 tax amount assign to this document
Footer2TaxType BCE.Data.DBString(14)   The footer 2 tax type assign to this document
Footer3Amt BCE.Data.DBDecimal(18,4)   The footer 3 amount assign to this document
Footer3LocalAmt BCE.Data.DBDecimal(18,4) O Returns the footer 3 amount in local currency
Footer3LocalTax BCE.Data.DBDecimal(18,4) O Returns the footer 3 tax amount in local currency
Footer3Param BCE.Data.DBDecimal(18,4)   The footer 3 parameter assign to this document
Footer3Tax BCE.Data.DBDecimal(18,4)   The footer 3 tax amount assign to this document
Footer3TaxType BCE.Data.DBString(14)   The footer 3 tax type assign to this document
FullTransferredTable DataTable O Returns the Full Transferred table of this document
GeneralSetting BCE.AutoCount.Settings.GeneralSetting O Returns the GeneralSetting accessor
InclusiveTax Boolean   The status flag if the tax type is inclusive or not
InvAddr1 BCE.Data.DBString(40)   The invoice address part 1 assign to the document
InvAddr2 BCE.Data.DBString(40)   The invoice address part 2 assign to the document
InvAddr3 BCE.Data.DBString(40)   The invoice address part 3 assign to the document
InvAddr4 BCE.Data.DBString(40)   The invoice address part 4 assign to the document
IsAllowSuspendedAcc Boolean   The status flag if the suspended account is allowed to use
IsDeliveryAddressEditedManually Boolean   The status flag if the delivery address was manually edited
IsInvoiceAddressEditedManually Boolean   The status flag if the invoice address was manually edited
IsTransfered Boolean O Returns whether the document has been transferred or not
IsTransferFromSupported Boolean O Returns whether the document supports Transfer From feature
LastModified BCE.Data.DBDateTime O Returns the last modified time
LastModifiedUserID BCE.Data.DBDateTime(10) O Returns the user id that made the last modification
LastUpdate Int O Returns the number of update
LocalExTax BCE.Data.DBDecimal(18,4) O Returns the exclusive tax amount in local currency
LocalNetTotal BCE.Data.DBDecimal(18,4) O Returns the net total amount in local currency
LocalTax BCE.Data.DBDecimal(18,4) O Returns the tax amount in local currency
MasterRow DataRow O Returns the master data row of the master table
MemberNo BCE.Data.DBString(24)   The member number assign to the document
NetTotal BCE.Data.DBDecimal(18,4) O Returns the net total amount
Note BCE.Data.DBString   The notes assign to the document
Phone1 BCE.Data.DBString(25)   The phone1 assign to the document
PriceBookRule BCE.AutoCount.Invoicing.Sales.PriceBookRule O Returns the Price Book Rule of this document
PrintCount Short O Returns the Print Count of this document
RecalculateMemberPoint Boolean   The status flag to recalculate the member point
Ref BCE.Data.DBString(40)   The reference assign to this document
RefDocNo BCE.Data.DBString(20)   The reference document number assign to this document
Remark1 BCE.Data.DBString(40)   The Remark part 1 assign to this document
Remark2 BCE.Data.DBString(40)   The Remark part 2 assign to this document
Remark3 BCE.Data.DBString(40)   The Remark part 3 assign to this document
Remark4 BCE.Data.DBString(40)   The Remark part 4 assign to this document
RoundAdj BCE.Data.DBDecimal O Returns the Rounding Adjustment amount
SalesCreditControl BCE.AutoCount.Invoicing.Sales.CreditControl   The Credit Control assign to this document
SalesExemptionExpiryDate BCE.Data.DBDateTime   The Sales Exemption Expiry date assign to this document
SalesExemptionNo BCE.Data.DBString(60)   The Sales Exemption number assign to this document
SalesLocation BCE.Data.DBString(8)   The Sales Location assign to this document
SalesOrderAction BCE.AutoCount.Invoicing.Action O Returns the Invoicing.Action object of this document
SalesOrderCommand BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand O Returns the SalesOrderCommand object of this document
SalesOrderDataSet DataSet O Returns the Sales Order DataSet object of this document
ScriptObject BCE.AutoCount.Scripting.ScriptObject O Returns the ScriptObject of this document
SetSubTotalToNullWhenAllNull Boolean   The status flag to set sub total to null when all null
ShipInfo BCE.Data.DBString(40)   The Ship Info assign to this document
ShipVia BCE.Data.DBString(20)   The Ship Via assign to this document
Tax BCE.Data.DBDecimal(18,4)   The Tax amount assign to this document
ToDocType BCE.Data.DBString(2) O Returns the To Document Type
Total BCE.Data.DBDecimal(18,4) O Returns the Total amount
ToTaxCurrencyRate BCE.Data.DBDecimal(18,8)   The To Tax Currency Rate assign to this document
Transferable Boolean   The status flag for the document to be transferable
TransferedAmt BCE.Data.DBDecimal O Returns the transferred amount
UDF BCE.AutoCount.Data.UDFRecord O Returns the UDF accessor
UserAuthentication BCE.AutoCount.Authentication.UserAuthentication O Returns the UserAuthentication object of this document
UserData Object   The object that contains user data. This is use for scripting purposes
WarnZeroNetTotal Boolean O The status flag to warn the zero net total

 

 

SalesOrderDetail Properties

Field Name Type(Length) Read-Only Description
AddToSubTotal Boolean   The status flag to add the detail to the sub total
CalcByPercent BCE.Data.DBDecimal(18,6)   The Calculate By Percent assign to this detail
DataRow DataRow O Returns the data row of this detail
DeliveryDate BCE.Data.DBDateTime   The Delivery Date assign to this detail
DeptNo BCE.Data.DBString(10)   The Department Number assign to this detail
Description BCE.Data.DBString(100)   The Description assign to this detail
DetailRow DataRow O Returns the data row of this detail
Discount BCE.Data.DBString(20)   The Discount assign to this document
DiscountAmt BCE.Data.DBDecimal(18,4)   The Discount Amount to this detail
DocKey Long O Returns the parent document key of this detail
DtlKey Long O Returns the detail key of this detail
DtlType BCE.Data.DBString(1)   The Detail Type assign to this detail
EstimatedDeliveryDate BCE.Data.DBDateTime   The Estimated Delivery Date assign to this detail
FOCQty BCE.Data.DBDecimal(18,6)   The FOC Qty assign to this detail
FOCTransferedQty BCE.Data.DBDecimal(18,6) O The FOC Transferred Qty assign to this detail
FromDocDtlKey Long O Returns the document detail key of the transferred detail
FromDocNo BCE.Data.DBString(20) O Returns the document number of the transferred detail
FromDocType BCE.Data.DBString(2) O Returns the document type of the transferred detail
FurtherDescription BCE.Data.DBString   The further description assign to this detail
ItemCode BCE.Data.DBString(30)   The Item Code assign to this detail
LocalSubTotal BCE.Data.DBDecimal(18,4) O Returns the Sub Total amount in local currency
LocalTax BCE.Data.DBDecimal(18,4) O Returns the Tax amount in local currency
Location BCE.Data.DBString(8)   The Location assign to this detail
Numbering BCE.Data.DBString(6)   The Numbering assign to this detail
PrintOut Boolean   The status flag to print out this detail
ProjNo BCE.Data.DBString(10)   The project number assign to this detail
Qty BCE.Data.DBDecimal(18,6)   The Qty assign to this detail
Rate BCE.Data.DBDecimal(18,6) O Returns the rate of this detail
Seq Int O Returns the sequence of this detail
SmallestQty BCE.Data.DBDecimal(18,6) O Returns the smallest quantity of this detail
SmallestUnitPrice BCE.Data.DBDecimal(18,6) O Returns the smallest unit price of this detail
SubTotal BCE.Data.DBDecimal(18,4)   The Sub Total assign to this detail
SubTotalExTax BCE.Data.DBDecimal(18,4) O Returns the sub total exclusive tax amount
Tax BCE.Data.DBDecimal(18,4) O Returns the tax amount
TaxableAmt BCE.Data.DBDecimal(18,4)   The Taxable Amount assign to this detail
TaxAdjustment BCE.Data.DBDecimal(18,4)   The Tax Adjustment Amount assign to this detail
TaxType BCE.Data.DBString(14)   The Tax Type assign to this detail
Transferable Boolean   The status flag for the detail to be transferable
TransferedAOQty BCE.Data.DBDecimal(18,6) O Returns the Transferred AO Qty
TransferedQty BCE.Data.DBDecimal(18,6) O Returns the Transferred Qty
UDF BCE.AutoCount.Data.UDFRecord O Returns the UDF accessor
UnitPrice BCE.Data.DBDecimal(18,6)   The Unit Price assign to this detail
UOM BCE.Data.DBString(8)   The UOM assign to this detail
UserUOM BCE.Data.DBString(8)   The User UOM assign to this detail
YourPODate BCE.Data.DBDateTime   The Your PO Date assign to this detail
YourPONo BCE.Data.DBString(25)   The Your PO Number assign to this detail

 

 

Accessing Invoice
Similarly to previous tutorials, we begin with creating an object that works as the data access bridge between the database with the data we wish to add, edit or delete. For Invoice this bridge is the InvoiceCommand class

Code Snippet
BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand cmd = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand.Create(myDBSetting);
After creating the object acting as the bridge, you may call the specific methods you need to create, edit or delete a Invoice
Action Method Name
Add AddNew
Edit Edit
Delete Delete

The following examples illustrates how to use the above methods to do each specific task:

 

 

Add Invoice
Add Code Snippet

public void AddInvoice()

{

    BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand cmd = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand.Create(myDBSetting);

 

    BCE.AutoCount.Invoicing.Sales.Invoice.Invoice doc = cmd.AddNew();

    doc.DebtorCode = “300-A001″;

 

    BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceDetail detail = doc.AddDetail();

    detail.ItemCode = “Item1″;

    detail.Qty = 5;

    detail.UnitPrice = 100;

 

    detail = doc.AddDetail();

    detail.ItemCode = “Item2″;

    detail.Qty = 1;

    detail.UnitPrice = 200;

 

    doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);

}

 

 

Edit Invoice

Edit Code Snippet

public void UpdateInvoice()

{

    BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand cmd = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand.Create(myDBSetting);

 

    BCE.AutoCount.Invoicing.Sales.Invoice.Invoice doc = cmd.Edit(“I-000001″);

    if (doc != null)

    {

        doc.DebtorCode = “300-B001″;

 

        doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);

    }

}

 

 

Delete Invoice

Delete Code Snippet

public void DeleteInvoice()

{

    BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand cmd = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand.Create(myDBSetting);

    cmd.Delete(“I-000001″);

}

 

 

Invoice Class Properties
Invoice Properties

Field Name Type(Length) Read-Only Description
Action BCE.AutoCount.Invoicing.Action O Returns the Invoicing.Action object of this document
Agent BCE.Data.DBString(12)   The agent assign to this document
ARPayment BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity O Returns the ARPaymentEntity object of this document
Attention BCE.Data.DBString(40)   The attention assign to this document
AuditTrail BCE.AutoCount.Common.AuditTrail O Returns the AuditTrail object of this document
BranchCode BCE.Data.DBString(20)   The branch code assign to this document
CalcDiscountOnUnitPrice Boolean   The status flag for calculate discount on unit price
Cancelled Boolean O Returns true if the document is cancelled
CanSync Boolean   The status flag to allow sync for the document
Command BCE.AutoCount.Invoicing.InvoicingCommonCommand O Returns the Command object of this document
CreatedTimeStamp BCE.Data.DBDateTime O Returns the creation time of this document
CreatedUserID BCE.Data.DBString(10) O Returns the document creator user id
CSGNDocKey Long O Returns the consignment document key related to this document
CurrencyCode BCE.Data.DBString(5)   The currency code assign to this document
CurrencyRate BCE.Data.DBDecimal(18,8)   The currency rate assign to this document
DataSet DataSet O Returns the DataSet object of this document
DataTableDetail DataTable O Returns the Detail table of this document
DataTableMaster DataTable O Returns the Master table of this document
DataTablePackageDetail DataTable O Returns the Item Package Detail table of this document
DataTableSerialNo DataTable O Returns the Serial No table of this document
DataViewDetail DataView O Returns the default dataview of Detail table of this document
DebtorCode BCE.Data.DBString(12)   The debtor code assign to this document
DebtorName BCE.Data.DBString(80)   The debtor name assign to this document
DecimalSetting BCE.AutoCount.Settings.DecimalSetting O Returns the DecimalSetting accessor
DeliverAddr1 BCE.Data.DBString(40)   The deliver address part 1 assign to this document
DeliverAddr2 BCE.Data.DBString(40)   The deliver address part 2 assign to this document
DeliverAddr3 BCE.Data.DBString(40)   The deliver address part 3 assign to this document
DeliverAddr4 BCE.Data.DBString(40)   The deliver address part 4 assign to this document
DeliverContact BCE.Data.DBString(40)   The deliver contact assign to this document
DeliverFax1 BCE.Data.DBString(25)   The deliver fax1 assign to this document
DeliverPhone1 BCE.Data.DBString(25)   The deliver phone1 assign to this document
Description BCE.Data.DBString(80)   The description assign to this document
DetailCount Int O Returns the number of detail records
DisplayTerm BCE.Data.DBString(30)   The display term assign to this document
DocDate BCE.Data.DBDateTime   The document date assign to this document
DocKey Long O Returns the document key of this document
DocNo BCE.Data.DBString(20)   The document number assign to this document
DocNoFormatName String   The document number format name assign to this document
DocType String O Returns the document type of this document
EnableAutoLoadItemDetail Boolean   Enable or disable automatic load item detail
EnableAutoPrice Boolean   Enable or disable automatic price book
EnableMultiDimensionalPriceBook Boolean   Enable or disable Multi-Dimensional Price Book
EnableNoDetailItemChecking Boolean   Enable or disable detail item checking
EnableZeroNetTotalChecking Boolean   Enable or disable zero net total checking
ExTax BCE.Data.DBDecimal(18,4) O Returns the exclusive tax amount
ExternalLink BCE.AutoCount.Common.ExternalLink O Returns the ExternalLink accessor
ExternalLinkText BCE.Data.DBString   The ExternalLink text assign to this document
Fax1 BCE.Data.DBString(25)   The fax1 assign to this document
FinalTotal BCE.Data.DBString(18,4) O Returns the final total amount
Footer1Amt BCE.Data.DBDecimal(18,4)   The footer 1 amount assign to this document
Footer1LocalAmt BCE.Data.DBDecimal(18,4) O Returns the footer 1 amount in local currency
Footer1LocalTax BCE.Data.DBDecimal(18,4) O Returns the footer 1 tax amount in local currency
Footer1Param BCE.Data.DBDecimal(18,4)   The footer 1 parameter assign to this document
Footer1Tax BCE.Data.DBDecimal(18,4)   The footer 1 tax amount assign to this document
Footer1TaxType BCE.Data.DBString(14)   The footer 1 tax type assign to this document
Footer2Amt BCE.Data.DBDecimal(18,4)   The footer 2 amount assign to this document
Footer2LocalAmt BCE.Data.DBDecimal(18,4) O Returns the footer 2 amount in local currency
Footer2LocalTax BCE.Data.DBDecimal(18,4) O Returns the footer 2 tax amount in local currency
Footer2Param BCE.Data.DBDecimal(18,4)   The footer2 param assign to this document
Footer2Tax BCE.Data.DBDecimal(18,4)   The footer 2 tax amount assign to this document
Footer2TaxType BCE.Data.DBString(14)   The footer 2 tax type assign to this document
Footer3Amt BCE.Data.DBDecimal(18,4)   The footer 3 amount assign to this document
Footer3LocalAmt BCE.Data.DBDecimal(18,4) O Returns the footer 3 amount in local currency
Footer3LocalTax BCE.Data.DBDecimal(18,4) O Returns the footer 3 tax amount in local currency
Footer3Param BCE.Data.DBDecimal(18,4)   The footer3 param assign to this document
Footer3Tax BCE.Data.DBDecimal(18,4)   The footer 3 tax amount assign to this document
Footer3TaxType BCE.Data.DBString(14)   The footer 3 tax type assign to this document
FullTransferredTable DataTable O Returns the Full Transferred table of this document
GeneralSetting BCE.AutoCount.Settings.GeneralSetting O Returns the GeneralSetting accessor
InclusiveTax Boolean   The status flag if the tax type is inclusive or not
InvAddr1 BCE.Data.DBString(40)   The invoice address part 1 assign to this document
InvAddr2 BCE.Data.DBString(40)   The invoice address part 2 assign to this document
InvAddr3 BCE.Data.DBString(40)   The invoice address part 3 assign to this document
InvAddr4 BCE.Data.DBString(40)   The invoice address part 4 assign to this document
InvoiceAction BCE.AutoCount.Invoicing.Action O Returns the Invoicing.Action object of this document
InvoiceCommand BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand O Returns the InvoiceCommand object of this document
InvoiceDataSet DataSet O Returns the Invoice DataSet object of this document
IsAllowSuspendedAcc Boolean   The status flag if the suspended account is allowed to use
IsDeliveryAddressEditedManually Boolean   The status flag if the delivery address was manually edited
IsInvoiceAddressEditedManually Boolean   The status flag if the invoice address was manually edited
IsTransfered Boolean O Returns whether the document has been transferred or not
IsTransferFromSupported Boolean O Returns whether the document supports Transfer From feature
LastModified BCE.Data.DBDateTime O Returns the last modified time
LastModifiedUserID BCE.Data.DBDateTime(10) O Returns the user id that made the last modification
LastUpdate Int O Returns the number of update
LocalExTax BCE.Data.DBDecimal(18,4) O Returns the exclusive tax amount in local currency
LocalNetTotal BCE.Data.DBDecimal(18,4) O Returns the net total amount in local currency
LocalTax BCE.Data.DBDecimal(18,4) O Returns the tax amount in local currency
LocalTotalCost BCE.Data.DBDecimal(18,8)   The Total Cost amount in local currency assign to this document
MasterRow DataRow O Returns the master data row of the master table
MemberNo BCE.Data.DBString(24)   The member number assign to the document
NetTotal BCE.Data.DBDecimal(18,4) O Returns the net total
Note BCE.Data.DBString   The notes assign to the document
Phone1 BCE.Data.DBString(25)   The phone1 assign to the document
PostToGL Boolean   The status flag to post to GL
PostToStock Boolean   The status flag to post to Stock
PriceBookRule BCE.AutoCount.Invoicing.Sales.PriceBookRule O Returns the Price Book Rule of this document
PrintCount Short O Returns the Print Count of this document
ReallocatePurchaseByProject Boolean   This status flag to reallocate purchase by project
ReallocatePurchaseByProjectJEDocKey Long O Returns the journal entry document key for reallocate purchase by project
ReallocatePurchaseByProjectNo BCE.Data.DBString(10)   The project number use for reallocate purchase by project assign to this document
RecalculateMemberPoint Boolean   The status flag to recalculate member point
Ref BCE.Data.DBString(40)   The reference assign to this document
RefDocNo BCE.Data.DBString(20)   The reference document number assign to this document
ReferDocKey Long O Returns the reference document key
ReferPaymentDocKey Long O Returns the reference payment document key
Remark1 BCE.Data.DBString(40)   The Remark1 assign to this document
Remark2 BCE.Data.DBString(40)   The Remark2 assign to this document
Remark3 BCE.Data.DBString(40)   The Remark3 assign to this document
Remark4 BCE.Data.DBString(40)   The Remark4 assign to this document
RoundAdj BCE.Data.DBDecimal(18,4) O Returns the rounding adjustment
SalesCreditControl BCE.AutoCount.Invoicing.Sales.CreditControl   The Sales Credit Control assign to this document
SalesExemptionExpiryDate BCE.Data.DBDateTime   The Sales Exemption Expiry date assign to this document
SalesExemptionNo BCE.Data.DBString(60)   The Sales Exemption number assign to this document
SalesLocation BCE.Data.DBString(8)   The Sales Location assign to this document
ScriptObject BCE.AutoCount.Scripting.ScriptObject O Returns the ScriptObject of this document
SetSubTotalToNullWhenAllNull Boolean   The status flag to set sub total to null when all null
ShipInfo BCE.Data.DBString(40)   The Ship Info assign to this document
ShipVia BCE.Data.DBString(20)   The Ship Via assign to this document
Tax BCE.Data.DBDecimal(18,4)   The Tax amount assign to this document
TaxDocNo BCE.Data.DBString(20)   The Tax Document Number assign to this document
ToDocType BCE.Data.DBString(2) O Returns the To Document Type assign to this document
Total BCE.Data.DBDecimal(18,4) O Returns the Total amount assign to this document
ToTaxCurrencyRate BCE.Data.DBDecimal(18,8)   The To Tax Currency Rate assign to this document
Transferable Boolean   The status flag for the document to be transferable
TransferedFromSOByValueDataTable DataTable O Returns the Transferred From SO By Value table
UDF BCE.AutoCount.Data.UDFRecord O Returns the UDF accessor
UserAuthentication BCE.AutoCount.Authentication.UserAuthentication O Returns the UserAuthentication object of this document
UserData Object   The object that contains user data. This is use for scripting purposes
WarnZeroNetTotal Boolean O The status flag to warn the zero net total

 

 

InvoiceDetail Properties

Field Name Type(Length) Read-Only Description
AccNo BCE.Data.DBString(12)   The Account Number assign to this detail
AddToSubTotal Boolean   The status flag to add the detail to the sub total
BatchNo BCE.Data.DBString(20)   The Batch Number assign to this detail
BonusPoint BCE.Data.DBDecimal(19,2)   The Bonus Point assign to this detail
CalcByPercent BCE.Data.DBDecimal(18,6)   The Calculate By Percent assign to this detail
DataRow DataRow O Returns the data row of this detail
DeliveryDate BCE.Data.DBDateTime   The Delivery Date assign to this detail
DeptNo BCE.Data.DBString(10)   The Department Number assign to this detail
Description BCE.Data.DBString(100)   The Description assign to this detail
DetailRow DataRow O Returns the data row of this detail
Discount BCE.Data.DBString(20)   The Discount assign to this document
DiscountAmt BCE.Data.DBDecimal(18,4)   The Discount Amount assign to this document
DocKey Long O Returns the parent document key of this detail
DtlKey Long O Returns the detail key of this detail
DtlType BCE.Data.DBString(1)   The Detail Type assign to this detail
EstimatedDeliveryDate BCE.Data.DBDateTime   The Estimated Delivery Date assign to this detail
FOCQty BCE.Data.DBDecimal(18,6)   The FOC Qty assign to this detail
FOCTransferedQty BCE.Data.DBDecimal(18,6) O Returns the FOC Transferred Qty
ForConsignment Boolean   The status flag if the detail is for consignment
FromDocDtlKey Long O Returns the document detail key of the transferred detail
FromDocNo BCE.Data.DBString(20) O Returns the document number of the transferred detail
FromDocType BCE.Data.DBString(2) O Returns the document type of the transferred detail
FurtherDescription BCE.Data.DBString   The further description assign to this detail
ItemCode BCE.Data.DBString(30)   The Item Code assign to this detail
LocalFOCTotalCost BCE.Data.DBDecimal(18,8)   The FOC Total Cost amount in local currency assign to this detail
LocalSubTotal BCE.Data.DBDecimal(18,4) O Returns the Sub Total amount in local currency
LocalTax BCE.Data.DBDecimal(18,4) O Returns the Tax amount in local currency
LocalTotalCost BCE.Data.DBDecimal(18,8)   The Total Cost amount in local currency assign to this detail
Location BCE.Data.DBString(8)   The Location assign to this detail
Numbering BCE.Data.DBString(6)   The Numbering assign to this detail
OurDODate BCE.Data.DBDateTime   The Our DO Date assign to this detail
OurDONo BCE.Data.DBString(20)   The Our DO Number assign to this detail
PrintOut Boolean   The status flag to print out this detail
ProjNo BCE.Data.DBString(10)   The project number assign to this detail
Qty BCE.Data.DBDecimal(18,6)   The Qty assign to this detail
Rate BCE.Data.DBDecimal(18,6) O Returns the rate of this detail
Seq Int O Returns the sequence of this detail
SerialNoList BCE.Data.DBString O Returns the serial number list of this detail
SmallestQty BCE.Data.DBDecimal(18,6) O Returns the smallest quantity of this detail
SmallestUnitPrice BCE.Data.DBDecimal(18,6) O Returns the smallest unit price of this detail
SubTotal BCE.Data.DBDecimal(18,4)   The Sub Total assign to this detail
SubTotalExTax BCE.Data.DBDecimal(18,4) O Returns the sub total of exclusive tax of this detail
Tax BCE.Data.DBDecimal(18,4) O Returns the tax amount of this detail
TaxableAmt BCE.Data.DBDecimal(18,4)   The Taxable Amount assign to this detail
TaxAdjustment BCE.Data.DBDecimal(18,4)   The Tax Adjustment Amount assign to this detail
TaxExportCountry BCE.Data.DBString(50)   The Tax Export Country assign to this detail
TaxType BCE.Data.DBString(14)   The Tax Type assign to this detail
Transferable Boolean   The status flag for the detail to be transferable
TransferedQty BCE.Data.DBDecimal(18,6) O Returns the Transferred Qty
UDF BCE.AutoCount.Data.UDFRecord O Returns the UDF accessor
UnitPrice BCE.Data.DBDecimal(18,6)   The Unit Price assign to this detail
UOM BCE.Data.DBString(8)   The UOM assign to this detail
UserUOM BCE.Data.DBString(8)   The User UOM assign to this detail
ValueXferSODocKey Long O Returns the SO value transfer document key
YourPODate BCE.Data.DBDateTime   The Your PO Date assign to this detail
YourPONo BCE.Data.DBString(25)   The Your PO Number assign to this detail

 

 

Full Example

Code Snippet

using System;

using System.Collections.Generic;

using System.Text;

using System.Data;

using BCE.Data;

 

namespace AccessingAccounting

{

    public class AccessSales

    {

        private DBSetting myDBSetting;

 

        public AccessSales(DBSetting dbSetting)

        {

            //

            // TODO: Add constructor logic here

            //

            myDBSetting = dbSetting;

        }

 

        #region Accessing Sales Order

        public void AddSalesOrder()

        {

            BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand cmd = BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand.Create(myDBSetting);

 

            BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrder doc = cmd.AddNew();

            doc.DocNo = “SO-1234″;

            doc.DebtorCode = “300-A001″;

            doc.ShipInfo = “COURIER”;

 

            BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderDetail detail = doc.AddDetail();

            detail.Description = “PRINT COURSE BOOK”;

            detail.Qty = 100;

            detail.SubTotal = 1000;

 

            detail = doc.AddDetail();

            detail.Description = “PRINT NAMECARD”;

 

            doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);

        }

 

        public void EditSalesOrder()

        {

            BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand cmd = BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand.Create(myDBSetting);

 

            BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrder doc = cmd.Edit(“SO-1234″);

 

            if (doc != null)

            {

                doc.ShipInfo = “123″;

                doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);

            }

        }

 

        publicvoid DeleteSalesOrder()

        {

            BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand cmd = BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand.Create(myDBSetting);

            cmd.Delete(“SO-1234″);

        }

         #endregion

 

        #region Accessing Invoice

        public void AddInvoice()

        {

            BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand cmd = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand.Create(myDBSetting);

 

            BCE.AutoCount.Invoicing.Sales.Invoice.Invoice doc = cmd.AddNew();

            doc.DebtorCode = “300-A001″;

 

            BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceDetail detail = doc.AddDetail();

            detail.ItemCode = “Item1″;

            detail.Qty = 5;

            detail.UnitPrice = 100;

 

            detail = doc.AddDetail();

            detail.ItemCode = “Item2″;

            detail.Qty = 1;

            detail.UnitPrice = 200;

 

            doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);

        }

 

        public void UpdateInvoice()

        {

            BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand cmd = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand.Create(myDBSetting);

 

            BCE.AutoCount.Invoicing.Sales.Invoice.Invoice doc = cmd.Edit(“I-000001″);

            if (doc != null)

            {

                doc.DebtorCode = “300-B001″;

 

                doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);

            }

        }

 

        public void DeleteInvoice()

        {

            BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand cmd = BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand.Create(myDBSetting);

            cmd.Delete(“I-000001″);

        }

        #endregion

    }

}