Difference between revisions of "Journal Entry"
Jump to navigation
Jump to search
m |
|||
(16 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | ==Technical Specification== |
||
− | {{NavigateDeveloper}} |
||
+ | # Direct posting of Debtor and Creditor to journal entry is not supported. |
||
− | ===Rules in Cash Book Entry=== |
||
+ | #:Journal Entry for Debtor and Creditor must be created at AR or AP. |
||
+ | # Stock Control type of accounts (Stock Balance, Stock Opening and Stock Closing) are not supported in journal entry. |
||
+ | #:Balance of stock control accounts are either manual or auto calculated in the system. |
||
# Net Total of Debit and Credit must be same amount. |
# Net Total of Debit and Credit must be same amount. |
||
− | # Debit & Credit are not allow to coexist |
+ | # Debit & Credit are not allow to coexist in the same line. Each line is either Debit or Credit. |
− | #*If the source amount is 100 at Debit, and 30 at Credit |
+ | #*If the source amount is 100 at Debit, and 30 at Credit on the same line, then 70 is placed at Debit. |
#:Eg. Debit = 100, Credit = 30, then DR = 70 |
#:Eg. Debit = 100, Credit = 30, then DR = 70 |
||
# Amount in DR and CR cannot be negative. |
# Amount in DR and CR cannot be negative. |
||
Line 10: | Line 13: | ||
<br /> |
<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 Journal Entry=== |
===Create new Journal Entry=== |
||
+ | ====Split Amount (Debit & Credit)==== |
||
<syntaxhighlight lang="csharp" highlight="27-30"> |
<syntaxhighlight lang="csharp" highlight="27-30"> |
||
public void NewJournalEntry(BCE.Data.DBSetting dbSetting, JournalSource source) |
public void NewJournalEntry(BCE.Data.DBSetting dbSetting, JournalSource source) |
||
Line 61: | Line 64: | ||
} |
} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
− | {{Note|When dtl.'''DR''' is assigned with |
+ | {{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]]}} |
{{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]]}} |
||
+ | |||
+ | ====Single Amount (Positive & Negative)==== |
||
+ | 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=== |
===Classes of source=== |
||
+ | ====Split Amount (Debit & Credit)==== |
||
− | <syntaxhighlight lang="csharp"> |
||
+ | <syntaxhighlight lang="csharp" highlight="18,19"> |
||
public class JournalSource |
public class JournalSource |
||
{ |
{ |
||
Line 85: | Line 123: | ||
public decimal? DebitAmount { get; set; } |
public decimal? DebitAmount { get; set; } |
||
public decimal? CreditAmount { 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> |
||
+ | |||
+ | ====Single Amount (Positive & Negative)==== |
||
+ | <syntaxhighlight lang="csharp" highlight="18"> |
||
+ | 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;} |
||
public BCE.AutoCount.Tax.TaxSupplyPurchase GSTSupplyPurchase { get; set; } = BCE.AutoCount.Tax.TaxSupplyPurchase.Supply; |
public BCE.AutoCount.Tax.TaxSupplyPurchase GSTSupplyPurchase { get; set; } = BCE.AutoCount.Tax.TaxSupplyPurchase.Supply; |
||
public string GSTCode { get; set; } |
public string GSTCode { get; set; } |
||
Line 92: | Line 156: | ||
===Implementation=== |
===Implementation=== |
||
+ | [[File:ProgCBJournal1.PNG|link=]] |
||
+ | ====Split Amount (Debit & Credit)==== |
||
<syntaxhighlight lang="csharp"> |
<syntaxhighlight lang="csharp"> |
||
public MainEntry(BCE.Data.DBSetting dbSetting) |
public MainEntry(BCE.Data.DBSetting dbSetting) |
||
Line 113: | Line 179: | ||
} |
} |
||
</syntaxhighlight> |
</syntaxhighlight> |
||
+ | ====Single Amount (Positive & Negative)==== |
||
+ | <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 }); |
||
− | [[File:ProgCBJournal1.PNG|link=]] |
||
+ | 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== |
==See Also== |
||
* [[Cash Book Payment Voucher]] |
* [[Cash Book Payment Voucher]] |
||
Line 124: | Line 211: | ||
[[Category:Integrate]] |
[[Category:Integrate]] |
||
[[Category:Plug-In]] |
[[Category:Plug-In]] |
||
+ | {{NavigateDeveloper}} |
Latest revision as of 03:06, 31 July 2019
Technical Specification
- Direct posting of Debtor and Creditor to journal entry is not supported.
- Journal Entry for Debtor and Creditor must be created at AR or AP.
- Stock Control type of accounts (Stock Balance, Stock Opening and Stock Closing) are not supported in journal entry.
- Balance of stock control accounts are either manual or auto calculated in the system.
- Net Total of Debit and Credit must be same amount.
- Debit & Credit are not allow to coexist in the same line. Each line is either Debit or Credit.
- If the source amount is 100 at Debit, and 30 at Credit on the same line, then 70 is placed at Debit.
- Eg. Debit = 100, Credit = 30, then DR = 70
- Amount in DR and CR cannot be negative.
- If the source amount is negative at Debit, then the amount should be placed at Credit.
- Eg. Debit = -100, then CR = 100
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 Journal Entry
Split Amount (Debit & Credit)
public void NewJournalEntry(BCE.Data.DBSetting dbSetting, JournalSource 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;
doc.Description = source.Description;
doc.CurrencyCode = source.CurrencyCode;
doc.CurrencyRate = source.CurrencyRate;
doc.DocNo = source.VoucherNo;
doc.DocDate = source.VoucherDate;
//Document Level Inclusive Tax
doc.InclusiveTax = source.InclusiveTax;
foreach (JournalDetail jnDtl in source.Details)
{
dtl = doc.AddDetail();
dtl.AccNo = jnDtl.Account;
dtl.Description = jnDtl.Description;
dtl.ProjNo = jnDtl.Project;
dtl.DeptNo = jnDtl.Department;
dtl.TaxType = jnDtl.GSTCode;
dtl.SupplyPurchase = jnDtl.GSTSupplyPurchase;
//Detail Level Inclusive Tax
dtl.InclusiveTax = jnDtl.InclusiveTax;
if (jnDtl.DebitAmount.HasValue)
dtl.DR = jnDtl.DebitAmount.Value;
else
dtl.CR = jnDtl.CreditAmount.Value;
}
try
{
doc.Save();
//log success
}
catch (BCE.Application.AppException ex)
{
//log ex.Message
}
}
![]() |
When dtl.DR is assigned with a value, system will reset the value of dtl.CR. Likewise same behavior apply to dtl.CR. |
![]() |
To learn about differences of Document Level & Detail Level Tax Inclusive, see Inclusive GST in Cash Book |
Single Amount (Positive & Negative)
Another way to accept value into Debit and Credit with positive or negative amount;
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
}
}
Classes of source
Split Amount (Debit & Credit)
public class JournalSource
{
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<JournalDetail> Details { get; set; } = new List<JournalDetail>();
}
public class JournalDetail
{
public string Account { get; set; }
public string Description { get; set; }
public string Project { get; set; }
public string Department { get; set; }
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;
}
Single Amount (Positive & Negative)
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;}
public BCE.AutoCount.Tax.TaxSupplyPurchase GSTSupplyPurchase { get; set; } = BCE.AutoCount.Tax.TaxSupplyPurchase.Supply;
public string GSTCode { get; set; }
public bool InclusiveTax { get; set; } = false;
}
Implementation
Split Amount (Debit & Credit)
public MainEntry(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", CreditAmount = 11956.00M });
newJN.Details.Add(new JournalDetail(){ Account = "900-1005", Description = "TOM", DebitAmount = 5000 });
newJN.Details.Add(new JournalDetail(){ Account = "900-1005", Description = "JERRY", DebitAmount = 4800 });
newJN.Details.Add(new JournalDetail(){ Account = "700-3010", Description = "SALARY OCT 2017", DebitAmount = 1176 });
newJN.Details.Add(new JournalDetail(){ Account = "700-3015", Description = "SALARY OCT 2017", DebitAmount = 980 });
NewJournalEntry(dbSetting, newJN);
}
Single Amount (Positive & Negative)
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);
}
See Also
![]() |
Go to top
|
![]() |
Resources For AutoCount Software Developers
|