new_year: add profit to account 2970
This commit is contained in:
parent
3b073d8737
commit
4b85156f60
|
|
@ -14,7 +14,8 @@ action can be one of the following:
|
|||
mwst3
|
||||
mwst4
|
||||
- new_year : writes current account balance values to STDOUT (to be used for
|
||||
new transaction file for next year)
|
||||
new transaction file for next year), profit will be added to
|
||||
the PROFIT_ACCOUNT (2970)
|
||||
|
||||
<accounts file> is a text file with the following format (example line):
|
||||
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ var profit float64 = 0.0
|
|||
const reportTitle = "Jahresrechnung - nbit Informatik GmbH"
|
||||
const journalTitle = "Journal - nbit Informatik GmbH"
|
||||
const MWST_ACCOUNT = "2201"
|
||||
const PROFIT_ACCOUNT = "2970"
|
||||
const defaultFontSize = 12
|
||||
const smallFontSize = 8
|
||||
const marginTop = 10
|
||||
|
|
@ -704,6 +705,7 @@ func outputJournal() {
|
|||
|
||||
func outputNewYear() {
|
||||
var active_accounts []string
|
||||
var amountString string
|
||||
for k := range account_balance {
|
||||
active_accounts = append(active_accounts, k)
|
||||
}
|
||||
|
|
@ -711,10 +713,14 @@ func outputNewYear() {
|
|||
for _, myaccount := range active_accounts {
|
||||
// only Assets or Liabilities
|
||||
at := accountType(myaccount)
|
||||
amountString := fmt.Sprintf("%.2f", account_balance[myaccount].balance_end+avoidMinusZero)
|
||||
if myaccount == PROFIT_ACCOUNT {
|
||||
amountString = fmt.Sprintf("%.2f", account_balance[myaccount].balance_end+avoidMinusZero-profit)
|
||||
} else {
|
||||
amountString = fmt.Sprintf("%.2f", account_balance[myaccount].balance_end+avoidMinusZero)
|
||||
}
|
||||
if at == "A" || at == "L" {
|
||||
if amountString != "0.00" {
|
||||
fmt.Printf("%s: %.2f\n", myaccount, account_balance[myaccount].balance_end)
|
||||
fmt.Printf("%s: %s\n", myaccount, amountString)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue