checkout/checkout = http://www.ipohonline.biz/cart account/register = http://www.ipohonline.biz/register product/category = http://www.ipohonline.biz/category product/search = http://www.ipohonline.biz/search checkout/cart = http://www.ipohonline.biz/checkout account/wishlist = http://www.ipohonline.biz/wishlist product/product = http://www.ipohonline.biz/product product/special = http://www.ipohonline.biz/special information/information = http://www.ipohonline.biz/information common/home = http://www.ipohonline.biz
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
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

public void AddPurchaseReturn()

{

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

 

    BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturn doc = cmd.AddNew();

 

    doc.CreditorCode = “400-A001″;

 

    // Add first item

    BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnDetail detail = doc.AddDetail();

    detail.ItemCode = “A001″;

    detail.Qty = 5;

    detail.UnitPrice = 30;

 

    // Add 2nd item

    detail = doc.AddDetail();

    detail.ItemCode = “A002″;

    detail.Qty = 1;

    detail.UnitPrice = 10.50M;

 

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

}

 

 

Edit Purchase Return

Edit Code Snippet

public void EditPurchaseReturn()

{

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

 

    BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturn doc = cmd.Edit(“PR-000001″);

    // Add new item

    BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnDetail detail = doc.AddDetail();

    detail.ItemCode = “A003″;

    detail.Qty = 10;

    detail.UnitPrice = 50;

 

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

}

 

 

Delete Purchase Return

Delete Code Snippet

public void DeletePurchaseReturn()

{

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

    cmd.Delete(“PR-000001″);

}

 

 

PurchaseReturn Class Properties
PurchaseReturn 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
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(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 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
DecimalSetting BCE.AutoCount.Settings.DecimalSetting O Returns the DecimalSetting accessor
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
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
ForeignCharges BCE.Data.DBDecimal(18,8)   The foreign charges 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
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
LandedCostMethod BCE.AutoCount.Invoicing.Purchase.LandedCostOption   The LandedCostOption assign to the document
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
LocalCharges BCE.Data.DBDecimal(18,8)   The charges amount in local currency assign to the document
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
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
PostToGL Boolean   The status flag to post to GL
PostToStock Boolean   The status flag to post to Stock
PrintCount Short O 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 O 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 O 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 O Returns the rounding adjustment
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
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) O 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 O Returns the UDF accessor
UserAuthentication CE.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

 

 

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 O 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 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
FOCQty BCE.Data.DBDecimal(18,6)   The FOC 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
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) 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
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) O Returns the rate of this detail
Seq Int O Returns the sequence of this detail
SerialNoList BCE.Data.DBString   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
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 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

 

 

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

public void AddGoodsReceivedNote()

{

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

 

    BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.AddNew();

 

    doc.CreditorCode = “400-F001″;

 

    // Add item

    BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteDetail detail = doc.AddDetail();

    detail.ItemCode = “N50″;

    detail.UOM = “PCS”;

    detail.Qty = 10;

    detail.UnitPrice = 800;

 

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

}

 

 

Edit Goods Received Note

Edit Code Snippet

public void EditGoodsReceivedNote()

{

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

 

    BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.Edit(“GR-000001″);

 

    // Add package item

    BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteDetail detail = doc.AddPackage(“TEST”);

    detail.Qty = 1;

 

    // Add discount row

    detail = doc.AddDiscountDetail(“Discount 10″, 10, “TX6_S”, -1);

 

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

}

 

 

Delete Goods Received Note

Delete Code Snippet

public void DeleteGoodsReceivedNote()

{

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

    cmd.Delete(“GR-000001″);

}

 

 

