diff --git a/db/changes/10330-jun2021/01-ticket_componentMakeUpdate.sql b/db/changes/10330-jun2021/01-ticket_componentMakeUpdate.sql
index ac3e85f084..058d6eb99e 100644
--- a/db/changes/10330-jun2021/01-ticket_componentMakeUpdate.sql
+++ b/db/changes/10330-jun2021/01-ticket_componentMakeUpdate.sql
@@ -31,16 +31,9 @@ BEGIN
*/
DECLARE vPrice DECIMAL(10,2);
DECLARE vBonus DECIMAL(10,2);
- DECLARE EXIT HANDLER FOR SQLEXCEPTION
- BEGIN
- ROLLBACK;
- RESIGNAL;
- END;
CALL ticket_componentPreview (vTicketFk, vLanded, vAddressFk, vZoneFk, vWarehouseFk);
- START TRANSACTION;
-
IF (SELECT addressFk FROM ticket WHERE id = vTicketFk) <> vAddressFk THEN
UPDATE ticket t
@@ -95,7 +88,6 @@ BEGIN
DROP TEMPORARY TABLE tmp.sale;
DROP TEMPORARY TABLE IF EXISTS tmp.ticketComponent;
END IF;
- COMMIT;
DROP TEMPORARY TABLE tmp.zoneGetShipped, tmp.ticketComponentPreview;
END$$
diff --git a/modules/invoiceIn/front/create/index.html b/modules/invoiceIn/front/create/index.html
new file mode 100644
index 0000000000..4ec7248545
--- /dev/null
+++ b/modules/invoiceIn/front/create/index.html
@@ -0,0 +1,62 @@
+
+
+
\ No newline at end of file
diff --git a/modules/invoiceIn/front/create/index.js b/modules/invoiceIn/front/create/index.js
new file mode 100644
index 0000000000..186f5d478e
--- /dev/null
+++ b/modules/invoiceIn/front/create/index.js
@@ -0,0 +1,29 @@
+import ngModule from '../module';
+import Section from 'salix/components/section';
+
+class Controller extends Section {
+ $onInit() {
+ this.invoiceIn = {};
+ if (this.$params && this.$params.supplierFk)
+ this.invoiceIn.supplierFk = this.$params.supplierFk;
+ }
+
+ get companyFk() {
+ return this.invoiceIn.companyFk || this.vnConfig.companyFk;
+ }
+
+ set companyFk(value) {
+ this.invoiceIn.companyFk = value;
+ }
+
+ onSubmit() {
+ this.$.watcher.submit().then(
+ res => this.$state.go('invoiceIn.card.basicData', {id: res.data.id})
+ );
+ }
+}
+
+ngModule.vnComponent('vnInvoiceInCreate', {
+ template: require('./index.html'),
+ controller: Controller
+});
diff --git a/modules/invoiceIn/front/create/index.spec.js b/modules/invoiceIn/front/create/index.spec.js
new file mode 100644
index 0000000000..93109346c2
--- /dev/null
+++ b/modules/invoiceIn/front/create/index.spec.js
@@ -0,0 +1,52 @@
+import './index.js';
+import watcher from 'core/mocks/watcher';
+
+describe('InvoiceIn', () => {
+ describe('Component vnInvoiceInCreate', () => {
+ let controller;
+ let $element;
+
+ beforeEach(ngModule('invoiceIn'));
+
+ beforeEach(inject(($componentController, $rootScope) => {
+ const $scope = $rootScope.$new();
+ $scope.watcher = watcher;
+ $element = angular.element('');
+ controller = $componentController('vnInvoiceInCreate', {$element, $scope});
+ controller.$params = {};
+ }));
+
+ afterEach(() => {
+ $element.remove();
+ });
+
+ describe('onInit()', () => {
+ it(`should defined the controller's invoiceIn property`, () => {
+ expect(controller.invoiceIn).toBeUndefined();
+
+ controller.$onInit();
+
+ expect(controller.invoiceIn).toEqual({});
+ });
+
+ it(`should define invoiceIn and it's supplierFk when received via params`, () => {
+ controller.$params.supplierFk = 'supplierId';
+
+ controller.$onInit();
+
+ expect(controller.invoiceIn.supplierFk).toEqual('supplierId');
+ });
+ });
+
+ describe('onSubmit()', () => {
+ it(`should redirect to basic data by calling the $state.go function`, () => {
+ jest.spyOn(controller.$state, 'go');
+
+ controller.onSubmit();
+
+ expect(controller.$state.go).toHaveBeenCalledWith('invoiceIn.card.basicData', {id: 1234});
+ });
+ });
+ });
+});
+
diff --git a/modules/invoiceIn/front/create/locale/es.yml b/modules/invoiceIn/front/create/locale/es.yml
new file mode 100644
index 0000000000..35bfe3ca49
--- /dev/null
+++ b/modules/invoiceIn/front/create/locale/es.yml
@@ -0,0 +1 @@
+a:a
\ No newline at end of file
diff --git a/modules/invoiceIn/front/index.js b/modules/invoiceIn/front/index.js
index 2102b338f2..f82228f0ad 100644
--- a/modules/invoiceIn/front/index.js
+++ b/modules/invoiceIn/front/index.js
@@ -8,4 +8,5 @@ import './descriptor';
import './descriptor-popover';
import './summary';
import './basic-data';
+import './create';
import './log';
diff --git a/modules/invoiceIn/front/locale/es.yml b/modules/invoiceIn/front/locale/es.yml
index 2d8dc02dae..ac432aba8b 100644
--- a/modules/invoiceIn/front/locale/es.yml
+++ b/modules/invoiceIn/front/locale/es.yml
@@ -1,5 +1,5 @@
InvoiceIn: Facturas recibidas
Search invoices in by reference: Buscar facturas recibidas por referencia
Entries list: Listado de entradas
-Invoice list: Listado de entradas
+Invoice list: Listado de facturas recibidas
InvoiceIn deleted: Factura eliminada
\ No newline at end of file
diff --git a/modules/invoiceIn/front/routes.json b/modules/invoiceIn/front/routes.json
index 5f842f760c..d09d8fda09 100644
--- a/modules/invoiceIn/front/routes.json
+++ b/modules/invoiceIn/front/routes.json
@@ -2,11 +2,17 @@
"module": "invoiceIn",
"name": "Invoices in",
"icon": "icon-invoiceIn",
- "validations" : true,
- "dependencies": ["worker", "supplier"],
+ "validations": true,
+ "dependencies": [
+ "worker",
+ "supplier"
+ ],
"menus": {
"main": [
- {"state": "invoiceIn.index", "icon": "icon-invoiceIn"}
+ {
+ "state": "invoiceIn.index",
+ "icon": "icon-invoiceIn"
+ }
],
"card": [
{
@@ -32,7 +38,9 @@
"state": "invoiceIn.index",
"component": "vn-invoice-in-index",
"description": "InvoiceIn",
- "acl": ["administrative"]
+ "acl": [
+ "administrative"
+ ]
},
{
"url": "/:id",
@@ -48,7 +56,9 @@
"params": {
"invoice-in": "$ctrl.invoiceIn"
},
- "acl": ["administrative"]
+ "acl": [
+ "administrative"
+ ]
},
{
"url": "/basic-data",
@@ -58,14 +68,27 @@
"params": {
"invoice-in": "$ctrl.invoiceIn"
},
- "acl": ["administrative"]
+ "acl": [
+ "administrative"
+ ]
+ },
+ {
+ "url": "/create?supplierFk",
+ "state": "invoiceIn.create",
+ "component": "vn-invoice-in-create",
+ "description": "New InvoiceIn",
+ "acl": [
+ "administrative"
+ ]
},
{
"url": "/log",
"state": "invoiceIn.card.log",
"component": "vn-invoice-in-log",
"description": "Log",
- "acl": ["administrative"]
+ "acl": [
+ "administrative"
+ ]
}
]
}
\ No newline at end of file
diff --git a/modules/supplier/front/descriptor/index.html b/modules/supplier/front/descriptor/index.html
index 9603f77584..9781c95b87 100644
--- a/modules/supplier/front/descriptor/index.html
+++ b/modules/supplier/front/descriptor/index.html
@@ -56,6 +56,11 @@
+
+
diff --git a/modules/supplier/front/descriptor/locale/es.yml b/modules/supplier/front/descriptor/locale/es.yml
index ad47a54773..d889a9eee5 100644
--- a/modules/supplier/front/descriptor/locale/es.yml
+++ b/modules/supplier/front/descriptor/locale/es.yml
@@ -3,4 +3,5 @@ All entries with current supplier: Todas las entradas con el proveedor actual
Go to client: Ir al cliente
Verified supplier: Proveedor verificado
Unverified supplier: Proveedor no verificado
-Inactive supplier: Proveedor inactivo
\ No newline at end of file
+Inactive supplier: Proveedor inactivo
+Create invoiceIn: Crear factura recibida
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 6ca78ba5d7..bc8cba293d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -20760,4 +20760,4 @@
}
}
}
-}
+}
\ No newline at end of file