Compare commits

...

6 Commits

Author SHA1 Message Date
Javier Segarra 94503c803e Merge branch 'test' into 2687_travel_cloneWithEntries
gitea/salix/pipeline/pr-test This commit looks good Details
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-02-12 08:10:45 +01:00
Javier Segarra a97b3afe98 refs #2687 db: use myt to implement
gitea/salix/pipeline/pr-dev This commit looks good Details
gitea/salix/pipeline/pr-test This commit looks good Details
2024-02-11 20:41:00 +01:00
Javier Segarra edcd9baca7 Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 2687_travel_cloneWithEntries 2024-02-10 23:51:52 +01:00
Javier Segarra f368395912 Merge branch 'dev' into 2687_travel_cloneWithEntries
gitea/salix/pipeline/pr-dev This commit looks good Details
2024-02-09 08:36:12 +00:00
Carlos Satorres 5d876deff5 Merge pull request 'refs #6281 vehicles remove where' (!2004) from 6281-routesChanges into test
gitea/salix/pipeline/head This commit looks good Details
gitea/salix/pipeline/pr-test This commit looks good Details
Reviewed-on: #2004
Reviewed-by: Alex Moreno <alexm@verdnatura.es>
2024-02-09 08:27:57 +00:00
Carlos Satorres 7e18bd0a12 refs #6281 vehicles remove where
gitea/salix/pipeline/pr-test This commit looks good Details
2024-02-07 13:03:24 +01:00
3 changed files with 14 additions and 8 deletions

View File

@ -27,7 +27,7 @@ BEGIN
DECLARE vEvaNotes VARCHAR(255); DECLARE vEvaNotes VARCHAR(255);
DECLARE vDone BOOL; DECLARE vDone BOOL;
DECLARE vAuxEntryFk INT; DECLARE vAuxEntryFk INT;
DECLARE vTx BOOLEAN DEFAULT !@@in_transaction; DECLARE vTx BOOLEAN DEFAULT @@in_transaction;
DECLARE vRsEntry CURSOR FOR DECLARE vRsEntry CURSOR FOR
SELECT e.id SELECT e.id
FROM entry e FROM entry e
@ -41,9 +41,10 @@ BEGIN
CALL util.tx_rollback(vTx); CALL util.tx_rollback(vTx);
RESIGNAL; RESIGNAL;
END; END;
IF !vTx THEN
CALL util.tx_start(vTx); SET vTx = TRUE;
CALL util.tx_start(vTx);
END IF;
INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, cargoSupplierFk, kg,clonedFrom) INSERT INTO travel (shipped, landed, warehouseInFk, warehouseOutFk, agencyModeFk, `ref`, isDelivered, isReceived, m3, cargoSupplierFk, kg,clonedFrom)
SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3,cargoSupplierFk, kg,vTravelFk SELECT vDateStart, vDateEnd, vWarehouseInFk, vWarehouseOutFk, vAgencyModeFk, vRef, isDelivered, isReceived, m3,cargoSupplierFk, kg,vTravelFk
FROM travel FROM travel

View File

@ -22,7 +22,6 @@
label="Vehicle" label="Vehicle"
ng-model="$ctrl.route.vehicleFk" ng-model="$ctrl.route.vehicleFk"
url="Vehicles" url="Vehicles"
where="{warehouseFk: $ctrl.vnConfig.warehouseFk}"
show-field="numberPlate"> show-field="numberPlate">
</vn-autocomplete> </vn-autocomplete>
<vn-autocomplete <vn-autocomplete

View File

@ -19,7 +19,7 @@ describe('Travel cloneWithEntries()', () => {
travelFk: newTravelId travelFk: newTravelId
} }
}, options); }, options);
const newTravel = await models.Travel.findById(travelId); const newTravel = await models.Travel.findById(travelId, options);
expect(newTravelId).not.toEqual(travelId); expect(newTravelId).not.toEqual(travelId);
expect(newTravel.ref).toEqual('fifth travel'); expect(newTravel.ref).toEqual('fifth travel');
@ -27,9 +27,15 @@ describe('Travel cloneWithEntries()', () => {
expect(newTravel.warehouseOutFk).toEqual(warehouseThree); expect(newTravel.warehouseOutFk).toEqual(warehouseThree);
expect(newTravel.agencyModeFk).toEqual(agencyModeOne); expect(newTravel.agencyModeFk).toEqual(agencyModeOne);
expect(travelEntries.length).toBeGreaterThan(0); expect(travelEntries.length).toBeGreaterThan(0);
await models.Entry.destroyAll({
travelFk: newTravelId
}, options);
await models.Travel.destroyById(newTravelId, options);
await tx.rollback(); await tx.rollback();
const travelRemoved = await models.Travel.findById(newTravelId, options); const travelRemoved = await models.Travel.findById(newTravelId);
const entries = await models.Entry.find();
expect(entries.length).toBeGreaterThan(0);
expect(travelRemoved).toBeNull(); expect(travelRemoved).toBeNull();
} catch (e) { } catch (e) {