GoodsReceivedNote Class Properties
GoodsReceivedNote 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 to 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
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 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
DecimalSetting BCE.AutoCount.Settings.DecimalSetting O Returns the DecimalSetting accessor
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
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 footer1 amount assign to this document
Footer1LocalAmt BCE.Data.DBDecimal(18,4) O Returns the footer1 amount in local currency
Footer1LocalTax BCE.Data.DBDecimal(18,4) O 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) O Returns the footer2 amount in local currency
Footer2LocalTax BCE.Data.DBDecimal(18,4) O 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) O Returns the footer3 amount in local currency
Footer3LocalTax BCE.Data.DBDecimal(18,4) O 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 O Returns the Full Transferred table of this document
GeneralSetting BCE.AutoCount.Settings.GeneralSetting O Returns the GeneralSetting accessor
GoodsReceivedNoteCommand BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteCommand O 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 O Returns whether the document has been transferred or not
IsTransferFromSupported Boolean O Returns whether the document supports Transfer From feature
LandedCostMethod BCE.AutoCount.Invoicing.Purchase.LandedCostOption   The LandedCostOption assign to the document
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
LocalCharges BCE.Data.DBDecimal   The charges amount in local currency assign to the document
LocalExTax BCE.Data.DBDecimal(18,4) O Returns the exclusive tax amount in local currency
LocalNetTotal BCE.Data.DBDecimal 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
NetTotal BCE.Data.DBDecimal O 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 O 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 O Returns the rounding adjustment
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
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) 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
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

 

 

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 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
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) O Returns the FOC Transferred Qty
ForeignCharges BCE.Data.DBDecimal(18,8)   The foreign charges 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
LocalCharges BCE.Data.DBDecimal(18,8)   The charges 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
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) O Returns the rate of this detail
Seq Int O Returns the sequence of this detail
SerialNoList BCE.Data.DBString   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
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

 

 

Full Example

Code Snippet

using System;

using System.Collections.Generic;

using System.Text;

using BCE.Data;

 

namespace AccessingAccounting

{

    public class AccessPurchase

    {

        private DBSetting myDBSetting;

 

        public AccessPurchase(DBSetting dbSetting)

        {

            //

            // TODO: Add constructor logic here

            //

            myDBSetting = dbSetting;

        }

 

        #region Accessing Purchase Return

        public void AddPurchaseReturn()

        {

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

 

            BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturn doc = cmd.AddNew();

 

            doc.CreditorCode = “400-A001″;

 

            // Add first item

            BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnDetail detail = doc.AddDetail();

            detail.ItemCode = “A001″;

            detail.Qty = 5;

            detail.UnitPrice = 30;

 

            // Add 2nd item

            detail = doc.AddDetail();

            detail.ItemCode = “A002″;

            detail.Qty = 1;

            detail.UnitPrice = 10.50M;

 

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

        }

 

        public void EditPurchaseReturn()

        {

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

 

            BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturn doc = cmd.Edit(“PR-000001″);

 

            // Add new item

            BCE.AutoCount.Invoicing.Purchase.PurchaseReturn.PurchaseReturnDetail detail = doc.AddDetail();

            detail.ItemCode = “A003″;

            detail.Qty = 10;

            detail.UnitPrice = 50;

 

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

        }

 

        public void DeletePurchaseReturn()

        {

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

            cmd.Delete(“PR-000001″);

        }

        #endregion

 

         #region Accessing Goods Received Note

        public void AddGoodsReceivedNote()

        {

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

 

            BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.AddNew();

 

            doc.CreditorCode = “400-F001″;

 

            // Add item

            BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteDetail detail = doc.AddDetail();

            detail.ItemCode = “N50″;

            detail.UOM = “PCS”;

            detail.Qty = 10;

            detail.UnitPrice = 800;

 

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

        }

 

        public void EditGoodsReceivedNote()

        {

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

 

            BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNote doc = cmd.Edit(“GR-000001″);

 

            // Add package item

            BCE.AutoCount.Invoicing.Purchase.GoodsReceivedNote.GoodsReceivedNoteDetail detail = doc.AddPackage(“TEST”);

            detail.Qty = 1;

 

            // Add discount row

            detail = doc.AddDiscountDetail(“Discount 10″, 10, “TX6_S”, -1);

 

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

        }

 

        public void DeleteGoodsReceivedNote()

        {

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

            cmd.Delete(“GR-000001″);

        }

        #endregion

    }

}