sigo-package 1.2.37 → 1.2.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +18 -8
- package/dist/index.mjs +18 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -335,7 +335,7 @@ declare function buildDataMaterialsRule(Materiales: Map<string, IMOAndMaterialsR
|
|
|
335
335
|
|
|
336
336
|
declare function consumirStockPersonal(codDelegacion: string, codigoMaterial: string): boolean;
|
|
337
337
|
|
|
338
|
-
declare function checkMaterialAvailability(materials: IMateriales[], dataMaterialesUtilizados: IMateriales[], dataStockPersonal: StockPersonalENTITY[], dataStockAlmacen: StockAlmacenENTITY[], dataConsumoMaterial: ConsumoMaterialAlemaniaENTITY[]): void;
|
|
338
|
+
declare function checkMaterialAvailability(materials: IMateriales[], dataMaterialesUtilizados: IMateriales[], dataStockPersonal: StockPersonalENTITY[], dataStockAlmacen: StockAlmacenENTITY[], dataConsumoMaterial: ConsumoMaterialAlemaniaENTITY[], Controller: any): void;
|
|
339
339
|
|
|
340
340
|
declare const CalcularResumenLiquidaciones: Funcion$1;
|
|
341
341
|
interface Funcion$1 {
|
package/dist/index.d.ts
CHANGED
|
@@ -335,7 +335,7 @@ declare function buildDataMaterialsRule(Materiales: Map<string, IMOAndMaterialsR
|
|
|
335
335
|
|
|
336
336
|
declare function consumirStockPersonal(codDelegacion: string, codigoMaterial: string): boolean;
|
|
337
337
|
|
|
338
|
-
declare function checkMaterialAvailability(materials: IMateriales[], dataMaterialesUtilizados: IMateriales[], dataStockPersonal: StockPersonalENTITY[], dataStockAlmacen: StockAlmacenENTITY[], dataConsumoMaterial: ConsumoMaterialAlemaniaENTITY[]): void;
|
|
338
|
+
declare function checkMaterialAvailability(materials: IMateriales[], dataMaterialesUtilizados: IMateriales[], dataStockPersonal: StockPersonalENTITY[], dataStockAlmacen: StockAlmacenENTITY[], dataConsumoMaterial: ConsumoMaterialAlemaniaENTITY[], Controller: any): void;
|
|
339
339
|
|
|
340
340
|
declare const CalcularResumenLiquidaciones: Funcion$1;
|
|
341
341
|
interface Funcion$1 {
|
package/dist/index.js
CHANGED
|
@@ -4394,7 +4394,9 @@ function buildPreliquidacionRules1() {
|
|
|
4394
4394
|
const map = /* @__PURE__ */ new Map();
|
|
4395
4395
|
codMOTroncalReglaLiquidacion1.forEach((el) => {
|
|
4396
4396
|
const key = el;
|
|
4397
|
-
const value =
|
|
4397
|
+
const value = [
|
|
4398
|
+
"073006000"
|
|
4399
|
+
].includes(el) ? {
|
|
4398
4400
|
Codigo: el,
|
|
4399
4401
|
ManoObra: [],
|
|
4400
4402
|
Materiales: buildRulesMaterial(),
|
|
@@ -4402,6 +4404,14 @@ function buildPreliquidacionRules1() {
|
|
|
4402
4404
|
CantidadPadre: false,
|
|
4403
4405
|
Cantidad: 0,
|
|
4404
4406
|
Factor: 1
|
|
4407
|
+
} : {
|
|
4408
|
+
Codigo: el,
|
|
4409
|
+
ManoObra: [],
|
|
4410
|
+
Materiales: buildRulesMaterial(),
|
|
4411
|
+
CantidadFija: true,
|
|
4412
|
+
CantidadPadre: false,
|
|
4413
|
+
Cantidad: 1,
|
|
4414
|
+
Factor: 1
|
|
4405
4415
|
};
|
|
4406
4416
|
map.set(key, value);
|
|
4407
4417
|
});
|
|
@@ -6002,41 +6012,41 @@ function buildDataMaterialsRule(Materiales, dataStockPersonal, dataStockAlmacen,
|
|
|
6002
6012
|
__name(buildDataMaterialsRule, "buildDataMaterialsRule");
|
|
6003
6013
|
|
|
6004
6014
|
// src/Programados/Alemania/checkMaterialAvailability.ts
|
|
6005
|
-
function checkMaterialAvailability(materials, dataMaterialesUtilizados, dataStockPersonal, dataStockAlmacen, dataConsumoMaterial) {
|
|
6015
|
+
function checkMaterialAvailability(materials, dataMaterialesUtilizados, dataStockPersonal, dataStockAlmacen, dataConsumoMaterial, Controller) {
|
|
6006
6016
|
const dataMUStockPersonal = dataMaterialesUtilizados.filter((e) => e.stock === "Personal");
|
|
6007
6017
|
const dataMUStockAlmacen = dataMaterialesUtilizados.filter((e) => e.stock === "Almacen");
|
|
6008
6018
|
for (const material of materials) {
|
|
6009
6019
|
if (material.stock === "Personal") {
|
|
6010
6020
|
const stockPersonal = dataStockPersonal.find((e) => e.ID_StockPersonal === material.ID);
|
|
6011
6021
|
if (!stockPersonal) {
|
|
6012
|
-
throw new
|
|
6022
|
+
throw new Controller.SigoError(`No se encontr\xF3 el material ID_StockPersonal "${material.ID}" en data stock personal.`);
|
|
6013
6023
|
}
|
|
6014
6024
|
const utilizadoLocal = dataMUStockPersonal.filter((e) => e.ID === material.ID).reduce((acc, el) => acc += el.cantidad, 0);
|
|
6015
6025
|
const { Despacho, Devolucion, Liquidacion, DespachoTR, DevolucionTR } = stockPersonal;
|
|
6016
6026
|
const disponible = Despacho - Devolucion - Liquidacion + DespachoTR - DevolucionTR - utilizadoLocal;
|
|
6017
6027
|
if (disponible < material.cantidad) {
|
|
6018
|
-
throw new
|
|
6028
|
+
throw new Controller.SigoError(`No tiene stock personal suficiente para el material '${material.item.Codigo}${material.lote ? ` (lote: ${material.lote})` : ""}' para este trabajo. (Disponible: ${disponible})`);
|
|
6019
6029
|
}
|
|
6020
6030
|
} else if (material.stock === "Almacen") {
|
|
6021
6031
|
const stockAlmacen = dataStockAlmacen.find((e) => e.ID_StockAlmacen === material.ID);
|
|
6022
6032
|
if (!stockAlmacen) {
|
|
6023
|
-
throw new
|
|
6033
|
+
throw new Controller.SigoError(`No se encontr\xF3 el material ID_StockAlmacen "${material.ID}" en data stock alamc\xE9n.`);
|
|
6024
6034
|
}
|
|
6025
6035
|
const utilizadoLocal = dataMUStockAlmacen.filter((e) => e.ID === material.ID).reduce((acc, el) => acc += el.cantidad, 0);
|
|
6026
6036
|
const utilizadoCM = dataConsumoMaterial.reduce((ac, e) => {
|
|
6027
6037
|
const exist = e.CosumoMaterial.filter((cm) => cm.CodigoLlave === stockAlmacen.CodigoLlave);
|
|
6028
6038
|
if (exist.length > 1) {
|
|
6029
|
-
throw new
|
|
6039
|
+
throw new Controller.SigoError(`No se pudo calcular utilizado consumo material.`);
|
|
6030
6040
|
}
|
|
6031
6041
|
return ac += exist.length ? exist[0].Cantidad : 0;
|
|
6032
6042
|
}, 0);
|
|
6033
6043
|
const { Ingreso, Despacho, Devolucion } = stockAlmacen;
|
|
6034
6044
|
const disponible = Ingreso - Despacho + Devolucion - utilizadoLocal - utilizadoCM;
|
|
6035
6045
|
if (disponible < material.cantidad) {
|
|
6036
|
-
throw new
|
|
6046
|
+
throw new Controller.SigoError(`No tiene stock almac\xE9n suficiente para el material '${material.item.Codigo}${material.lote ? ` (lote: ${material.lote})` : ""}' para este trabajo. (Disponible: ${disponible})`);
|
|
6037
6047
|
}
|
|
6038
6048
|
} else {
|
|
6039
|
-
throw new
|
|
6049
|
+
throw new Controller.SigoError(`No se encontraron casos para el tipo de stock ${material.stock}`);
|
|
6040
6050
|
}
|
|
6041
6051
|
}
|
|
6042
6052
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -4264,7 +4264,9 @@ function buildPreliquidacionRules1() {
|
|
|
4264
4264
|
const map = /* @__PURE__ */ new Map();
|
|
4265
4265
|
codMOTroncalReglaLiquidacion1.forEach((el) => {
|
|
4266
4266
|
const key = el;
|
|
4267
|
-
const value =
|
|
4267
|
+
const value = [
|
|
4268
|
+
"073006000"
|
|
4269
|
+
].includes(el) ? {
|
|
4268
4270
|
Codigo: el,
|
|
4269
4271
|
ManoObra: [],
|
|
4270
4272
|
Materiales: buildRulesMaterial(),
|
|
@@ -4272,6 +4274,14 @@ function buildPreliquidacionRules1() {
|
|
|
4272
4274
|
CantidadPadre: false,
|
|
4273
4275
|
Cantidad: 0,
|
|
4274
4276
|
Factor: 1
|
|
4277
|
+
} : {
|
|
4278
|
+
Codigo: el,
|
|
4279
|
+
ManoObra: [],
|
|
4280
|
+
Materiales: buildRulesMaterial(),
|
|
4281
|
+
CantidadFija: true,
|
|
4282
|
+
CantidadPadre: false,
|
|
4283
|
+
Cantidad: 1,
|
|
4284
|
+
Factor: 1
|
|
4275
4285
|
};
|
|
4276
4286
|
map.set(key, value);
|
|
4277
4287
|
});
|
|
@@ -5872,41 +5882,41 @@ function buildDataMaterialsRule(Materiales, dataStockPersonal, dataStockAlmacen,
|
|
|
5872
5882
|
__name(buildDataMaterialsRule, "buildDataMaterialsRule");
|
|
5873
5883
|
|
|
5874
5884
|
// src/Programados/Alemania/checkMaterialAvailability.ts
|
|
5875
|
-
function checkMaterialAvailability(materials, dataMaterialesUtilizados, dataStockPersonal, dataStockAlmacen, dataConsumoMaterial) {
|
|
5885
|
+
function checkMaterialAvailability(materials, dataMaterialesUtilizados, dataStockPersonal, dataStockAlmacen, dataConsumoMaterial, Controller) {
|
|
5876
5886
|
const dataMUStockPersonal = dataMaterialesUtilizados.filter((e) => e.stock === "Personal");
|
|
5877
5887
|
const dataMUStockAlmacen = dataMaterialesUtilizados.filter((e) => e.stock === "Almacen");
|
|
5878
5888
|
for (const material of materials) {
|
|
5879
5889
|
if (material.stock === "Personal") {
|
|
5880
5890
|
const stockPersonal = dataStockPersonal.find((e) => e.ID_StockPersonal === material.ID);
|
|
5881
5891
|
if (!stockPersonal) {
|
|
5882
|
-
throw new
|
|
5892
|
+
throw new Controller.SigoError(`No se encontr\xF3 el material ID_StockPersonal "${material.ID}" en data stock personal.`);
|
|
5883
5893
|
}
|
|
5884
5894
|
const utilizadoLocal = dataMUStockPersonal.filter((e) => e.ID === material.ID).reduce((acc, el) => acc += el.cantidad, 0);
|
|
5885
5895
|
const { Despacho, Devolucion, Liquidacion, DespachoTR, DevolucionTR } = stockPersonal;
|
|
5886
5896
|
const disponible = Despacho - Devolucion - Liquidacion + DespachoTR - DevolucionTR - utilizadoLocal;
|
|
5887
5897
|
if (disponible < material.cantidad) {
|
|
5888
|
-
throw new
|
|
5898
|
+
throw new Controller.SigoError(`No tiene stock personal suficiente para el material '${material.item.Codigo}${material.lote ? ` (lote: ${material.lote})` : ""}' para este trabajo. (Disponible: ${disponible})`);
|
|
5889
5899
|
}
|
|
5890
5900
|
} else if (material.stock === "Almacen") {
|
|
5891
5901
|
const stockAlmacen = dataStockAlmacen.find((e) => e.ID_StockAlmacen === material.ID);
|
|
5892
5902
|
if (!stockAlmacen) {
|
|
5893
|
-
throw new
|
|
5903
|
+
throw new Controller.SigoError(`No se encontr\xF3 el material ID_StockAlmacen "${material.ID}" en data stock alamc\xE9n.`);
|
|
5894
5904
|
}
|
|
5895
5905
|
const utilizadoLocal = dataMUStockAlmacen.filter((e) => e.ID === material.ID).reduce((acc, el) => acc += el.cantidad, 0);
|
|
5896
5906
|
const utilizadoCM = dataConsumoMaterial.reduce((ac, e) => {
|
|
5897
5907
|
const exist = e.CosumoMaterial.filter((cm) => cm.CodigoLlave === stockAlmacen.CodigoLlave);
|
|
5898
5908
|
if (exist.length > 1) {
|
|
5899
|
-
throw new
|
|
5909
|
+
throw new Controller.SigoError(`No se pudo calcular utilizado consumo material.`);
|
|
5900
5910
|
}
|
|
5901
5911
|
return ac += exist.length ? exist[0].Cantidad : 0;
|
|
5902
5912
|
}, 0);
|
|
5903
5913
|
const { Ingreso, Despacho, Devolucion } = stockAlmacen;
|
|
5904
5914
|
const disponible = Ingreso - Despacho + Devolucion - utilizadoLocal - utilizadoCM;
|
|
5905
5915
|
if (disponible < material.cantidad) {
|
|
5906
|
-
throw new
|
|
5916
|
+
throw new Controller.SigoError(`No tiene stock almac\xE9n suficiente para el material '${material.item.Codigo}${material.lote ? ` (lote: ${material.lote})` : ""}' para este trabajo. (Disponible: ${disponible})`);
|
|
5907
5917
|
}
|
|
5908
5918
|
} else {
|
|
5909
|
-
throw new
|
|
5919
|
+
throw new Controller.SigoError(`No se encontraron casos para el tipo de stock ${material.stock}`);
|
|
5910
5920
|
}
|
|
5911
5921
|
}
|
|
5912
5922
|
}
|