Search website

Access Purchase Tutorial

Introduction

In this part of the tutorial, you will learn about accessing a Purchase document via code.

In the first part of the tutorial, an example on how to programmatically add, edit and delete a Purchase Return document will be discussed while in the second part of the tutorial, an example on how to programmatically add, edit and delete a Goods Received Note document will be discussed. Note: For all the property table, the red entries are compulsory property

Accessing Purchase Return

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 Purchase Return this bridge is the PurchaseReturnCommand class.

Code Snippet
  1. BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand cmd = BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand.Create(myDBSetting);

After creating the object acting as the bridge, you may call the specific methods you need to create, edit or delete a Purchase Return.

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 Purchase Return

Add Code Snippet
  1. public void AddPurchaseReturn()
  2. {
  3.     BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand cmd = BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand.Create(myDBSetting);
  4.     BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturn doc = cmd.AddNew();
  5.     doc.CreditorCode = “400-A001″;
  6.     // Add first item
  7.     BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnDetail detail = doc.AddDetail();
  8.     detail.ItemCode = “A001″;
  9.     detail.Qty = 5;
  10.     detail.UnitPrice = 30;
  11.     // Add 2nd item
  12.     detail = doc.AddDetail();
  13.     detail.ItemCode = “A002″;
  14.     detail.Qty = 1;
  15.     detail.UnitPrice = 10.50M;
  16.     doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
  17. }

Edit Purchase Return

Edit Code Snippet
  1. public void EditPurchaseReturn()
  2. {
  3.     BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand cmd = BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand.Create(myDBSetting);
  4.     BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturn doc = cmd.Edit(“PR-000001″);
  5.     // Add new item
  6.     BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnDetail detail = doc.AddDetail();
  7.     detail.ItemCode = “A003″;
  8.     detail.Qty = 10;
  9.     detail.UnitPrice = 50;
  10.     doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
  11. }

Delete Purchase Return

Delete Code Snippet
  1. public void DeletePurchaseReturn()
  2. {
  3.     BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand cmd = BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand.Create(myDBSetting);
  4.     cmd.Delete(“PR-000001″);
  5. }

PurchaseReturn Class Properties

PurchaseReturn 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
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
CreditorCode BCE.Data.DBString(12) The creditor code assign to this document
CreditorName BCE.Data.DBString(80) The creditor name assign 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
DecimalSetting BCE.AutoCount.Settings.DecimalSetting Returns the DecimalSetting accessor
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
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
ForeignCharges BCE.Data.DBDecimal(18,8) The foreign charges 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
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
LandedCostMethod BCE.AutoCount.Invoicing.Purchase.LandedCostOption The LandedCostOption assign to the document
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
LocalCharges BCE.Data.DBDecimal(18,8) The charges amount in local currency assign to the document
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
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
PostToGL boolean The status flag to post to GL
PostToStock boolean The status flag to post to Stock
PrintCount short Returns the Print Count of this document
PurchaseLocation BCE.Data.DBString(8) The purchase location assign to the document
PurchaseReturnCommand BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand Returns the PurchaseReturnCommand object of this document
Reason BCE.Data.DBString(80) The reason assign to this document
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
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 Returns the rounding adjustment
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
SupplierCNNo BCE.Data.DBString(20) The Supplier CN No assign to this document
SupplierInvoiceNo BCE.Data.DBString(40) The Supplier Invoice No assign to this document
Tax BCE.Data.DBDecimal(18,4) The Tax amount 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
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

PurchaseReturnDetail 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
CalcByPercent BCE.Data.DBDecimal The Calculate By Percent assign to this detail
DataRow DataRow Returns the data row of 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
FOCQty BCE.Data.DBDecimal(18,6) The FOC 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
GoodsReturn boolean The status flag if the detail has been return
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 Numbering assign to this detail
OurPODate BCE.Data.DBDateTime The Our PO Date assign to this detail
OurPONo BCE.Data.DBString(20) The Our PO 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 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
TaxPermitNo BCE.Data.DBString(20) The Tax Permit No assign to this detail
TaxType BCE.Data.DBString(14) The Tax Type assign to this detail
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

Accessing Goods Received Note

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 Goods Received Note this bridge is the GoodsReceivedNoteCommand class.

Code Snippet
  1. BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd = BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(myDBSetting);

After creating the object acting as the bridge, you may call the specific methods you need to create, edit or delete a Goods Received Note document.

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 Goods Received Note

Add Code Snippet
  1. public void AddGoodsReceivedNote()
  2. {
  3.     BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd = BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(myDBSetting);
  4.     BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.AddNew();
  5.     doc.CreditorCode = “400-F001″;
  6.     // Add item
  7.     BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteDetail detail = doc.AddDetail();
  8.     detail.ItemCode = “N50″;
  9.     detail.UOM = “PCS”;
  10.     detail.Qty = 10;
  11.     detail.UnitPrice = 800;
  12.     doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
  13. }

Edit Goods Received Note

Edit Code Snippet
  1. public void EditGoodsReceivedNote()
  2. {
  3.     BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd = BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(myDBSetting);
  4.     BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.Edit(“GR-000001″);
  5.     // Add package item
  6.     BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteDetail detail = doc.AddPackage(“TEST”);
  7.     detail.Qty = 1;
  8.     // Add discount row
  9.     detail = doc.AddDiscountDetail(“Discount 10″, 10, “TX6_S”, -1);
  10.     doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
  11. }

Delete Goods Received Note

Delete Code Snippet
  1. public void DeleteGoodsReceivedNote()
  2. {
  3.     BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd = BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(myDBSetting);
  4.     cmd.Delete(“GR-000001″);
  5. }

