Conversation
…za la interfaz correspondiente
There was a problem hiding this comment.
Pull Request Overview
This PR implements tax operation functionality by adding a new "operacion" field to the tax (Impuesto) model and related UI components. The changes support categorizing taxes by operation type (e.g., VAT, IGIC, Ceuta y Melilla).
- Adds new "operacion" field to tax database table and model
- Creates OperacionIVA library class to manage tax operation types
- Updates UI views to include operation selection dropdown
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Core/Table/impuestos.xml | Adds operacion column to tax database table |
| Core/Model/Impuesto.php | Adds operacion property to tax model |
| Core/Lib/OperacionIVA.php | New library class defining tax operation constants and methods |
| Core/XMLView/ListImpuesto.xml | Adds operation column to tax list view |
| Core/XMLView/EditImpuesto.xml | Adds operation field to tax edit form |
| Core/Controller/ListImpuesto.php | Populates operation dropdown values in list view |
| Core/Controller/EditImpuesto.php | Populates operation dropdown values in edit view |
| Core/Data/Codpais/ESP/impuestos.csv | Updates Spanish tax data with operation values |
| Core/View/Master/MicroTemplate.html.twig | Adds version parameters to CSS/JS assets |
| Core/View/Master/MenuTemplate.html.twig | Adds version parameters to CSS/JS assets |
|
|
||
| /** @var array */ | ||
| private static $values = []; | ||
|
|
||
| public static function add(string $key, string $value): void | ||
| { | ||
| $fixedKey = substr($key, 0, 20); |
There was a problem hiding this comment.
The magic number 20 should be defined as a named constant to improve code maintainability and make the key length limit explicit.
| /** @var array */ | |
| private static $values = []; | |
| public static function add(string $key, string $value): void | |
| { | |
| $fixedKey = substr($key, 0, 20); | |
| const MAX_KEY_LENGTH = 20; | |
| /** @var array */ | |
| private static $values = []; | |
| public static function add(string $key, string $value): void | |
| { | |
| $fixedKey = substr($key, 0, self::MAX_KEY_LENGTH); |
| /** @var string */ | ||
| public $descripcion; | ||
|
|
||
| /** @var string */ |
There was a problem hiding this comment.
The new operacion property lacks documentation. Consider adding a docstring comment explaining its purpose and expected values.
| /** @var string */ | |
| /** | |
| * Describes the type of operation associated with the tax. | |
| * Expected values: a string representing the operation type, such as "sale" or "purchase". | |
| * @var string | |
| */ |
| <columns> | ||
| <group name="data" numcolumns="12"> | ||
| <column name="description" numcolumns="6" order="100"> | ||
| <column name="description" numcolumns="4" order="100"> |
There was a problem hiding this comment.
[nitpick] The description column width was reduced from 6 to 4 columns to accommodate the new operation field. Verify that the description field remains adequately sized for typical tax descriptions.
| <column name="description" numcolumns="4" order="100"> | |
| <column name="description" numcolumns="6" order="100"> |
|
Revisa los valores del csv porque creo que no están bien. |
…989-operacion-impuestos
…o en la base de datos
Tarea #3989