|
dolibarr 24.0.0-beta
|
Class ToolReports. More...


Public Member Functions | |
| __construct (DoliDB $db) | |
| Constructor. | |
| getDefinitions () | |
| Returns an array of tool definitions. | |
| getCategories () | |
| Return categories this tool belongs to. | |
| execute (string $name, array $args) | |
| Executes the requested tool function based on its name. | |
Public Member Functions inherited from McpTool | |
| __construct ($db, $user, $conf) | |
| Constructor. | |
| isSystem () | |
| Return true if this is a system/infrastructure tool that must always remain visible and executable regardless of the admin allow-list. | |
Private Member Functions | |
| resolveThirdparty ($args) | |
| Resolves a Thirdparty ID from either an ID or a name. | |
| getSalesReport (array $args) | |
| Generate a sales/revenue report. | |
| getThirdpartyTransactions (array $args) | |
| Generate a list of raw transactions (Invoices, Orders, Proposals). | |
| getPurchaseReport (array $args) | |
| Generate a purchase/expense report. | |
| getInventoryReport (array $args) | |
| Generate an inventory report. | |
| getFinancialReport (array $args) | |
| Generate a summary financial report (Income vs Expense). | |
Class ToolReports.
Provides various tools related to Dolibarr reports.
Definition at line 37 of file reports.class.php.
| ToolReports::__construct | ( | DoliDB | $db | ) |
| ToolReports::execute | ( | string | $name, |
| array | $args ) |
Executes the requested tool function based on its name.
| string | $name | The name of the tool to execute. |
| array<string,mixed> | $args The arguments for the tool (key-value pairs). |
Reimplemented from McpTool.
Definition at line 170 of file reports.class.php.
References getFinancialReport(), getInventoryReport(), getPurchaseReport(), getSalesReport(), and getThirdpartyTransactions().
| ToolReports::getCategories | ( | ) |
Return categories this tool belongs to.
Used by the intent parser to filter available tools.
Reimplemented from McpTool.
Definition at line 158 of file reports.class.php.
| ToolReports::getDefinitions | ( | ) |
Returns an array of tool definitions.
Reimplemented from McpTool.
Definition at line 55 of file reports.class.php.
|
private |
Generate a summary financial report (Income vs Expense).
| array<string,mixed> | $args Input arguments. |
Definition at line 696 of file reports.class.php.
References dol_stringtotime(), getEntity(), and price().
Referenced by execute().
|
private |
Generate an inventory report.
| array<string,mixed> | $args Input arguments. |
Definition at line 611 of file reports.class.php.
References getEntity(), and price().
Referenced by execute().
|
private |
Generate a purchase/expense report.
| array<string,mixed> | $args Input arguments. |
Definition at line 505 of file reports.class.php.
References dol_print_date(), dol_stringtotime(), getEntity(), price(), resolveThirdparty(), and string.
Referenced by execute().
|
private |
Generate a sales/revenue report.
| array<string,mixed> | $args Input arguments (date_start, date_end, limit, etc.) |
Definition at line 229 of file reports.class.php.
References dol_print_date(), dol_stringtotime(), getEntity(), price(), resolveThirdparty(), and string.
Referenced by execute().
|
private |
Generate a list of raw transactions (Invoices, Orders, Proposals).
| array<string,mixed> | $args Input arguments. |
Definition at line 366 of file reports.class.php.
References dol_print_date(), dol_stringtotime(), getEntity(), price(), resolveThirdparty(), and string.
Referenced by execute().
|
private |
Resolves a Thirdparty ID from either an ID or a name.
If thirdparty_id is provided, it is returned directly. Otherwise, if thirdparty_name is provided, the function searches the Dolibarr societe table using a LIKE match and returns the first match.
| array<string,mixed> | $args Input parameters (thirdparty_id, thirdparty_name) |
Definition at line 199 of file reports.class.php.
References getEntity().
Referenced by getPurchaseReport(), getSalesReport(), and getThirdpartyTransactions().