GoodsReceivedNote Class Properties

GoodsReceivedNote 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 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
CreditorCode BCE.Data.DBString(12) The creditor code assign to this document
CreditorName BCE.Data.DBString(80) The creditor name assign 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
DecimalSetting BCE.AutoCount.Settings.DecimalSetting Returns the DecimalSetting accessor
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
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
ForeignCharges BCE.Data.DBDecimal The foreign charges assign to this document
FullTransferredTable DataTable Returns the Full Transferred table of this document
GeneralSetting BCE.AutoCount.Settings.GeneralSetting Returns the GeneralSetting accessor
GoodsReceivedNoteCommand BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand Returns the GoodsReceivedNoteCommand object of this document
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
IsAllowSuspendedAcc boolean The status flag if the suspended account is allowed to use
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
LandedCostMethod BCE.AutoCount.Invoicing.Purchase.LandedCostOption The LandedCostOption assign to the document
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
LocalCharges BCE.Data.DBDecimal The charges amount in local currency assign to the document
LocalExTax BCE.Data.DBDecimal(18,4) Returns the exclusive tax amount in local currency
LocalNetTotal BCE.Data.DBDecimal 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
NetTotal BCE.Data.DBDecimal 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
PostToStock boolean The status flag to post to Stock
PrintCount short Returns the Print Count of this document
PurchaseLocation BCE.Data.DBString The purchase location assign to the document
Ref BCE.Data.DBString 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 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 Returns the rounding adjustment
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
SupplierDONo BCE.Data.DBString(20) The Supplier DO No assign to this document
Tax BCE.Data.DBDecimal(18,4) The Tax amount 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
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

GoodsReceivedNoteDetail Properties

Field Name Type(Length) Read-only Description
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
CalcByPercent BCE.Data.DBDecimal The Calculate By Percent assign to this detail
CNAmt BCE.Data.DBDecimal(18,4) The Credit Note Amount 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
Duty BCE.Data.DBDecimal(18,8) The Duty amount 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
ForeignCharges BCE.Data.DBDecimal(18,8) The foreign charges 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
LocalCharges BCE.Data.DBDecimal(18,8) The charges 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
Location BCE.Data.DBString(8) The Location assign to this detail
Numbering BCE.Data.DBString(6) The Numbering assign to this detail
OurPODate BCE.Data.DBDateTime The Our PO Date assign to this detail
OurPONo BCE.Data.DBString(20) The Our PO 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 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
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

Full Example

Code Snippet
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using BCE.Data;
  5. namespace AccessingAccounting
  6. {
  7.     public class AccessPurchase
  8.     {
  9.         private DBSetting myDBSetting;
  10.         public AccessPurchase(DBSetting dbSetting)
  11.         {
  12.             //
  13.             // TODO: Add constructor logic here
  14.             //
  15.             myDBSetting = dbSetting;
  16.         }
  17.         #region Accessing Purchase Return
  18.         public void AddPurchaseReturn()
  19.         {
  20.             BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand cmd = BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand.Create(myDBSetting);
  21.             BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturn doc = cmd.AddNew();
  22.             doc.CreditorCode = “400-A001″;
  23.             // Add first item
  24.             BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnDetail detail = doc.AddDetail();
  25.             detail.ItemCode = “A001″;
  26.             detail.Qty = 5;
  27.             detail.UnitPrice = 30;
  28.             // Add 2nd item
  29.             detail = doc.AddDetail();
  30.             detail.ItemCode = “A002″;
  31.             detail.Qty = 1;
  32.             detail.UnitPrice = 10.50M;
  33.             doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
  34.         }
  35.         public void EditPurchaseReturn()
  36.         {
  37.             BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand cmd = BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand.Create(myDBSetting);
  38.             BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturn doc = cmd.Edit(“PR-000001″);
  39.             // Add new item
  40.             BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnDetail detail = doc.AddDetail();
  41.             detail.ItemCode = “A003″;
  42.             detail.Qty = 10;
  43.             detail.UnitPrice = 50;
  44.             doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
  45.         }
  46.         public void DeletePurchaseReturn()
  47.         {
  48.             BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand cmd = BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnCommand.Create(myDBSetting);
  49.             cmd.Delete(“PR-000001″);
  50.         }
  51.         #endregion
  52.         #region Accessing Goods Received Note
  53.         public void AddGoodsReceivedNote()
  54.         {
  55.             BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd = BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(myDBSetting);
  56.             BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.AddNew();
  57.             doc.CreditorCode = “400-F001″;
  58.             // Add item
  59.             BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteDetail detail = doc.AddDetail();
  60.             detail.ItemCode = “N50″;
  61.             detail.UOM = “PCS”;
  62.             detail.Qty = 10;
  63.             detail.UnitPrice = 800;
  64.             doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
  65.         }
  66.         public void EditGoodsReceivedNote()
  67.         {
  68.             BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd = BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(myDBSetting);
  69.             BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.Edit(“GR-000001″);
  70.             // Add package item
  71.             BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteDetail detail = doc.AddPackage(“TEST”);
  72.             detail.Qty = 1;
  73.             // Add discount row
  74.             detail = doc.AddDiscountDetail(“Discount 10″, 10, “TX6_S”, -1);
  75.             doc.Save(BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
  76.         }
  77.         public void DeleteGoodsReceivedNote()
  78.         {
  79.             BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand cmd = BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand.Create(myDBSetting);
  80.             cmd.Delete(“GR-000001″);
  81.         }
  82.         #endregion
  83.     }
  84. }