feat(banking): add cost centres and VAT to account allocations
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import { normalizeBankAllocationDetails } from "../modules/bank-allocation-details"
|
||||
|
||||
const hasValue = (value: unknown) => value !== null && value !== undefined && value !== ""
|
||||
|
||||
const stringArg = (args: Record<string, unknown>, key: string) => {
|
||||
@@ -110,6 +112,10 @@ export const prepareStatementAllocationInput = (args: Record<string, unknown>) =
|
||||
if (hasInvoice) payload.manualInvoiceSide = manualInvoiceSide
|
||||
}
|
||||
|
||||
const details = normalizeBankAllocationDetails({ ...payload, costcentre: args.costcentre })
|
||||
if (args.costcentre !== undefined) payload.costcentre = details.costcentre
|
||||
if (args.datevTaxKey !== undefined) payload.datevTaxKey = details.datevTaxKey
|
||||
|
||||
if (bookingMode === "expense") return payload
|
||||
|
||||
const depreciationMonths = requiredNumber(args, "depreciationMonths")
|
||||
|
||||
Reference in New Issue
Block a user