mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-19 14:42:06 +02:00
Initial commit: Accounting packages
This commit is contained in:
commit
4ef34c2317
2661 changed files with 1709616 additions and 0 deletions
|
|
@ -0,0 +1,26 @@
|
|||
/** @odoo-module **/
|
||||
import { getOdooFunctions } from "@spreadsheet/helpers/odoo_functions_helpers";
|
||||
|
||||
/** @typedef {import("@spreadsheet/helpers/odoo_functions_helpers").OdooFunctionDescription} OdooFunctionDescription*/
|
||||
|
||||
/**
|
||||
* @param {string} formula
|
||||
* @returns {number}
|
||||
*/
|
||||
export function getNumberOfAccountFormulas(formula) {
|
||||
return getOdooFunctions(formula, ["ODOO.BALANCE", "ODOO.CREDIT", "ODOO.DEBIT"]).filter(
|
||||
(fn) => fn.isMatched
|
||||
).length;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the first Account function description of the given formula.
|
||||
*
|
||||
* @param {string} formula
|
||||
* @returns {OdooFunctionDescription | undefined}
|
||||
*/
|
||||
export function getFirstAccountFunction(formula) {
|
||||
return getOdooFunctions(formula, ["ODOO.BALANCE", "ODOO.CREDIT", "ODOO.DEBIT"]).find(
|
||||
(fn) => fn.isMatched
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue