Difference between revisions of "Cash Book Received Voucher"

From AutoCount Resource Center
Jump to navigation Jump to search
m (Protected "Cash Book Received Voucher" ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite) [Delete=Allow only administrators] (indefinite)))
m
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
  +
==Technical Specification==
{{NavigateDeveloper}}
 
  +
# Net Total of the voucher must be positive;
===Rules in Cash Book Entry===
 
# Net Total of the voucher must be positive, and must not be zero.
+
# Net Total of the voucher must not be zero.
 
# Total Payment amounts must be tally with the total amounts in details.
 
# Total Payment amounts must be tally with the total amounts in details.
  +
<br />
 
  +
==References of AutoCount Accounting 1.8, 1.9==
===Assemblies version 1.8===
 
  +
{{BaseReferenceAC18}}
<pre>
 
BCE.AutoCount.dll
+
'''BCE.AutoCount.GL.dll'''
  +
<br />
BCE.AutoCount.GL.dll
 
  +
==Sample with data model==
</pre>
 
===Create new Cash Book Received===
+
===Create new Cash Book <u>Received Voucher</u>===
 
<syntaxhighlight lang="csharp">
 
<syntaxhighlight lang="csharp">
 
public void NewCashBookReceived(BCE.Data.DBSetting dbSetting, CashBookSource source)
 
public void NewCashBookReceived(BCE.Data.DBSetting dbSetting, CashBookSource source)
Line 108: Line 108:
 
});
 
});
   
newCB.Details.Add(new CashBookDetail()
+
newCB.Details.Add(new CashBookDetail(){ Account = "200-6000", Description = "ASSET PURCHASED VALUE", Amount = 60000 });
  +
newCB.Details.Add(new CashBookDetail(){ Account = "200-6005", Description = "ACCUMULATED DEPRECIATION", Amount = -50000 });
{
 
  +
newCB.Details.Add(new CashBookDetail(){ Account = "900-1050", Description = "LOSS ON SOLD", Amount = -5000 });
Account = "200-6000",
 
Description = "ASSET PURCHASED VALUE",
 
Amount = 60000
 
});
 
newCB.Details.Add(new CashBookDetail()
 
{
 
Account = "200-6005",
 
Description = "ACCUMULATED DEPRECIATION",
 
Amount = -50000
 
});
 
newCB.Details.Add(new CashBookDetail()
 
{
 
Account = "900-1050",
 
Description = "LOSS ON SOLD",
 
Amount = -5000
 
});
 
   
 
NewCashBookReceived(dbSetting, newCB);
 
NewCashBookReceived(dbSetting, newCB);
Line 132: Line 117:
 
{{Note|In this "Sold Asset" example shows how programmer can create multiple records in Cash Book Detail.}}
 
{{Note|In this "Sold Asset" example shows how programmer can create multiple records in Cash Book Detail.}}
 
[[File:ProgCBReceived.PNG|link=]]
 
[[File:ProgCBReceived.PNG|link=]]
  +
==See Also==
  +
* [[Cash Book Payment Voucher]]
  +
* [[Cash_Book_Payment_Voucher#Inclusive_GST_in_Cash_Book|Inclusive GST in Cash Book]]
  +
* [[Journal Entry]]
  +
 
[[Category:Programmer]]
 
[[Category:Programmer]]
 
[[Category:API]]
 
[[Category:API]]
 
[[Category:Integrate]]
 
[[Category:Integrate]]
 
[[Category:Plug-In]]
 
[[Category:Plug-In]]
  +
  +
{{NavigateDeveloper}}

Latest revision as of 03:23, 5 June 2018

Technical Specification

  1. Net Total of the voucher must be positive;
  2. Net Total of the voucher must not be zero.
  3. Total Payment amounts must be tally with the total amounts in details.


References of AutoCount Accounting 1.8, 1.9

BCE.AutoCount.dll
BCE.AutoCount.CommonAccounting.dll
BCE.AutoCount.MainEntry.dll
BCE.Utils.dll
BCE.Utils.UI.dll
BCE.AutoCount.GL.dll


Sample with data model

Create new Cash Book Received Voucher

public void NewCashBookReceived(BCE.Data.DBSetting dbSetting, CashBookSource source)
{
    BCE.AutoCount.GL.CashBook.CashBookCommand cmd = BCE.AutoCount.GL.CashBook.CashBookCommand.Create(dbSetting);
    BCE.AutoCount.GL.CashBook.CashBook doc = cmd.AddNew(BCE.AutoCount.GL.CashBook.CashBookType.CashReceipt);
    BCE.AutoCount.GL.CashBook.CashBookPaymentDetail payment = null;
    BCE.AutoCount.GL.CashBook.CashBookDetail cbdtl = null;

    doc.ReceiveFrom = source.From;
    doc.Description = source.Description;
    doc.CurrencyCode = source.CurrencyCode;
    doc.CurrencyRate = source.CurrencyRate;
    doc.DocNo = source.VoucherNo;
    doc.DocDate = source.VoucherDate;

    foreach (ReceivedDetail pay in source.Payments)
    {
        payment = doc.AddPaymentDetail();
        payment.PaymentMethod = pay.PaymentMethod;
        payment.ChequeNo = pay.ChequeNo;
        payment.BankCharge = pay.BankCharge;
        payment.PaymentAmount = pay.Amount;
    }

    foreach (CashBookDetail dtl in source.Details)
    {
        cbdtl = doc.AddDetail();
        cbdtl.AccNo = dtl.Account;
        cbdtl.Description = dtl.Description;
        cbdtl.Amount = dtl.Amount;
        cbdtl.TaxType = dtl.GSTCode;
        cbdtl.InclusiveTax = dtl.Inclusive;
    }

    try
    {
        doc.Save();
        //log success
    }
    catch (BCE.Application.AppException ex)
    {
        //log ex.Message
    }
}

Classes of source

public class CashBookSource
{
    public string From { get; set; }
    public string Description { get; set; }
    public string CurrencyCode { get; set; }
    public decimal CurrencyRate { get; set; }
    public string VoucherNo { get; set; }
    public DateTime VoucherDate { get; set; }
    public List<ReceivedDetail> Payments { get; set; } = new List<ReceivedDetail>();
    public List<CashBookDetail> Details { get; set; } = new List<CashBookDetail>();
}

public class ReceivedDetail
{
    public string PaymentMethod { get; set; }
    public string ChequeNo { get; set; }
    public decimal BankCharge { get; set; }
    public decimal Amount { get; set; }
}

public class CashBookDetail
{
    public string Account { get; set; }
    public string Description { get; set; }
    public decimal Amount { get; set; }
    public string GSTCode { get; set; }
    public bool Inclusive { get; set; } = false;
}

Implementation

public void MainEntry(BCE.Data.DBSetting dbSetting)
{
    CashBookSource newCB = new CashBookSource()
    {
        From = "KENNY LEE",
        Description = "VEHICLE SOLD",
        CurrencyCode = "MYR",
        CurrencyRate = 1,
        VoucherNo = "<<New>>",
        VoucherDate = new DateTime(2017, 11, 27),
    };

    newCB.Payments.Add(new ReceivedDetail()
    {
        PaymentMethod = "CASH",
        Amount = 5000
    });

    newCB.Details.Add(new CashBookDetail(){ Account = "200-6000", Description = "ASSET PURCHASED VALUE",    Amount =  60000 });
    newCB.Details.Add(new CashBookDetail(){ Account = "200-6005", Description = "ACCUMULATED DEPRECIATION", Amount = -50000 });
    newCB.Details.Add(new CashBookDetail(){ Account = "900-1050", Description = "LOSS ON SOLD",             Amount = -5000 });

    NewCashBookReceived(dbSetting, newCB);
}
Tips icons.png In this "Sold Asset" example shows how programmer can create multiple records in Cash Book Detail.

ProgCBReceived.PNG

See Also

Go to menu

IconAC81.png Go to top
ProgrammerGo.jpg Resources For AutoCount Software Developers