Access AR Tutorial
Posted on October 1, 2014 | By Mohd Imran
Contents
Introduction
After a developer has started the initialization process to consume AutoCount Accounting assemblies, he/she may begin to access the multiple functions that is available inside those same assemblies to execute what ever job that their program wish to do. This tutorial will guide the developer in accessing several AR documents in AutoCount Accounting for creation, modification and deletion purpose. Note: For all the property table, the red entries are compulsory property
Debtor
To begin writing the code that will allow you to create or modify Debtor information, you will first need to create a DebtorDataAccess object. This object will allow you to have access to database to retrieve, save or delete the debtor information you are modifying. The code below shows how to create the object in your program:
- BCE.AutoCount.ARAP.Debtor.DebtorDataAccess debtorDA = BCE.AutoCount.ARAP.Debtor.DebtorDataAccess.Create(myDBSetting);
Adding a new Debtor
- public void AddDebtor()
- {
- BCE.AutoCount.ARAP.Debtor.DebtorDataAccess debtorDA = BCE.AutoCount.ARAP.Debtor.DebtorDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.Debtor.DebtorEntity debtor = debtorDA.NewDebtor();
- debtor.CurrencyCode = “RM”;
- debtor.CompanyName = “ABC SDN. BHD.”;
- debtor.ControlAccount = “300-0000″;
- BCE.AutoCount.ARAP.Debtor.BranchEntity branch = debtor.NewBranch();
- branch.BranchCode = “1″;
- branch.BranchName = “1″;
- branch = debtor.NewBranch();
- branch.BranchCode = “2″;
- branch.BranchName = “2″;
- BCE.AutoCount.ARAP.Debtor.ContactEntity contact = debtor.NewContact();
- contact.Title = “Mr”;
- contact.Name = “XYZ”;
- debtorDA.SaveDebtor(debtor, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Updating a Debtor
- public void UpdateDebtor()
- {
- BCE.AutoCount.ARAP.Debtor.DebtorDataAccess debtorDA = BCE.AutoCount.ARAP.Debtor.DebtorDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.Debtor.DebtorEntity debtor = debtorDA.GetDebtor(“300-A001″);
- if (debtor != null)
- {
- debtor.Address1 = “New Address 1″;
- debtorDA.SaveDebtor(debtor, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- }
Deleting a Debtor
- public void DeleteDebtor()
- {
- BCE.AutoCount.ARAP.Debtor.DebtorDataAccess debtorDA = BCE.AutoCount.ARAP.Debtor.DebtorDataAccess.Create(myDBSetting);
- debtorDA.DeleteDebtor(“300-A001″);
- }
Debtor Class Properties
DebtorEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
AccNo | string(12) | The account number for this debtor | |
AccountGroup | string(12) | The account group that this debtor would be under | |
Address1 | string(40) | The address of the debtor (part 1) | |
Address2 | string(40) | The address of the debtor (part 2) | |
Address3 | string(40) | The address of the debtor (part 3) | |
Address4 | string(40) | The address of the debtor (part 4) | |
AgingOn | string(1) | Enter one of the following: I – Invoice Date or D – Due Date | |
AreaCode | string(12) | The area code of the company | |
Attention | string(40) | The attention assign to this debtor | |
BranchTable | DataTable | √ | Returns the Branch table of this document |
CompanyName | string(80) | The company name | |
ContactInfo | string | The contact info displayed in report for this document | |
ContactTable | DataTable | √ | Returns the Contact table of this document |
ControlAccount | string | The control account assign to this debtor | |
CreatedTimeStamp | DateTime | √ | Returns the creation time of the document |
CreatedUserID | string(10) | √ | Returns the user id that created the record |
CreditLimit | decimal(18,4) | The credit limit applied to this debtor | |
CSBlockMessage | string(40) | The message to be displayed when the block status is set to suspend | |
CSBlockStatus | int | Enter one of the following: 0 – All Disabled, 1 – Controlled by credit term with no block when exceed credit limit and block when exceed overdue limit, 2 – Controlled by credit term with no block when exceed credit limit and need password when exceed overdue limit, 3 – Controlled by credit term with block when exceed credit limit and no block when exceed overdue limit, 4 – Controlled by credit term with block when exceed credit and overdue limit, 5 – Controlled by credit term with block when exceed credit limit and need password when overdue limit, 6 – Controlled by credit term with need password when exceed credit limit and no block when exceed overdue limit, 7 – Controlled by credit term with need password when exceed credit limit and block when exceed overdue limit, 8 – Controlled by credit term with need password when both exceed credit and overdue limit, 9 – Suspend |
|
CurrencyCode | string(5) | The currency code assign to this document | |
Data | DataSet | √ | Returns the debtor dataset |
DebtorTable | DataTable | √ | Returns the debtor table |
DebtorType | string(20) | The debtor type assign to this debtor | |
DeliverAddr1 | string(40) | The delivery address of this debtor (part 1) | |
DeliverAddr2 | string(40) | The delivery address of this debtor (part 2) | |
DeliverAddr3 | string(40) | The delivery address of this debtor (part 3) | |
DeliverAddr4 | string(40) | The delivery address of this debtor (part 4) | |
DeliverPostCode | string(10) | The delivery postcode of this debtor | |
Desc2 | string(80) | The secondary description assign to this document | |
DiscountPercent | decimal(18,6) | The discount percentage to be applied to this debtor’s transaction | |
DisplayTerm | string(30) | The display term assign to this debtor | |
DOBlockMessage | string(40) | The message to be displayed when the block status is set to suspend | |
DOBlockStatus | int | Enter one of the following: 0 – All Disabled, 1 – Controlled by credit term with no block when exceed credit limit and block when exceed overdue limit, 2 – Controlled by credit term with no block when exceed credit limit and need password when exceed overdue limit, 3 – Controlled by credit term with block when exceed credit limit and no block when exceed overdue limit, 4 – Controlled by credit term with block when exceed credit and overdue limit, 5 – Controlled by credit term with block when exceed credit limit and need password when overdue limit, 6 – Controlled by credit term with need password when exceed credit limit and no block when exceed overdue limit, 7 – Controlled by credit term with need password when exceed credit limit and block when exceed overdue limit, 8 – Controlled by credit term with need password when both exceed credit and overdue limit, 9 – Suspend |
|
EmailAddress | string(80) | The email address assign for this debtor | |
ExemptNo | string(60) | The exempt number assign for this debtor | |
ExpiryDate | object | The expired date for the sales tax exemption number | |
ExternalLink | BCE.AutoCount.Common.ExternalLink | √ | Returns the ExternalLink accessor |
Fax1 | string(25) | The primary fax information for this debtor | |
Fax2 | string(25) | The secondary fax information for this debtor | |
GLMastTable | DataTable | √ | Returns the GLMast table |
HasBonusPoint | boolean | The status if this debtor has bonus point assigned to it | |
IsActive | boolean | The status if this debtor is actively used | |
IsCalcDiscountOnUnitPrice | boolean | The status if the discount is applied on unit price for this debtor | |
IsGroupCompany | boolean | The status if the debtor is part of a group | |
IVBlockMessage | string(40) | The message to be displayed when the block status is set to suspend | |
IVBlockStatus | int | Enter one of the following: 0 – All Disabled, 1 – Controlled by credit term with no block when exceed credit limit and block when exceed overdue limit, 2 – Controlled by credit term with no block when exceed credit limit and need password when exceed overdue limit, 3 – Controlled by credit term with block when exceed credit limit and no block when exceed overdue limit, 4 – Controlled by credit term with block when exceed credit and overdue limit, 5 – Controlled by credit term with block when exceed credit limit and need password when overdue limit, 6 – Controlled by credit term with need password when exceed credit limit and no block when exceed overdue limit, 7 – Controlled by credit term with need password when exceed credit limit and block when exceed overdue limit, 8 – Controlled by credit term with need password when both exceed credit and overdue limit, 9 – Suspend |
|
LastModified | DateTime | √ | Returns the last modified time |
LastModifiedUserID | string(10) | √ | Returns the user id that last modified the record |
NatureOfBusiness | string(40) | The business nature with this debtor | |
Note | string | The notes assign to this debtor | |
OpeningBonusPoint | decimal(19,2) | The opening bonus point assign to this debtor | |
OverdueLimit | decimal(18,4) | The overdue limit assign to this debtor | |
Phone1 | string(25) | The primary phone information for this debtor | |
Phone2 | string(25) | This secondary phone information for this debtor | |
PostCode | string(10) | The postcode for this debtor | |
PriceCategory | string(12) | The price category assign to this debtor | |
QTBlockMessage | string(40) | The message to be displayed when the block status is set to suspend | |
QTBlockStatus | int | Enter one of the following: 0 – All Disabled, 1 – Controlled by credit term with no block when exceed credit limit and block when exceed overdue limit, 2 – Controlled by credit term with no block when exceed credit limit and need password when exceed overdue limit, 3 – Controlled by credit term with block when exceed credit limit and no block when exceed overdue limit, 4 – Controlled by credit term with block when exceed credit and overdue limit, 5 – Controlled by credit term with block when exceed credit limit and need password when overdue limit, 6 – Controlled by credit term with need password when exceed credit limit and no block when exceed overdue limit, 7 – Controlled by credit term with need password when exceed credit limit and block when exceed overdue limit, 8 – Controlled by credit term with need password when both exceed credit and overdue limit, 9 – Suspend |
|
RegisterNo | string(25) | The registration number assign to this debtor | |
SalesAgent | string(12) | The sales agent assign to this debtor | |
ScriptObject | BCE.AutoCount.Scripting.ScriptObject | √ | Returns the script object associated to this debtor entity |
SOBlockMessage | string(40) | The message to be displayed when the block status is set to suspend | |
SOBlockStatus | int | Enter one of the following: 0 – All Disabled, 1 – Controlled by credit term with no block when exceed credit limit and block when exceed overdue limit, 2 – Controlled by credit term with no block when exceed credit limit and need password when exceed overdue limit, 3 – Controlled by credit term with block when exceed credit limit and no block when exceed overdue limit, 4 – Controlled by credit term with block when exceed credit and overdue limit, 5 – Controlled by credit term with block when exceed credit limit and need password when overdue limit, 6 – Controlled by credit term with need password when exceed credit limit and no block when exceed overdue limit, 7 – Controlled by credit term with need password when exceed credit limit and block when exceed overdue limit, 8 – Controlled by credit term with need password when both exceed credit and overdue limit, 9 – Suspend |
|
StatementType | string(1) | Enter one of the following: O – Open Item, B – Balance Forward or N – No Statement | |
TaxRegisterNo | string(20) | The tax registration number assign to this debtor | |
TaxType | string(14) | The tax type assign to this debtor | |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
WebURL | string(80) | The web URL assign to this debtor | |
WithholdingTaxPercent | decimal(18,6) | The withholding tax percent assign to this debtor |
BranchEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
Address1 | string(40) | The address of the branch (part 1) | |
Address2 | string(40) | The address of the branch (part 2) | |
Address3 | string(40) | The address of the branch (part 3) | |
Address4 | string(40) | The address of the branch (part 4) | |
AreaCode | string(12) | The area code for the branch | |
BranchCode | string(20) | The branch code you wish to apply to this branch | |
BranchName | string(80) | The branch name | |
BranchTable | DataTable | √ | Returns the branch table |
Contact | string(40) | The contact person for the branch | |
Fax1 | string(25) | The primary fax number | |
Fax2 | string(25) | The secondary fax number | |
IsActive | boolean | The flag that indicates that this branch is actively use | |
Phone1 | string(25) | The primary phone number | |
Phone2 | string(25) | The secondary phone number | |
PostCode | string(10) | The post code for the branch | |
SalesAgent | string(12) | The sales agent assigned to the branch |
ContactEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
ContactTable | DataTable | √ | Returns the contact table |
Department | string(30) | The department assign to this contact | |
DirectFax | string(25) | The fax number of this contact | |
DirectPhone | string(25) | The direct phone number of this contact | |
EmailAddress | string(80) | The email address assign to this contact | |
IMAddress | string(40) | The instant messaging address assign to this contact | |
IncludeInContactInfo | boolean | Set to True if you wish to add this contact into the Contact Info that is displayed in report. Set to False if you do not wish to do so | |
MobilePhone | string(25) | The mobile phone number of this contact | |
Name | string(40) | The name of this contact | |
Title | string(40) | The title assign to this contact |
AR Invoice
Similar to the previous example for Debtor, before creating or modifying any AR Invoice document, a DataAccess object must be created first.
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess arInvoiceDA = BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(myDBSetting);
Adding a new AR Invoice
- public void AddARInvoice()
- {
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess arInvoiceDA = BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceEntity arInvoice = arInvoiceDA.NewARInvoice();
- // If you want to set your own Invoice No, uncomment the next line, otherwise, the system will use automatic running number.
- // arInvoice.DocNo = “TEST-0001″;
- arInvoice.DebtorCode = “300-A001″;
- arInvoice.DisplayTerm = “Net 30 days”;
- // Add one detail item
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDTLEntity arInvoiceDetail = arInvoice.NewDetail();
- arInvoiceDetail.AccNo = “500-0000″;
- arInvoiceDetail.Amount = 500;
- arInvoiceDA.SaveARInvoice(arInvoice, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Updating the AR Invoice
- public void UpdateARInvoice()
- {
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess arInvoiceDA = BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceEntity arInvoice = arInvoiceDA.GetARInvoice(“TEST-0001″);
- // if arInvoice == null, it means the AR Invoice is not found.
- if (arInvoice == null)
- return;
- arInvoice.ClearDetails();
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDTLEntity arInvoiceDetail = arInvoice.NewDetail();
- arInvoiceDetail.AccNo = “500-0000″;
- arInvoiceDetail.Amount = 600;
- arInvoiceDA.SaveARInvoice(arInvoice, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Deleting a AR Invoice
- public void DeleteARInvoice()
- {
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess arInvoiceDA = BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(myDBSetting);
- arInvoiceDA.DeleteARInvoice(“TEST-0001″);
- }
ARInvoice Class Properties
ARInvoiceEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
AgingDate | DateTime | The aging date assign to the document | |
ARInvoiceDTLTable | DataTable | √ | Returns the ARInvoiceDTL table |
ARInvoiceTable | DataTable | √ | Returns the ARInvoice table |
AutoValue | boolean | Gets or Sets the Auto Value | |
Cancelled | boolean | √ | Returns true if the document is cancelled |
CreatedTimeStamp | DateTime | √ | Returns the creation time of the document |
CreatedUserID | string(10) | √ | Returns the user id that created the record |
CurrencyCode | string(5) | The currency code assign to the document | |
CurrencyRate | decimal(18,8) | The currency rate applied to the document | |
Data | DataSet | √ | Returns the AR Invoice dataset |
DebtorCode | string(12) | The debtor code assign to the document | |
DecimalSetting | BCE.AutoCount.Settings.DecimalSettings | √ | Returns the decimal setting information of the document |
Description | string(80) | The description for the document | |
DisplayTerm | string(30) | The display term assign to the document | |
DocDate | DateTime | The document date assign to the document | |
DocKey | long | √ | Returns the document key of the document |
DocNo | string(20) | The document number for the document | |
DocNoFormat | string | The document number format to be applied to the document | |
DueDate | DateTime | √ | Returns the document due date |
ExTax | decimal(18,4) | √ | Returns the exclusive tax amount |
ExternalLink | BCE.AutoCount.Common.ExternalLink | √ | Returns the ExternalLink accessor |
GeneralSetting | BCE.AutoCount.Settings.GeneralSetting | √ | Returns the GeneralSetting accessor |
GLTrxID | BCE.Data.DBInt64 | √ | Returns the GL Transaction ID |
InclusiveTax | boolean | The status if the tax is inclusive or not | |
IsKIV | boolean | The status if the document is kept in view folder | |
IsPastInvoice | boolean | √ | Returns true if the document is a past invoice |
IsYTDInvoice | boolean | √ | Returns true if the document is a year to date invoice |
JournalType | string(10) | The journal type assign to the document | |
LastModified | DateTime | √ | Returns the last modified time |
LastModifiedUserID | string(10) | √ | Returns the user id that last modified the record |
LocalExTax | decimal(18,4) | √ | Returns the exclusive tax amount in local currency |
LocalNetTotal | decimal(18,4) | The net total amount in local currency | |
LocalPaymentAmt | decimal(18,4) | √ | Returns the payment amount in local currency |
LocalTax | decimal(18,4) | √ | Returns the tax amount in local currency |
LocalTotal | decimal(18,4) | √ | Returns the total amount in local currency |
LocalTotal2 | decimal(18,4) | √ | Returns the total2 amount in local currency |
NetTotal | decimal(18,4) | √ | Returns the net total amount |
Note | string | The note assign to this document | |
Outstanding | decimal(18,4) | √ | Returns the outstanding amount |
PaymentAmt | decimal(18,4) | √ | Returns the payment amount |
RefNo2 | string(20) | The secondary reference number to this document | |
SalesAgent | object(12) | The Sales Agent assigned to this document. Can be set to BCE.Data.DBNull if there is no sales agent assigned to this document. If there is one, enter the string maintained in the SalesAgent table to represent the Sales Agent name | |
ScriptObject | BCE.AutoCount.Scripting.ScriptObject | √ | Returns the script object associated |
SourceKey | object | The source key of this document | |
SourceType | string(2) | The source type of this document | |
Tax | decimal(18,4) | √ | Returns the tax amount |
TaxableAmt | decimal(18,4) | √ | Returns the taxable amount |
TaxDocNo | string(20) | The tax document number assign to this document | |
Total | decimal(18,4) | √ | Returns the total amount |
Total2 | decimal(18,4) | √ | Returns the total2 amount |
ToTaxCurrencyRate | decimal(18,8) | The tax currency rate assign to this document | |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
UserAuthentication | BCE.AutoCount.Authentication.UserAuthentication | √ | Returns the UserAuthentication accessor |
ARInvoiceDTLEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
AccNo | string(12) | The account number assign to this detail record | |
Amount | decimal(18,4) | The amount of the detail record | |
ARInvoiceDTLTable | DataTable | √ | Returns the ARInvoiceDTL table |
DeptNo | object(10) | The department number assign to this record | |
Description | string(100) | The description for this detail record | |
DtlKey | long | √ | Returns the detail key of the record |
KnockOffAmount | decimal(18,4) | √ | Returns the knock off amount |
LocalNetAmount | decimal(18,4) | √ | Returns the net amount in local currency |
LocalSubTotal | decimal(18,4) | √ | Returns the sub total in local currency |
LocalTax | decimal(18,4) | √ | Returns the tax amount in local currency |
NetAmount | decimal(18,4) | √ | Returns the net amount |
ProjNo | object(10) | The project number assign to this record | |
Seq | int | The sequence of this detail information. It controls the position of this detail in the document. | |
SourceDtlKey | object | The source detail key for this record | |
SubTotal | decimal(18,4) | √ | Returns the sub total |
Tax | decimal(18,4) | The tax amount of this detail record | |
TaxableAmt | decimal(18,4) | The taxable amount of this detail record | |
TaxAdjustment | decimal(18,4) | The tax adjustment of this detail record | |
TaxExportCountry | string(50) | The tax export country assign to this detail record | |
TaxType | object(14) | The tax type assign to this detail record | |
ToAccountRate | decimal(18,8) | The To Account Rate assign to this detail record | |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
AR DN
Similar to the previous example for Debtor, before creating or modifying any AR DN document, a DataAccess object must be created first.
- BCE.AutoCount.ARAP.ARDN.ARDNDataAccess arDNDA = BCE.AutoCount.ARAP.ARDN.ARDNDataAccess.Create(myDBSetting);
Adding a new AR DN
- public void AddARDN()
- {
- BCE.AutoCount.ARAP.ARDN.ARDNDataAccess arDNDA = BCE.AutoCount.ARAP.ARDN.ARDNDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARDN.ARDNEntity arDN = arDNDA.NewARDN();
- // If you want to set your own DN No, uncomment the next line, otherwise, the system will use automatic running number.
- // arDN.DocNo = “TEST-0001″;
- arDN.DebtorCode = “300-A001″;
- arDN.DisplayTerm = “Net 30 days”;
- // Add one detail item
- BCE.AutoCount.ARAP.ARDN.ARDNDTLEntity arDNDetail = arDN.NewDetail();
- arDNDetail.AccNo = “500-0000″;
- arDNDetail.Amount = 500;
- arDNDA.SaveARDN(arDN, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Updating the AR DN
- public void UpdateARDN()
- {
- BCE.AutoCount.ARAP.ARDN.ARDNDataAccess arDNDA = BCE.AutoCount.ARAP.ARDN.ARDNDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARDN.ARDNEntity arDN = arDNDA.GetARDN(“TEST-0001″);
- // if arDN == null, it means the DN is not found.
- if (arDN == null)
- return;
- arDN.ClearDetails();
- BCE.AutoCount.ARAP.ARDN.ARDNDTLEntity arDNDetail = arDN.NewDetail();
- arDNDetail.AccNo = “500-0000″;
- arDNDetail.Amount = 600;
- arDNDA.SaveARDN(arDN, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Deleting a AR DN
- public void DeleteARDN()
- {
- BCE.AutoCount.ARAP.ARDN.ARDNDataAccess arDNDA = BCE.AutoCount.ARAP.ARDN.ARDNDataAccess.Create(myDBSetting);
- arDNDA.DeleteARDN(“TEST-0001″);
- }
ARDN Class Properties
ARDNEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
AgingDate | DateTime | The aging date assign to the document | |
ARDNDTLTable | DataTable | √ | Returns the ARDNDTL table |
ARDNTable | DataTable | √ | Returns the ARDN table |
AutoValue | boolean | Gets or Sets the Auto Value | |
Cancelled | boolean | √ | Returns true if the document is cancelled |
CreatedTimeStamp | DateTime | √ | Returns the creation time of the document |
CreatedUserID | string(10) | √ | Returns the user id that created the record |
CurrencyCode | string(5) | The currency code assign to this document | |
CurrencyRate | decimal(18,8) | The currency rate assign to this document | |
Data | DataSet | √ | Returns the AR Debit Note dataset |
DebtorCode | string(12) | The debtor code assign to this document | |
DecimalSetting | BCE.AutoCount.Settings.DecimalSettings | √ | Returns the decimal setting information of the document |
Description | string(80) | The description assign to this document | |
DisplayTerm | string(30) | The display term assign to this document | |
DNType | object(12) | The debit note type assign to the document | |
DocDate | DateTime | The document date assign to the document | |
DocKey | long | √ | Returns the document key of the document |
DocNo | string(20) | The document number for the document | |
DocNoFormat | string | The document number format to be applied to the document | |
DueDate | DateTime | √ | Returns the document due date |
ExTax | decimal(18,4) | √ | Returns the exclusive tax amount |
ExternalLink | BCE.AutoCount.Common.ExternalLink | √ | Returns the ExternalLink accessor |
GeneralSetting | BCE.AutoCount.Settings.GeneralSetting | √ | Returns the GeneralSetting accessor |
GLTrxID | BCE.Data.DBInt64 | √ | Returns the GL Transaction ID |
InclusiveTax | boolean | The status if the tax is inclusive or not | |
IsJournal | boolean | The status if the document is journal | |
IsKIV | boolean | The status if the document is kept in view folder | |
IsPastDN | boolean | √ | Returns true if the document is a past debit note |
IsYTDDN | boolean | √ | Returns true if the document is a year to date debit note |
JEKey | object | √ | Returns the journal entry document key |
JournalType | string(10) | The journal type assign to this document | |
LastModified | DateTime | √ | Returns the last modified time |
LastModifiedUserID | string(10) | √ | Returns the user id that last modified the record |
LocalExTax | decimal(18,4) | √ | The exclusive tax amount in local currency |
LocalNetTotal | decimal(18,4) | The net total amount in local currency | |
LocalPaymentAmt | decimal(18,4) | √ | Returns the payment amount in local currency |
LocalTax | decimal(18,4) | √ | Returns the tax amount in local currency |
LocalTotal | decimal(18,4) | √ | Returns the total amount in local currency |
LocalTotal2 | decimal(18,4) | √ | Returns the total2 amount in local currency |
NetTotal | decimal(18,4) | √ | Returns the net total amount |
Note | string | The notes assign to this document | |
OurInvoiceNo | string(40) | The our invoice number assign to this document | |
Outstanding | decimal(18,4) | √ | Returns the outstanding amount |
PaymentAmt | decimal(18,4) | √ | Returns the payment amount |
Reason | string(80) | The reason assign to this document | |
Ref | string(40) | The reference assign to this document | |
RefNo2 | string(20) | The secondary reference number assign to this document | |
SalesAgent | object(12) | The Sales Agent assigned to this document. Can be set to BCE.Data.DBNull if there is no sales agent assigned to this document. If there is one, enter the string maintained in the SalesAgent table to represent the Sales Agent name | |
ScriptObject | BCE.AutoCount.Scripting.ScriptObject | √ | Returns the script object associated |
SourceKey | object | The source key of this document | |
SourceType | string(2) | The source type of this document | |
Tax | decimal(18,4) | √ | Returns the tax amount |
TaxableAmt | decimal(18,4) | √ | Returns the taxable amount |
TaxDocNo | string(20) | The tax document number assign of this document | |
Total | decimal(18,4) | √ | Returns the total amount |
Total2 | decimal(18,4) | √ | Returns the total2 amount |
ToTaxCurrencyRate | decimal(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 accessor |
ARDNDTLEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
AccNo | string(12) | The account number assign to the detail record | |
Amount | decimal(18,4) | The amount assign to the detail record | |
ARDNDTLTable | DataTable | √ | Returns the ARDNDTL table |
DeptNo | object(10) | The department number assign to the detail record | |
Description | string(100) | The description assign to the detail record | |
DtlKey | long | √ | Returns the detail key of the record |
KnockOffAmount | decimal(18,4) | √ | Returns the knock off amount |
LocalNetAmount | decimal(18,4) | √ | Returns the net amount in local currency |
LocalSubTotal | decimal(18,4) | √ | Returns the sub total in local currency |
LocalTax | decimal(18,4) | √ | Returns the tax amount in local currency |
NetAmount | decimal(18,4) | √ | Returns the net amount |
ProjNo | object(10) | The project number assign to the detail record | |
Seq | int | The sequence of this detail information. It controls the position of this detail in the document. | |
SourceDtlKey | object | The source detail key for this detail record | |
SubTotal | decimal(18,4) | √ | Returns the sub total |
Tax | decimal(18,4) | The tax amount assign for this detail record | |
TaxableAmt | decimal(18,4) | The taxable amount assign for this detail record | |
TaxAdjustment | decimal(18,4) | The tax adjustment assign for this detail record | |
TaxExportCountry | string(50) | The tax export country assign for this detail record | |
TaxType | object(14) | The tax type assign for this detail record | |
ToAccountRate | decimal(18,8) | The To Account Rate for this detail record | |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
AR CN
Similar to the previous example for Debtor, before creating or modifying any AR CN document, a DataAccess object must be created first.
- BCE.AutoCount.ARAP.ARCN.ARCNDataAccess arCNDA = BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(myDBSetting);
Adding a new AR CN
- public void AddARCN()
- {
- BCE.AutoCount.ARAP.ARCN.ARCNDataAccess arCNDA = BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARCN.ARCNEntity arCN = arCNDA.NewARCN();
- // If you want to set your own CN No, uncomment the next line, otherwise, the system will use automatic running number.
- // arCN.DocNo = “TEST-0001″;
- arCN.DebtorCode = “300-A001″;
- // Add one detail item
- BCE.AutoCount.ARAP.ARCN.ARCNDTLEntity arCNDetail = arCN.NewDetail();
- arCNDetail.AccNo = “500-0000″;
- arCNDetail.Amount = 500;
- arCN.KnockOff(BCE.AutoCount.Document.DocumentType.ARInvoice, “TEST-0001″, 100);
- arCNDA.SaveARCN(arCN, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Updating the AR CN
- public void UpdateARCN()
- {
- BCE.AutoCount.ARAP.ARCN.ARCNDataAccess arCNDA = BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARCN.ARCNEntity arCN = arCNDA.GetARCN(“”);
- // if arCN == null, it means the CN is not found.
- if (arCN == null)
- return;
- arCN.ClearDetails();
- BCE.AutoCount.ARAP.ARCN.ARCNDTLEntity arCNDetail = arCN.NewDetail();
- arCNDetail.AccNo = “500-0000″;
- arCNDetail.Amount = 600;
- arCNDA.SaveARCN(arCN, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Deleting a AR CN
- public void DeleteARCN()
- {
- BCE.AutoCount.ARAP.ARCN.ARCNDataAccess arCNDA = BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(myDBSetting);
- arCNDA.DeleteARCN(“TEST-0001″, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
ARCN Class Properties
ARCNEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
ARCNDTLTable | DataTable | √ | Returns the ARCNDTL table |
ARCNKnockOffDetailTable | DataTable | √ | Returns the ARCNKnockOffDetail table |
ARCNKnockOffTable | DataTable | √ | Returns the ARCNKnockOff table |
ARCNTable | DataTable | √ | Returns the ARCN table |
AutoValue | boolean | Gets or Sets the Auto Value | |
Cancelled | boolean | √ | Returns true if the document is cancelled |
CNType | object(12) | The CN Type assign to the document | |
CreatedTimeStamp | DateTime | √ | Returns the creation time of the document |
CreatedUserID | string(10) | √ | Returns the user id that created the record |
CurrencyCode | string(5) | The currency code assign to the document | |
CurrencyRate | decimal(18,8) | The currency rate assign to the document | |
Data | DataSet | √ | Returns the AR Credit Note dataset |
DebtorCode | string(12) | The debtor code assign to the document | |
DecimalSetting | BCE.AutoCount.Settings.DecimalSettings | √ | Returns the DecimalSetting accessor |
Description | string(80) | The desciption assign to the document | |
DocDate | DateTime | The document date assign to the document | |
DocKey | long | √ | Returns the document key of the document |
DocNo | string(20) | The document number assign to the document | |
DocNoFormat | string | The document number format to be applied to the document | |
InclusiveTax | boolean | The status if the tax is inclusive or not | |
IsJournal | boolean | The status if the document is a journal | |
IsKIV | boolean | The status if the document is kept in view folder | |
IsPastCN | boolean | √ | Returns true if the document is a past credit note |
IsYDTCN | boolean | √ | Returns true if the document is a year to date credit note |
JEKey | object | √ | Returns the journal entry document key |
JournalType | string(10) | The journal type of this document | |
KnockOffAmt | decimal(18,4) | √ | Returns the knock off amount |
LastModified | DateTime | √ | Returns the last modified time |
LastModifiedUserID | string(10) | √ | Returns the user id that last modified the record |
LocalExTax | decimal(18,4) | √ | Returns the exclusive tax amount in local currency |
LocalNetTotal | decimal(18,4) | The net total amount in local currency | |
LocalTax | decimal(18,4) | √ | Returns the tax amount in local currency |
LocalTotal | decimal(18,4) | √ | Returns the total amount in local currency |
LocalTotal2 | decimal(18,4) | √ | Returns the total2 amount in local currency |
NetTotal | decimal(18,4) | √ | Returns the net total amount |
Note | string | The note assign to the document | |
OurInvoiceNo | string(40) | The Our Invoice Number assign to the document | |
Reason | string(80) | The reason assign to the document | |
Ref | string(40) | The reference assign to the document | |
RefNo2 | string(20) | The secondary reference number assign to the document | |
RefundAmt | decimal | √ | Returns the refund amount |
ScriptObject | BCE.AutoCount.Scripting.ScriptObject | √ | Returns the script object associated |
SourceKey | object | The source key of the document | |
SourceType | string(2) | The source type of the document | |
Tax | decimal(18,4) | √ | Returns the tax amount |
TaxableAmt | decimal(18,4) | √ | Returns the taxable amount |
TaxDocNo | string(20) | The Tax Document Number assign to the document | |
Total | decimal(18,4) | √ | Returns the total amount |
Total2 | decimal(18,4) | √ | Returns the total2 amount |
ToTaxCurrencyRate | decimal(18,8) | The To Tax Currency Rate assign to the document | |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
UserAuthentication | BCE.AutoCount.Authentication.UserAuthentication | √ | Returns the UserAuthentication accessor |
ARCNDTLEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
AccNo | string(12) | The account number assign to the detail record | |
Amount | decimal(18,4) | The amount assign to the detail record | |
ARCNDTLTable | DataTable | √ | Returns the ARCNDTL table |
DeptNo | object(10) | The department number assign to the detail record | |
Description | string(100) | The description assign to the detail record | |
DtlKey | long | √ | Returns the detail key of the record |
KnockOffAmount | decimal(18,4) | √ | Returns the knock off amount |
LocalNetAmount | decimal(18,4) | √ | Returns the net amount in local currency |
LocalSubTotal | decimal(18,4) | √ | Returns the sub total in local currency |
LocalTax | decimal(18,4) | √ | Returns the tax amount in local currency |
NetAmount | decimal(18,4) | √ | Returns the net amount |
ProjNo | object(10) | The project number assign to the detail record | |
Seq | int | The sequence of this detail information. It controls the position of this detail in the document. | |
SourceDtlKey | object | The source detail key for this detail record | |
SubTotal | decimal(18,4) | √ | Returns the sub total |
Tax | decimal(18,4) | The tax amount assign for the detail record | |
TaxableAmt | decimal(18,4) | The taxable amount assign for the detail record | |
TaxAdjustment | decimal(18,4) | The tax adjustment assign for the detail record | |
TaxExportCountry | string(5) | The Tax Export Country assign for the detail record | |
TaxType | object(14) | The Tax Type assign for the detail record | |
ToAccountRate | decimal(18,8) | The To Account Rate assign for the detail record | |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
AR Payment
Similar to the previous example for Debtor, before creating or modifying any AR Payment document, a DataAccess object must be created first.
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(myDBSetting);
Adding a new AR Payment
- public void AddARPayment()
- {
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity arPayment = arPaymentDA.NewARPayment();
- // If you want to set your own Payment No, uncomment the next line, otherwise, the system will use automatic running number.
- // arPayment.DocNo = “TEST-0001″;
- arPayment.DebtorCode = “300-A001″;
- // Add one detail item
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity arPaymentDetail = arPayment.NewDetail();
- arPaymentDetail.PaymentMethod = “CASH”;
- arPaymentDetail.PaymentAmt = 100;
- arPaymentDetail.ChequeNo = “MBB 123456″;
- arPayment.KnockOff(BCE.AutoCount.Document.DocumentType.ARInvoice, “TEST-0001″, 100);
- arPaymentDA.SaveARPayment(arPayment, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Updating the AR Payment
- public void UpdateARPayment()
- {
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity arPayment = arPaymentDA.GetARPayment(“TEST-0001″);
- // if arPayment == null, it means the AR Payment is not found.
- if (arPayment == null)
- return;
- arPayment.ClearDetails();
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity arPaymentDetail = arPayment.NewDetail();
- arPaymentDetail.PaymentMethod = “CARD”;
- arPaymentDetail.PaymentAmt = 600;
- arPaymentDA.SaveARPayment(arPayment, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
Deleting a AR Payment
- public void DeleteARPayment()
- {
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(myDBSetting);
- arPaymentDA.DeleteARPayment(“TEST-0001″, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
ARPayment Class Properties
ARPaymentEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
ARBadDebtRecoveryDocTable | DataTable | √ | Returns the ARBadDebtRecoveryDoc table |
ARPaymentDTLTable | DataTable | √ | Returns the ARPaymentDTL table |
ARPaymentKnockOffDetailTable | DataTable | √ | Returns the ARPaymentKnockOffDetail table |
ARPaymentKnockOffTable | DataTable | √ | Returns the ARPaymentKnockOff table |
ARPaymentTable | DataTable | √ | Returns the ARPayment table |
Cancelled | DataTable | √ | Returns true if the document is cancelled |
CBKey | object | √ | Returns the cash book document key |
CNDocNoFormat | string | The CN Document No Format assign to the document | |
CreatedTimeStamp | DateTime | √ | Returns the creation time of the document |
CreatedUserID | string(10) | √ | Returns the user id that created the record |
CurrencyCode | string(5) | The currency code assign to this document | |
Data | DataSet | √ | Returns the AR Payment dataset |
DebtorCode | string(12) | The debtor code assign to the document | |
DecimalSetting | BCE.AutoCount.Settings.DecimalSettings | √ | Returns the DecimalSetting accessor |
DeptNo | object(10) | The department number assign to the document | |
Description | string(80) | The description assign to the document | |
DocDate | DateTime | The document date assign to the document | |
DocKey | long | √ | Returns the document key of the document |
DocNo | string(20) | The document number assign to the document | |
DocNo2 | string(25) | The secondary document number assign to the document | |
DocNoFormat | string | The document number format assign to the document | |
ExternalLink | BCE.AutoCount.Common.ExternalLink | √ | Returns the ExternalLink accessor |
GeneralSetting | BCE.AutoCount.Settings.GeneralSetting | √ | Returns the GeneralSetting accessor |
GLTrxID | BCE.Data.DBInt64 | √ | Returns the GL Transaction ID |
IsKIV | boolean | The status if the document is kept in view folder | |
IsPastPayment | boolean | √ | Returns true if the document is a past payment |
IsYTDPayment | boolean | √ | Returns true if the document is a year to date payment |
KnockOffAmt | decimal(18,4) | √ | Returns the knock off amount |
LastModified | DateTime | √ | Returns the last modified time |
LastModifiedUserID | string(10) | √ | Returns the user id that last modified the record |
LocalPaymentAmt | decimal(18,4) | The payment amount in local currency | |
Note | string | The notes assign to the document | |
PaymentAmt | decimal(18,4) | √ | Returns the payment amount |
ProjNo | object(10) | The project number assign to the document | |
ReferCNDocDate | DateTime | The referred CN document date assign to the document | |
ReferCNDocKey | object | The referred CN document key assign to the document | |
ReferCNDocNo | string(20) | The referred CN document number assign to the document | |
RefundAmt | decimal(18,4) | √ | Returns the refund amount |
ScriptObject | BCE.AutoCount.Scripting.ScriptObject | √ | Returns the script object associated |
SourceKey | object | The source key of the document | |
SourceType | string(2) | The source type of the document | |
ToDebtorRate | decimal(18,8) | The To Debtor Rate assign to the document | |
ToHomeRate | decimal(18,8) | The To Home Rate assign to the document | |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
UserAuthentication | BCE.AutoCount.Authentication.UserAuthentication | √ | Returns the UserAuthentication accessor |
ARPaymentDTLEntity Properties
Field Name | Type(Length) | Read-only | Description |
---|---|---|---|
ARPaymentDTLTable | DataTable | √ | Returns the ARPaymentDTL table |
BankCharge | decimal(18,4) | The bank charge amount assign to the detail | |
BankChargeDeptNo | object(10) | The bank charge department number assign to the detail | |
BankChargeProjNo | object(10) | The bank charge project number assign to the detail | |
ChequeNo | string(20) | The cheque number assign to the detail | |
DebtorPaymentAmt | decimal(18,4) | √ | Returns the debtor payment amount |
DepositDocKey | object | The deposit document key assign to the detail | |
DtlKey | long | √ | Returns the detail key of the record |
FloatDay | int | The float day assign to the detail record | |
IsRCHQ | boolean | The status assign to show if the cheque is a return cheque | |
LocalPaymentAmt | decimal(18,4) | √ | Returns the payment amount in local currency |
PaymentAmt | decimal(18,4) | The payment amount in local currency | |
PaymentBy | string(20) | The payment by assign to the detail record | |
PaymentMethod | string(20) | The payment method assign to the detail record | |
RCHQDate | object | The return cheque date assign to the detail record | |
Seq | int | The sequence of this detail information. It controls the position of this detail in the document. | |
ToBankRate | decimal(18,8) | The To Bank Rate assign to the detail record | |
UDF | BCE.AutoCount.Data.UDFRecord | √ | Returns the UDF accessor |
WithholdingTax | decimal(18,4) | The withholding tax assign to the detail record |
Full Example
- using System;
- using System.Data;
- using BCE.Data;
- namespace AccessingAccounting
- {
- ///<summary>
- /// AccessAR demos how to access AR in AutoCount 2006 via code.
- ///</summary>
- public class AccessAR
- {
- private DBSetting myDBSetting;
- public AccessAR(DBSetting dbSetting)
- {
- myDBSetting = dbSetting;
- }
- #region Accessing Debtor
- public void AddDebtor()
- {
- BCE.AutoCount.ARAP.Debtor.DebtorDataAccess debtorDA = BCE.AutoCount.ARAP.Debtor.DebtorDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.Debtor.DebtorEntity debtor = debtorDA.NewDebtor();
- debtor.CurrencyCode = “RM”;
- debtor.CompanyName = “ABC SDN. BHD.”;
- debtor.ControlAccount = “300-0000″;
- BCE.AutoCount.ARAP.Debtor.BranchEntity branch = debtor.NewBranch();
- branch.BranchCode = “1″;
- branch.BranchName = “1″;
- branch = debtor.NewBranch();
- branch.BranchCode = “2″;
- branch.BranchName = “2″;
- BCE.AutoCount.ARAP.Debtor.ContactEntity contact = debtor.NewContact();
- contact.Title = “Mr”;
- contact.Name = “XYZ”;
- debtorDA.SaveDebtor(debtor, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void UpdateDebtor()
- {
- BCE.AutoCount.ARAP.Debtor.DebtorDataAccess debtorDA = BCE.AutoCount.ARAP.Debtor.DebtorDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.Debtor.DebtorEntity debtor = debtorDA.GetDebtor(“300-A001″);
- if (debtor != null)
- {
- debtor.Address1 = “New Address 1″;
- debtorDA.SaveDebtor(debtor, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- }
- public void DeleteDebtor()
- {
- BCE.AutoCount.ARAP.Debtor.DebtorDataAccess debtorDA = BCE.AutoCount.ARAP.Debtor.DebtorDataAccess.Create(myDBSetting);
- debtorDA.DeleteDebtor(“300-A001″);
- }
- #endregion
- #region Accessing ARInvoice
- public void AddARInvoice()
- {
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess arInvoiceDA = BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceEntity arInvoice = arInvoiceDA.NewARInvoice();
- // If you want to set your own Invoice No, uncomment the next line, otherwise, the system will use automatic running number.
- // arInvoice.DocNo = “TEST-0001″;
- arInvoice.DebtorCode = “300-A001″;
- arInvoice.DisplayTerm = “Net 30 days”;
- // Add one detail item
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDTLEntity arInvoiceDetail = arInvoice.NewDetail();
- arInvoiceDetail.AccNo = “500-0000″;
- arInvoiceDetail.Amount = 500;
- arInvoiceDA.SaveARInvoice(arInvoice, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void UpdateARInvoice()
- {
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess arInvoiceDA = BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceEntity arInvoice = arInvoiceDA.GetARInvoice(“TEST-0001″);
- // if arInvoice == null, it means the AR Invoice is not found.
- if (arInvoice == null)
- return;
- arInvoice.ClearDetails();
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDTLEntity arInvoiceDetail = arInvoice.NewDetail();
- arInvoiceDetail.AccNo = “500-0000″;
- arInvoiceDetail.Amount = 600;
- arInvoiceDA.SaveARInvoice(arInvoice, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void DeleteARInvoice()
- {
- BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess arInvoiceDA = BCE.AutoCount.ARAP.ARInvoice.ARInvoiceDataAccess.Create(myDBSetting);
- arInvoiceDA.DeleteARInvoice(“TEST-0001″);
- }
- #endregion
- #region Accessing ARDN
- public void AddARDN()
- {
- BCE.AutoCount.ARAP.ARDN.ARDNDataAccess arDNDA = BCE.AutoCount.ARAP.ARDN.ARDNDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARDN.ARDNEntity arDN = arDNDA.NewARDN();
- // If you want to set your own DN No, uncomment the next line, otherwise, the system will use automatic running number.
- // arDN.DocNo = “TEST-0001″;
- arDN.DebtorCode = “300-A001″;
- arDN.DisplayTerm = “Net 30 days”;
- // Add one detail item
- BCE.AutoCount.ARAP.ARDN.ARDNDTLEntity arDNDetail = arDN.NewDetail();
- arDNDetail.AccNo = “500-0000″;
- arDNDetail.Amount = 500;
- arDNDA.SaveARDN(arDN, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void UpdateARDN()
- {
- BCE.AutoCount.ARAP.ARDN.ARDNDataAccess arDNDA = BCE.AutoCount.ARAP.ARDN.ARDNDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARDN.ARDNEntity arDN = arDNDA.GetARDN(“TEST-0001″);
- // if arDN == null, it means the DN is not found.
- if (arDN == null)
- return;
- arDN.ClearDetails();
- BCE.AutoCount.ARAP.ARDN.ARDNDTLEntity arDNDetail = arDN.NewDetail();
- arDNDetail.AccNo = “500-0000″;
- arDNDetail.Amount = 600;
- arDNDA.SaveARDN(arDN, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void DeleteARDN()
- {
- BCE.AutoCount.ARAP.ARDN.ARDNDataAccess arDNDA = BCE.AutoCount.ARAP.ARDN.ARDNDataAccess.Create(myDBSetting);
- arDNDA.DeleteARDN(“TEST-0001″);
- }
- #endregion
- #region Accessing ARCN
- public void AddARCN()
- {
- BCE.AutoCount.ARAP.ARCN.ARCNDataAccess arCNDA = BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARCN.ARCNEntity arCN = arCNDA.NewARCN();
- // If you want to set your own CN No, uncomment the next line, otherwise, the system will use automatic running number.
- // arCN.DocNo = “TEST-0001″;
- arCN.DebtorCode = “300-A001″;
- // Add one detail item
- BCE.AutoCount.ARAP.ARCN.ARCNDTLEntity arCNDetail = arCN.NewDetail();
- arCNDetail.AccNo = “500-0000″;
- arCNDetail.Amount = 500;
- arCN.KnockOff(BCE.AutoCount.Document.DocumentType.ARInvoice, “TEST-0001″, 100);
- arCNDA.SaveARCN(arCN, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void UpdateARCN()
- {
- BCE.AutoCount.ARAP.ARCN.ARCNDataAccess arCNDA = BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARCN.ARCNEntity arCN = arCNDA.GetARCN(“”);
- // if arCN == null, it means the CN is not found.
- if (arCN == null)
- return;
- arCN.ClearDetails();
- BCE.AutoCount.ARAP.ARCN.ARCNDTLEntity arCNDetail = arCN.NewDetail();
- arCNDetail.AccNo = “500-0000″;
- arCNDetail.Amount = 600;
- arCNDA.SaveARCN(arCN, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void DeleteARCN()
- {
- BCE.AutoCount.ARAP.ARCN.ARCNDataAccess arCNDA = BCE.AutoCount.ARAP.ARCN.ARCNDataAccess.Create(myDBSetting);
- arCNDA.DeleteARCN(“TEST-0001″, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- #endregion
- #region Accessing ARPayment
- public void AddARPayment()
- {
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity arPayment = arPaymentDA.NewARPayment();
- // If you want to set your own Payment No, uncomment the next line, otherwise, the system will use automatic running number.
- // arPayment.DocNo = “TEST-0001″;
- arPayment.DebtorCode = “300-A001″;
- // Add one detail item
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity arPaymentDetail = arPayment.NewDetail();
- arPaymentDetail.PaymentMethod = “CASH”;
- arPaymentDetail.PaymentAmt = 100;
- arPaymentDetail.ChequeNo = “MBB 123456″;
- arPayment.KnockOff(BCE.AutoCount.Document.DocumentType.ARInvoice, “TEST-0001″, 100);
- arPaymentDA.SaveARPayment(arPayment, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void UpdateARPayment()
- {
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(myDBSetting);
- BCE.AutoCount.ARAP.ARPayment.ARPaymentEntity arPayment = arPaymentDA.GetARPayment(“TEST-0001″);
- // if arPayment == null, it means the AR Payment is not found.
- if (arPayment == null)
- return;
- arPayment.ClearDetails();
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDTLEntity arPaymentDetail = arPayment.NewDetail();
- arPaymentDetail.PaymentMethod = “CARD”;
- arPaymentDetail.PaymentAmt = 600;
- arPaymentDA.SaveARPayment(arPayment, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- public void DeleteARPayment()
- {
- BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess arPaymentDA = BCE.AutoCount.ARAP.ARPayment.ARPaymentDataAccess.Create(myDBSetting);
- arPaymentDA.DeleteARPayment(“TEST-0001″, BCE.AutoCount.Authentication.UserAuthentication.GetOrCreate(myDBSetting).LoginUserID);
- }
- #endregion
- }
- }