Difference between revisions of "C Customer Batches"

From Sage Evolution SDK | Documentation Portal
Jump to: navigation, search
(Created page with "A Customer Batch is created in Customers | Transactions | Customers Batches. Customer batches can take gl accounts and Supplier accounts. The batch can also be processed. ''...")
 
(No difference)

Latest revision as of 16:23, 18 July 2017

A Customer Batch is created in Customers | Transactions | Customers Batches.

Customer batches can take gl accounts and Supplier accounts. The batch can also be processed.

The following is an example of a Customer Batch

string BatchNum = "ARB1";
 
CustomerBatch.Get(1);
if (CustomerBatch.Find(BatchNum) == -1)
{
//  Batch code does not exist, so create it
CustomerBatch createsbatch = new CustomerBatch();
createsbatch.BatchNo = BatchNum;
createsbatch.Description = "CB Batch";
createsbatch.CreatedAgent = new Agent("Admin");
createsbatch.AllowGLContraSplit = true;
createsbatch.AllowDuplicateReferences = true;
createsbatch.EnterTaxOnGlContraSplit = true;
createsbatch.Save();
 
MessageBox.Show(createsbatch.BatchNo);
}
//The following code populates a customer batch and processes it
CustomerBatch CB = new CustomerBatch(BatchNum);
 
BatchDetail BDet = new BatchDetail();
BDet.Customer = new Customer("Cash");
BDet.Date = DateTime.Now;
BDet.Description = "LineDesc";
BDet.Reference = "ref1";
BDet.PostDated = false;
BDet.TransactionCode = new TransactionCode(Module.AR, "IN");
BDet.TaxType = new TaxRate(1);
BDet.AmountExclusive = 728;
BDet.GLContraAccount = new GLAccount("accounting fees");
CB.Detail.Add(BDet);
 
BDet = new BatchDetail();
CB.Detail.Add(BDet);
BDet.Supplier = new Supplier("Supplier1");
BDet.Date = DateTime.Now;
BDet.Description = "LineDesc";
BDet.Reference = "ref1";
BDet.PostDated = false;
BDet.TransactionCode = new TransactionCode(Module.AP, "IN");
BDet.TaxType = new TaxRate(1);
BDet.ContraSplit.Add("Security", "Ledger Line 1", 100, "1");
BDet.ContraSplit.Add("Sales", "Ledger Line 2", 328, "1");
BDet.AmountExclusive = 428;
 
BDet = new BatchDetail();
BDet.GLAccount = new GLAccount("Advertising");
BDet.Date = DateTime.Now;
BDet.Description = "LineDesc";
BDet.Reference = "ref1";
BDet.PostDated = false;
BDet.IsDebit = true;
BDet.TransactionCode = new TransactionCode(Module.GL, "JNL");
BDet.TaxType = new TaxRate(1);
BDet.ContraSplit.Add("Security", "Ledger Line 1", 100, "1");
BDet.ContraSplit.Add("Sales", "Ledger Line 2", 428, "1");
BDet.ContraSplit.Add("Accounting fees", "Ledger Line 3", 500, "3");
BDet.AmountExclusive = 1028;
CB.Detail.Add(BDet);
 
CB.Process();