Access Sales Tutorial
Posted on November 3, 2014 | By Mohd Imran
Contents
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.
- 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
- 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
- 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
- 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 | √ | 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 | √ | 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 | √ | 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 | √ | Returns the Command object of this document |
CreatedTimeStamp | BCE.Data.DBDateTime | √ | Returns the creation time of this document |
CreatedUserID | BCE.Data.DBString(10) | √ | Returns the document creator user id |
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 | √ | Returns the DataSet object of this document |
DataTableDetail | DataTable | √ | Returns the Detail table of this document |
DataTableMaster | DataTable | √ | Returns the Master table of this document |
DataTablePackageDetail | DataTable | √ | Returns the Item Package Detail table of this document |
DataViewDetail | DataView | √ | 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 | √ | 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 | √ | 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 | √ | 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 | √ | 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) | √ | Returns exclusive tax amount |
ExternalLink | BCE.AutoCount.Common.ExternalLink | √ | 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) | √ | 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) | √ | Returns the footer 1 amount in local currency |
Footer1LocalTax | BCE.Data.DBDecimal(18,4) | √ | 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) | √ | Returns the footer 2 amount in local currency |
Footer2LocalTax | BCE.Data.DBDecimal(18,4) | √ | 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) | √ | Returns the footer 3 amount in local currency |
Footer3LocalTax | BCE.Data.DBDecimal(18,4) | √ | 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 | √ | Returns the Full Transferred table of this document |
GeneralSetting | BCE.AutoCount.Settings.GeneralSetting | √ | 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 | √ | Returns whether the document has been transferred or not |
IsTransferFromSupported | boolean | √ | Returns whether the document supports Transfer From feature |
LastModified | BCE.Data.DBDateTime | √ | Returns the last modified time |
LastModifiedUserID | BCE.Data.DBDateTime(10) | √ | Returns the user id that made the last modification |
LastUpdate | int | √ | Returns the number of update |
LocalExTax | BCE.Data.DBDecimal(18,4) | √ | Returns the exclusive tax amount in local currency |
LocalNetTotal | BCE.Data.DBDecimal(18,4) | √ | Returns the net total amount in local currency |
LocalTax | BCE.Data.DBDecimal(18,4) | √ | Returns the tax amount in local currency |
MasterRow | DataRow | √ | 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) | √ | 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 | √ | Returns the Price Book Rule of this document |
PrintCount | short | √ | 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 | √ | 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 | √ | Returns the Invoicing.Action object of this document |
SalesOrderCommand | BCE.AutoCount.Invoicing.Sales.SalesOrder.SalesOrderCommand | √ | Returns the SalesOrderCommand object of this document |
SalesOrderDataSet | DataSet | √ | Returns the Sales Order DataSet object of this document |
ScriptObject | BCE.AutoCount.Scripting.ScriptObject | √ | 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 the document | |
ShipVia | BCE.Data.DBString(20) | The Ship Via assign to the document | |
Tax | BCE.Data.DBDecimal(18,4) | The Tax amount assign to the document | |
ToDocType | BCE.Data.DBString(2) | √ | Returns the To Document Type |
Total | BCE.Data.DBDecimal(18,4) | √ | Returns the Total amount |
ToTaxCurrencyRate | BCE.Data.DBDecimal(18,8) | The To Tax Currency Rate assign to the document | |
Transferable | boolean | The status flag for the document to be transferable | |
TransferedAmt | BCE.Data.DBDecimal | √ | Returns the transferred amount |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
UserAuthentication | BCE.AutoCount.Authentication.UserAuthentication | √ | Returns the UserAuthentication object of this document |
UserData | object | The object that contains user data. This is use for scripting purposes. | |
WarnZeroNetTotal | boolean | √ | 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 | √ | 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 | √ | Returns the data row of this detail |
Discount | BCE.Data.DBString(20) | The Discount assign to this detail | |
DiscountAmt | BCE.Data.DBDecimal(18,4) | The Discount Amount to this detail | |
DocKey | long | √ | Returns the parent document key of this detail |
DtlKey | long | √ | 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) | √ | The FOC Transferred Qty assign to this detail |
FromDocDtlKey | long | √ | Returns the document detail key of the transferred detail |
FromDocNo | BCE.Data.DBString(20) | √ | Returns the document number of the transferred detail |
FromDocType | BCE.Data.DBString(2) | √ | 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) | √ | Returns the Sub Total amount in local currency |
LocalTax | BCE.Data.DBDecimal(18,4) | √ | Returns the Tax amount in local currency |
Location | BCE.Data.DBString(8) | The Location assign to this detail | |
Numbering | BCE.Data.DBString(6) | The Numbersing 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) | √ | Returns the rate of this detail |
Seq | int | √ | Returns the sequence of this detail |
SmallestQty | BCE.Data.DBDecimal(18,6) | √ | Returns the smallest quantity of this detail |
SmallestUnitPrice | BCE.Data.DBDecimal(18,6) | √ | Returns the smallest unit price of this detail |
SubTotal | BCE.Data.DBDecimal(18,4) | The Sub Total amount assign to this detail | |
SubTotalExTax | BCE.Data.DBDecimal(18,4) | √ | Returns the sub total exclusive tax amount |
Tax | BCE.Data.DBDecimal(18,4) | √ | 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) | √ | Returns the Transferred AO Qty |
TransferedQty | BCE.Data.DBDecimal(18,6) | √ | Returns the Transferred Qty |
UDF | BCE.AutoCount.Data.UDFRecord | √ | 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.
- 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
- 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
- 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
- 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 | √ | 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 | √ | Returns the ARPaymentEntity object of this document |
Attention | BCE.Data.DBString(40) | The Attention assign to this document | |
AuditTrail | BCE.AutoCount.Common.AuditTrail | √ | Returns the AuditTrail object of this document |
BranchCode | BCE.Data.DBString(20) | The Branch Code assign to this document | |
CalcDiscountOnUnitPrice | boolean | The status flag to calculate discount on unit price | |
Cancelled | boolean | √ | Returns true if the document is cancelled |
CanSync | boolean | The status flag to allow sync for the document | |
Command | BCE.AutoCount.Invoicing.InvoicingCommonCommand | √ | Returns the Command object of this document |
CreatedTimeStamp | BCE.Data.DBDateTime | √ | Returns the creation time of this document |
CreatedUserID | BCE.Data.DBString(10) | √ | Returns the document creator user id |
CSGNDocKey | long | √ | 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 | √ | Returns the DataSet object of this document |
DataTableDetail | DataTable | √ | Returns the Detail table of this document |
DataTableMaster | DataTable | √ | Returns the Master table of this document |
DataTablePackageDetail | DataTable | √ | Returns the Item Package Detail table of this document |
DataTableSerialNo | DataTable | √ | Returns the Serial No table of this document |
DataViewDetail | DataView | √ | 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 | √ | 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 | √ | 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 | √ | 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 | √ | 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) | √ | Returns the exclusive tax amount |
ExternalLink | BCE.AutoCount.Common.ExternalLink | √ | 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) | √ | Returns the final total amount |
Footer1Amt | BCE.Data.DBDecimal(18,4) | The footer1 amount assign to this document | |
Footer1LocalAmt | BCE.Data.DBDecimal(18,4) | √ | Returns the footer1 amount in local currency |
Footer1LocalTax | BCE.Data.DBDecimal(18,4) | √ | Returns the footer1 tax amount in local currency |
Footer1Param | BCE.Data.DBDecimal(18,4) | The footer1 param assign to this document | |
Footer1Tax | BCE.Data.DBDecimal(18,4) | The footer1 tax amount assign to this document | |
Footer1TaxType | BCE.Data.DBString(14) | The footer1 tax type assign to this document | |
Footer2Amt | BCE.Data.DBDecimal(18,4) | The footer2 amount assign to this document | |
Footer2LocalAmt | BCE.Data.DBDecimal(18,4) | √ | Returns the footer2 amount in local currency |
Footer2LocalTax | BCE.Data.DBDecimal(18,4) | √ | Returns the footer2 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 footer2 tax amount assign to this document | |
Footer2TaxType | BCE.Data.DBString(14) | The footer2 tax type assign to this document | |
Footer3Amt | BCE.Data.DBDecimal(18,4) | The footer3 amount assign to this document | |
Footer3LocalAmt | BCE.Data.DBDecimal(18,4) | √ | Returns the footer3 amount in local currency |
Footer3LocalTax | BCE.Data.DBDecimal(18,4) | √ | Returns the footer3 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 footer3 tax amount assign to this document | |
Footer3TaxType | BCE.Data.DBString(14) | The footer3 tax type assign to this document | |
FullTransferredTable | DataTable | √ | Returns the Full Transferred table of this document |
GeneralSetting | BCE.AutoCount.Settings.GeneralSetting | √ | 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 | √ | Returns the Invoicing.Action object of this document |
InvoiceCommand | BCE.AutoCount.Invoicing.Sales.Invoice.InvoiceCommand | √ | Returns the InvoiceCommand object of this document |
InvoiceDataSet | DataSet | √ | 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 | √ | Returns whether the document has been transferred or not |
IsTransferFromSupported | boolean | √ | Returns whether the document supports Transfer From feature |
LastModified | BCE.Data.DBDateTime | √ | Returns the last modified time |
LastModifiedUserID | BCE.Data.DBDateTime(10) | √ | Returns the user id that made the last modification |
LastUpdate | int | √ | Returns the number of update |
LocalExTax | BCE.Data.DBDecimal(18,4) | √ | Returns the exclusive tax amount in local currency |
LocalNetTotal | BCE.Data.DBDecimal(18,4) | √ | Returns the net total amount in local currency |
LocalTax | BCE.Data.DBDecimal(18,4) | √ | 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 | √ | Returns the master data row of the master table |
MemberNo | BCE.Data.DBString(24) | The member number assign to this document | |
NetTotal | BCE.Data.DBDecimal(18,4) | √ | Returns the net total |
Note | BCE.Data.DBString | The notes assign to this document | |
Phone1 | BCE.Data.DBString(25) | The phone1 assign to this 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 | √ | Returns the Price Book Rule of this document |
PrintCount | short | √ | Returns the Print Count of this document |
ReallocatePurchaseByProject | boolean | Ths status flag to reallocate purchase by project | |
ReallocatePurchaseByProjectJEDocKey | long | √ | 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 | √ | Returns the reference document key |
ReferPaymentDocKey | long | √ | 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) | √ | 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 | √ | 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) | √ | Returns the To Document Type assign to this document |
Total | BCE.Data.DBDecimal(18,4) | √ | 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 | √ | Returns the Transferred From SO By Value table |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
UserAuthentication | BCE.AutoCount.Authentication.UserAuthentication | √ | Returns the UserAuthentication object of this document |
UserData | object | The object that contains user data. This is use for scripting purposes. | |
WarnZeroNetTotal | boolean | √ | 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 | √ | 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 | √ | 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 | √ | Returns the parent document key of this detail |
DtlKey | long | √ | 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) | √ | Returns the FOC Transferred Qty |
ForConsignment | boolean | The status flag if the detail is for consignment | |
FromDocDtlKey | long | √ | Returns the document detail key of the transferred detail |
FromDocNo | BCE.Data.DBString(20) | √ | Returns the document number of the transferred detail |
FromDocType | BCE.Data.DBString(2) | √ | 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) | √ | Returns the Sub Total amount in local currency |
LocalTax | BCE.Data.DBDecimal(18,4) | √ | 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) | √ | Returns the rate of this detail |
Seq | int | √ | Returns the sequence of this detail |
SerialNoList | BCE.Data.DBString | √ | Returns the serial number list of this detail |
SmallestQty | BCE.Data.DBDecimal(18,6) | √ | Returns the smallest quantity of this detail |
SmallestUnitPrice | BCE.Data.DBDecimal(18,6) | √ | 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) | √ | Returns the sub total of exclusive tax of this detail |
Tax | BCE.Data.DBDecimal(18,4) | √ | 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) | √ | Returns the Transferred Qty |
UDF | BCE.AutoCount.Data.UDFRecord | √ | 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 | √ | 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 No assign to this detail |
Full Example
- 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
- }
- }