diff --git a/Controller/Randomizer.php b/Controller/Randomizer.php index 869af53..c50abd8 100644 --- a/Controller/Randomizer.php +++ b/Controller/Randomizer.php @@ -23,7 +23,7 @@ use FacturaScripts\Core\Model\User; use FacturaScripts\Core\Tools; use FacturaScripts\Dinamic\Model\Comision; -use Symfony\Component\HttpFoundation\Response; +use FacturaScripts\Core\Response; /** * Controller to generate random data @@ -66,7 +66,7 @@ public function getPageData(): array $data = parent::getPageData(); $data['menu'] = 'admin'; $data['title'] = 'generate-test-data'; - $data['icon'] = 'fas fa-flask'; + $data['icon'] = 'fa-solid fa-flask'; return $data; } @@ -116,32 +116,32 @@ private function generateAction(string $label, int $number): void private function loadButtons(): void { - $this->addButton('', 'empresas', 'generated-companies', 'companies', 'fas fa-building', 'Random\\Empresas', 'Empresa'); - $this->addButton('', 'almacenes', 'generated-warehouses', 'warehouses', 'fas fa-warehouse', 'Random\\Almacenes', 'Almacen'); - $this->addButton('', 'transportistas', 'generated-carriers', 'carriers', 'fas fa-truck', 'Random\\AgenciasTransportes', 'AgenciaTransporte'); - $this->addButton('', 'fabricantes', 'generated-manufacturers', 'manufacturers', 'fas fa-industry', 'Random\\Fabricantes', 'Fabricante'); - $this->addButton('', 'familias', 'generated-families', 'families', 'fas fa-sitemap', 'Random\\Familias', 'Familia'); - $this->addButton('', 'atributos', 'generated-attributes', 'attributes', 'fas fa-tshirt', 'Random\\Atributos', 'Atributo'); - $this->addButton('', 'productos', 'generated-products', 'products', 'fas fa-cubes', 'Random\\Productos', 'Producto'); - $this->addButton('', 'agentes', 'generated-agents', 'agents', 'fas fa-user-tie', 'Random\\Agentes', 'Agente'); - $this->addButton('', 'contactos', 'generated-contacts', 'contacts', 'fas fa-users', 'Random\\Contactos', 'Contacto'); - $this->addButton('', 'users', 'generated-users', 'users', 'fas fa-user-circle', 'Random\\Usuarios', 'User'); - - $this->addButton('purchases', 'proveedores', 'generated-supplier', 'suppliers', 'fas fa-users', 'Random\\Proveedores', 'Proveedor'); - $this->addButton('purchases', 'presupuestosprov', 'generated-supplier-estimations', 'estimations', 'fas fa-copy', 'Random\\PresupuestosProveedores', 'PresupuestoProveedor'); - $this->addButton('purchases', 'pedidosprov', 'generated-supplier-orders', 'orders', 'fas fa-copy', 'Random\\PedidosProveedores', 'PedidoProveedor'); - $this->addButton('purchases', 'albaranesprov', 'generated-supplier-delivery-notes', 'delivery-notes', 'fas fa-copy', 'Random\\AlbaranesProveedores', 'AlbaranProveedor'); - - $this->addButton('sales', 'grupos', 'generated-customer-groups', 'customer-groups', 'fas fa-users-cog', 'Random\\GruposClientes', 'GrupoClientes'); - $this->addButton('sales', 'clientes', 'generated-customers', 'customers', 'fas fa-users', 'Random\\Clientes', 'Cliente'); + $this->addButton('', 'empresas', 'generated-companies', 'companies', 'fa-solid fa-building', 'Random\\Empresas', 'Empresa'); + $this->addButton('', 'almacenes', 'generated-warehouses', 'warehouses', 'fa-solid fa-warehouse', 'Random\\Almacenes', 'Almacen'); + $this->addButton('', 'transportistas', 'generated-carriers', 'carriers', 'fa-solid fa-truck', 'Random\\AgenciasTransportes', 'AgenciaTransporte'); + $this->addButton('', 'fabricantes', 'generated-manufacturers', 'manufacturers', 'fa-solid fa-industry', 'Random\\Fabricantes', 'Fabricante'); + $this->addButton('', 'familias', 'generated-families', 'families', 'fa-solid fa-sitemap', 'Random\\Familias', 'Familia'); + $this->addButton('', 'atributos', 'generated-attributes', 'attributes', 'fa-solid fa-tshirt', 'Random\\Atributos', 'Atributo'); + $this->addButton('', 'productos', 'generated-products', 'products', 'fa-solid fa-cubes', 'Random\\Productos', 'Producto'); + $this->addButton('', 'agentes', 'generated-agents', 'agents', 'fa-solid fa-user-tie', 'Random\\Agentes', 'Agente'); + $this->addButton('', 'contactos', 'generated-contacts', 'contacts', 'fa-solid fa-users', 'Random\\Contactos', 'Contacto'); + $this->addButton('', 'users', 'generated-users', 'users', 'fa-solid fa-user-circle', 'Random\\Usuarios', 'User'); + + $this->addButton('purchases', 'proveedores', 'generated-supplier', 'suppliers', 'fa-solid fa-users', 'Random\\Proveedores', 'Proveedor'); + $this->addButton('purchases', 'presupuestosprov', 'generated-supplier-estimations', 'estimations', 'fa-solid fa-copy', 'Random\\PresupuestosProveedores', 'PresupuestoProveedor'); + $this->addButton('purchases', 'pedidosprov', 'generated-supplier-orders', 'orders', 'fa-solid fa-copy', 'Random\\PedidosProveedores', 'PedidoProveedor'); + $this->addButton('purchases', 'albaranesprov', 'generated-supplier-delivery-notes', 'delivery-notes', 'fa-solid fa-copy', 'Random\\AlbaranesProveedores', 'AlbaranProveedor'); + + $this->addButton('sales', 'grupos', 'generated-customer-groups', 'customer-groups', 'fa-solid fa-users-cog', 'Random\\GruposClientes', 'GrupoClientes'); + $this->addButton('sales', 'clientes', 'generated-customers', 'customers', 'fa-solid fa-users', 'Random\\Clientes', 'Cliente'); if (class_exists(Comision::class)) { - $this->addButton('sales', 'comisiones', 'generated-commissions', 'commissions', 'fas fa-percentage', 'Random\\Comisiones', 'Comision'); + $this->addButton('sales', 'comisiones', 'generated-commissions', 'commissions', 'fa-solid fa-percentage', 'Random\\Comisiones', 'Comision'); } - $this->addButton('sales', 'presupuestoscli', 'generated-customer-estimations', 'estimations', 'fas fa-copy', 'Random\\PresupuestosClientes', 'PresupuestoCliente'); - $this->addButton('sales', 'pedidoscli', 'generated-customer-orders', 'orders', 'fas fa-copy', 'Random\\PedidosClientes', 'PedidoCliente'); - $this->addButton('sales', 'albaranescli', 'generated-customer-delivery-notes', 'delivery-notes', 'fas fa-copy', 'Random\\AlbaranesClientes', 'AlbaranCliente'); + $this->addButton('sales', 'presupuestoscli', 'generated-customer-estimations', 'estimations', 'fa-solid fa-copy', 'Random\\PresupuestosClientes', 'PresupuestoCliente'); + $this->addButton('sales', 'pedidoscli', 'generated-customer-orders', 'orders', 'fa-solid fa-copy', 'Random\\PedidosClientes', 'PedidoCliente'); + $this->addButton('sales', 'albaranescli', 'generated-customer-delivery-notes', 'delivery-notes', 'fa-solid fa-copy', 'Random\\AlbaranesClientes', 'AlbaranCliente'); $this->pipe('loadButtons'); } diff --git a/Lib/Random/AlbaranesClientes.php b/Lib/Random/AlbaranesClientes.php index 6dc643e..425e94e 100644 --- a/Lib/Random/AlbaranesClientes.php +++ b/Lib/Random/AlbaranesClientes.php @@ -19,7 +19,9 @@ namespace FacturaScripts\Plugins\Randomizer\Lib\Random; -use FacturaScripts\Core\Base\Calculator; +use FacturaScripts\Core\Lib\Calculator; +use FacturaScripts\Core\Tools; + use FacturaScripts\Dinamic\Model\AlbaranCliente; use Faker; diff --git a/Lib/Random/AlbaranesProveedores.php b/Lib/Random/AlbaranesProveedores.php index 5940164..c678d1e 100644 --- a/Lib/Random/AlbaranesProveedores.php +++ b/Lib/Random/AlbaranesProveedores.php @@ -19,7 +19,9 @@ namespace FacturaScripts\Plugins\Randomizer\Lib\Random; -use FacturaScripts\Core\Base\Calculator; +use FacturaScripts\Core\Lib\Calculator; +use FacturaScripts\Core\Tools; + use FacturaScripts\Dinamic\Model\AlbaranProveedor; use FacturaScripts\Test\Traits\LogErrorsTrait; use Faker; diff --git a/Lib/Random/Atributos.php b/Lib/Random/Atributos.php index 61c612c..4331664 100644 --- a/Lib/Random/Atributos.php +++ b/Lib/Random/Atributos.php @@ -66,7 +66,7 @@ private static function createValues(&$faker, $parent): void for ($index = 1; $index <= $max; $index++) { $value = new AtributoValor(); $value->codatributo = $parent; - $value->descripcion = $faker->name; + $value->descripcion = $faker->name(); $value->valor = implode(' ', $faker->words()); if (false === $value->save()) { break; diff --git a/Lib/Random/NewBusinessDocument.php b/Lib/Random/NewBusinessDocument.php index cacea35..92c5024 100755 --- a/Lib/Random/NewBusinessDocument.php +++ b/Lib/Random/NewBusinessDocument.php @@ -21,6 +21,8 @@ use FacturaScripts\Core\Model\Base\BusinessDocument; use FacturaScripts\Core\Model\Base\BusinessDocumentLine; +use FacturaScripts\Core\Tools; + use FacturaScripts\Dinamic\Model\AgenciaTransporte; use Faker; use Faker\Generator; diff --git a/Lib/Random/PedidosClientes.php b/Lib/Random/PedidosClientes.php index 1149851..830414a 100644 --- a/Lib/Random/PedidosClientes.php +++ b/Lib/Random/PedidosClientes.php @@ -19,7 +19,9 @@ namespace FacturaScripts\Plugins\Randomizer\Lib\Random; -use FacturaScripts\Core\Base\Calculator; +use FacturaScripts\Core\Lib\Calculator; +use FacturaScripts\Core\Tools; + use FacturaScripts\Dinamic\Model\PedidoCliente; use Faker; diff --git a/Lib/Random/PedidosProveedores.php b/Lib/Random/PedidosProveedores.php index 188e29e..3dde064 100644 --- a/Lib/Random/PedidosProveedores.php +++ b/Lib/Random/PedidosProveedores.php @@ -19,7 +19,9 @@ namespace FacturaScripts\Plugins\Randomizer\Lib\Random; -use FacturaScripts\Core\Base\Calculator; +use FacturaScripts\Core\Lib\Calculator; +use FacturaScripts\Core\Tools; + use FacturaScripts\Dinamic\Model\PedidoProveedor; use Faker; diff --git a/Lib/Random/PresupuestosClientes.php b/Lib/Random/PresupuestosClientes.php index 72842a4..b63f08b 100644 --- a/Lib/Random/PresupuestosClientes.php +++ b/Lib/Random/PresupuestosClientes.php @@ -19,7 +19,9 @@ namespace FacturaScripts\Plugins\Randomizer\Lib\Random; -use FacturaScripts\Core\Base\Calculator; +use FacturaScripts\Core\Lib\Calculator; +use FacturaScripts\Core\Tools; + use FacturaScripts\Dinamic\Model\PresupuestoCliente; use Faker; diff --git a/Lib/Random/PresupuestosProveedores.php b/Lib/Random/PresupuestosProveedores.php index d242bd0..c83857c 100644 --- a/Lib/Random/PresupuestosProveedores.php +++ b/Lib/Random/PresupuestosProveedores.php @@ -19,7 +19,9 @@ namespace FacturaScripts\Plugins\Randomizer\Lib\Random; -use FacturaScripts\Core\Base\Calculator; +use FacturaScripts\Core\Lib\Calculator; +use FacturaScripts\Core\Tools; + use FacturaScripts\Dinamic\Model\PresupuestoProveedor; use Faker; diff --git a/Lib/Random/Productos.php b/Lib/Random/Productos.php index 8461690..620c581 100644 --- a/Lib/Random/Productos.php +++ b/Lib/Random/Productos.php @@ -21,6 +21,8 @@ use FacturaScripts\Core\Base\DataBase\DataBaseWhere; use FacturaScripts\Core\Model\ProductoImagen; +use FacturaScripts\Core\Tools; + use FacturaScripts\Dinamic\Model\AttachedFile; use FacturaScripts\Dinamic\Model\Producto; use FacturaScripts\Dinamic\Model\Variante; diff --git a/Translation/en_EN.json b/Translation/en_EN.json index 54ed360..c3f9769 100644 --- a/Translation/en_EN.json +++ b/Translation/en_EN.json @@ -1,3 +1,42 @@ { - "generate-test-data-p": "This wizard allows you to generate invented data for your tests. But this data is no different from the rest, so you will not be able to delete it without deleting everything." + "generate-test-data-p": "This wizard allows you to generate invented data for your tests. But this data is no different from the rest, so you will not be able to delete it without deleting everything.", + "generate-test-data": "Generate test data", + "generated-companies": "Generated companies", + "companies": "Companies", + "generated-warehouses": "Generated warehouses", + "warehouses": "Warehouses", + "generated-carriers": "Generated carriers", + "carriers": "Carriers", + "generated-manufacturers": "Generated manufacturers", + "manufacturers": "Manufacturers", + "generated-families": "Generated families", + "families": "Families", + "generated-attributes": "Generated attributes", + "attributes": "Attributes", + "generated-products": "Generated products", + "products": "Products", + "generated-agents": "Generated agents", + "agents": "Agents", + "generated-contacts": "Generated contacts", + "contacts": "Contacts", + "generated-users": "Generated users", + "users": "Users", + "generated-supplier": "Generated supplier", + "suppliers": "Suppliers", + "generated-supplier-estimations": "Generated supplier estimations", + "estimations": "Estimations", + "generated-supplier-orders": "Generated supplier orders", + "orders": "Orders", + "generated-supplier-delivery-notes": "Generated supplier delivery notes", + "delivery-notes": "Delivery notes", + "generated-customer-groups": "Generated customer groups", + "customer-groups": "Customer groups", + "generated-customers": "Generated customers", + "customers": "Customers", + "generated-commissions": "Generated commissions", + "commissions": "Commissions", + "generated-customer-estimations": "Generated customer estimations", + "generated-customer-orders": "Generated customer orders", + "generated-customer-delivery-notes": "Generated customer delivery notes", + "cancel": "Cancel" } \ No newline at end of file diff --git a/Translation/es_ES.json b/Translation/es_ES.json index b53de4d..d257370 100644 --- a/Translation/es_ES.json +++ b/Translation/es_ES.json @@ -1,3 +1,42 @@ { - "generate-test-data-p": "Este asistente permite generar datos inventados para tus pruebas. Pero estos datos no se diferencian del resto, por lo que no podrás eliminarlos sin eliminar todo." + "generate-test-data-p": "Este asistente permite generar datos inventados para tus pruebas. Pero estos datos no se diferencian del resto, por lo que no podrás eliminarlos sin eliminar todo.", + "generate-test-data": "Generar datos de prueba", + "generated-companies": "Empresas generadas", + "companies": "Empresas", + "generated-warehouses": "Almacenes generados", + "warehouses": "Almacenes", + "generated-carriers": "Transportistas generados", + "carriers": "Transportistas", + "generated-manufacturers": "Fabricantes generados", + "manufacturers": "Fabricantes", + "generated-families": "Familias generadas", + "families": "Familias", + "generated-attributes": "Atributos generados", + "attributes": "Atributos", + "generated-products": "Productos generados", + "products": "Productos", + "generated-agents": "Agentes generados", + "agents": "Agentes", + "generated-contacts": "Contactos generados", + "contacts": "Contactos", + "generated-users": "Usuarios generados", + "users": "Usuarios", + "generated-supplier": "Proveedor generado", + "suppliers": "Proveedores", + "generated-supplier-estimations": "Estimaciones de proveedor generadas", + "estimations": "Estimaciones", + "generated-supplier-orders": "Pedidos de proveedor generados", + "orders": "Pedidos", + "generated-supplier-delivery-notes": "Albaranes de proveedor generados", + "delivery-notes": "Albaranes", + "generated-customer-groups": "Grupos de clientes generados", + "customer-groups": "Grupos de clientes", + "generated-customers": "Clientes generados", + "customers": "Clientes", + "generated-commissions": "Comisiones generadas", + "commissions": "Comisiones", + "generated-customer-estimations": "Estimaciones de cliente generadas", + "generated-customer-orders": "Pedidos de cliente generados", + "generated-customer-delivery-notes": "Albaranes de cliente generados", + "cancel": "Cancelar" } \ No newline at end of file diff --git a/View/Randomizer.html.twig b/View/Randomizer.html.twig index f01e531..08909c9 100644 --- a/View/Randomizer.html.twig +++ b/View/Randomizer.html.twig @@ -14,7 +14,7 @@ {{ trans('cancel') }} {% else %} - + {% endif %} @@ -24,7 +24,7 @@

{{ trans(title) }}


{% endif %} -
+
{% for item in group %} {{ _self.genButton(fsc, item.action, item.icon, item.label) }} {% endfor %} @@ -42,13 +42,13 @@ {% set cssColor = gen == fsc.option ? 'btn-success' : 'btn-outline-success' %} {% if gen == fsc.option %} - + {% else %} - + {% endif %} {{ trans(label) }} {% if fsc.totalCounter[gen] > 0 %} - {{ fsc.totalCounter[gen] }} + {{ fsc.totalCounter[gen] }} {% endif %}