fix parsing amount for expense transaction
This commit is contained in:
@@ -187,16 +187,14 @@ func (t *gnucashTransactionDataRowIterator) parseTransaction(ctx core.Context, u
|
||||
toAccount = account1
|
||||
}
|
||||
|
||||
if len(fromAmount) > 0 && fromAmount[0] == '-' {
|
||||
amount, err := utils.ParseAmount(fromAmount)
|
||||
amount, err := utils.ParseAmount(fromAmount)
|
||||
|
||||
if err != nil {
|
||||
return nil, false, errs.ErrAmountInvalid
|
||||
}
|
||||
|
||||
fromAmount = utils.FormatAmount(-amount)
|
||||
if err != nil {
|
||||
return nil, false, errs.ErrAmountInvalid
|
||||
}
|
||||
|
||||
fromAmount = utils.FormatAmount(-amount)
|
||||
|
||||
data[datatable.TRANSACTION_DATA_TABLE_TRANSACTION_TYPE] = utils.IntToString(int(models.TRANSACTION_TYPE_EXPENSE))
|
||||
data[datatable.TRANSACTION_DATA_TABLE_CATEGORY] = t.getCategoryName(toAccount)
|
||||
data[datatable.TRANSACTION_DATA_TABLE_SUB_CATEGORY] = toAccount.Name
|
||||
|
||||
Reference in New Issue
Block a user