Difference between revisions of "Journal Entry"

Jump to navigation Jump to search
no edit summary
m
{{Note|When dtl.'''DR''' is assigned with a value, system will reset the value of dtl.'''CR'''.<br />Likewise same behavior apply to dtl.'''CR'''.}}
{{Note|To learn about differences of ''Document Level'' & ''Detail Level'' '''Tax Inclusive''', see [[Cash_Book_Payment_Voucher#Inclusive_GST_in_Cash_Book|Inclusive GST in Cash Book]]}}
 
Another way to accept value into Debit and Credit with positive or negative amount;
<syntaxhighlight lang="csharp" highlight="14-17">
public void NewSingleAmountJournalEntry(BCE.Data.DBSetting dbSetting, SingleAmountJournalSource source)
{
BCE.AutoCount.GL.JournalEntry.JournalEntryCommand cmd = BCE.AutoCount.GL.JournalEntry.JournalEntryCommand.Create(dbSetting);
BCE.AutoCount.GL.JournalEntry.JournalEntry doc = cmd.AddNew();
BCE.AutoCount.GL.JournalEntry.JournalEntryDetail dtl = null;
 
//Assign necessary values to master fields
 
foreach (SingleAmountJournalDetail jnDtl in source.Details)
{
dtl = doc.AddDetail();
//Assign necessary values to detail fields
 
if (jnDtl.Amount > 0)
dtl.DR = jnDtl.Amount;
else
dtl.CR = jnDtl.Amount;
}
 
try
{
doc.Save();
//log success
}
catch (BCE.Application.AppException ex)
{
//log ex.Message
}
}
</syntaxhighlight>
 
===Classes of source===
public decimal? DebitAmount { get; set; }
public decimal? CreditAmount { get; set; }
public BCE.AutoCount.Tax.TaxSupplyPurchase GSTSupplyPurchase { get; set; } = BCE.AutoCount.Tax.TaxSupplyPurchase.Supply;
public string GSTCode { get; set; }
public bool InclusiveTax { get; set; } = false;
}
</syntaxhighlight>
 
public class SingleAmountJournalSource
{
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 bool InclusiveTax { get; set; } = false;
public List<SingleAmountJournalDetail> Details { get; set; } = new List<SingleAmountJournalDetail>();
}
 
public class SingleAmountJournalDetail
{
public string Account { get; set; }
public string Description { get; set; }
public string Project { get; set; }
public string Department { get; set; }
public decimal Amount {get; set;} = 0;
public BCE.AutoCount.Tax.TaxSupplyPurchase GSTSupplyPurchase { get; set; } = BCE.AutoCount.Tax.TaxSupplyPurchase.Supply;
public string GSTCode { get; set; }
</syntaxhighlight>
 
<syntaxhighlight lang="csharp">
public SingleAmountMainEntry(BCE.Data.DBSetting dbSetting)
{
JournalSource newJN = new JournalSource()
{
Description = "SALARY OCT 2017",
CurrencyCode = "MYR",
CurrencyRate = 1,
VoucherNo = "<<New>>",
VoucherDate = new DateTime(2017, 11, 28),
};
 
newJN.Details.Add(new JournalDetail(){ Account = "410-0000", Description = "SALARY OCT 2017", Amount = -11956.00M });
newJN.Details.Add(new JournalDetail(){ Account = "900-1005", Description = "TOM", Amount = 5000 });
newJN.Details.Add(new JournalDetail(){ Account = "900-1005", Description = "JERRY", Amount = 4800 });
newJN.Details.Add(new JournalDetail(){ Account = "700-3010", Description = "SALARY OCT 2017", Amount = 1176 });
newJN.Details.Add(new JournalDetail(){ Account = "700-3015", Description = "SALARY OCT 2017", Amount = 980 });
 
NewSingleAmountJournalEntry(dbSetting, newJN);
}
</syntaxhighlight>
<br />
==See Also==
authors, Bureaucrats, Confirmed users, Rollbackers, Administrators
2,374
edits
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu