|
dolibarr 25.0.0-alpha
|
Class ToolReports. More...


Public Member Functions | |
| __construct (DoliDB $db, $user=null, $conf=null) | |
| 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 39 of file reports.class.php.
| ToolReports::__construct | ( | DoliDB | $db, |
| $user = null, | |||
| $conf = null ) |
Constructor.
Aligned with McpHandler's instantiation contract: new $className($db, $user, $conf).
| DoliDB | $db | Database handler |
| User | null | $user | Service user provided by McpHandler (from AI_MCP_USER_ID) |
| Conf | null | $conf | Dolibarr config (optional) |
Definition at line 50 of file reports.class.php.
| 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 179 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 167 of file reports.class.php.
| ToolReports::getDefinitions | ( | ) |
Returns an array of tool definitions.
Reimplemented from McpTool.
Definition at line 64 of file reports.class.php.
|
private |
Generate a summary financial report (Income vs Expense).
| array<string,mixed> | $args Input arguments. |
Definition at line 705 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 620 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 514 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 238 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 375 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 208 of file reports.class.php.
References getEntity().
Referenced by getPurchaseReport(), getSalesReport(), and getThirdpartyTransactions().