sigo-package 1.2.21 → 1.2.22
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 +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +10 -5
- package/dist/index.mjs +10 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -306,7 +306,12 @@ declare function obtenerTipoYCodigoMO(codigoOriginal: string): {
|
|
|
306
306
|
CodigoMO: string;
|
|
307
307
|
};
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
interface IMateriales {
|
|
310
|
+
id: string;
|
|
311
|
+
cantidad: number;
|
|
312
|
+
stockPersonal: StockPersonalENTITY;
|
|
313
|
+
}
|
|
314
|
+
declare function buildMaterialsFromPersonalStock(Materiales: IMOAndMaterialsRules[], dataStockPersonal: StockPersonalENTITY[], id: string, CantidadPadre?: number): IMateriales[];
|
|
310
315
|
|
|
311
316
|
declare function buildDataMaterialsRule(Materiales: Map<string, IMOAndMaterialsRules>, dataStockPersonal: Pick<StockPersonalENTITY, 'ID_StockPersonal' | 'Item' | 'Lote'>[]): {
|
|
312
317
|
id: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -306,7 +306,12 @@ declare function obtenerTipoYCodigoMO(codigoOriginal: string): {
|
|
|
306
306
|
CodigoMO: string;
|
|
307
307
|
};
|
|
308
308
|
|
|
309
|
-
|
|
309
|
+
interface IMateriales {
|
|
310
|
+
id: string;
|
|
311
|
+
cantidad: number;
|
|
312
|
+
stockPersonal: StockPersonalENTITY;
|
|
313
|
+
}
|
|
314
|
+
declare function buildMaterialsFromPersonalStock(Materiales: IMOAndMaterialsRules[], dataStockPersonal: StockPersonalENTITY[], id: string, CantidadPadre?: number): IMateriales[];
|
|
310
315
|
|
|
311
316
|
declare function buildDataMaterialsRule(Materiales: Map<string, IMOAndMaterialsRules>, dataStockPersonal: Pick<StockPersonalENTITY, 'ID_StockPersonal' | 'Item' | 'Lote'>[]): {
|
|
312
317
|
id: number;
|
package/dist/index.js
CHANGED
|
@@ -5900,7 +5900,7 @@ function updatePriceMOAL04(valorizaciones, priceContractorMO) {
|
|
|
5900
5900
|
__name(updatePriceMOAL04, "updatePriceMOAL04");
|
|
5901
5901
|
|
|
5902
5902
|
// src/Programados/Alemania/buildMaterialsFromPersonalStock.ts
|
|
5903
|
-
function buildMaterialsFromPersonalStock(Materiales, dataStockPersonal) {
|
|
5903
|
+
function buildMaterialsFromPersonalStock(Materiales, dataStockPersonal, id, CantidadPadre = 0) {
|
|
5904
5904
|
const materiales = [];
|
|
5905
5905
|
for (const material of Materiales) {
|
|
5906
5906
|
const { Codigo: codMaterial } = material;
|
|
@@ -5908,14 +5908,19 @@ function buildMaterialsFromPersonalStock(Materiales, dataStockPersonal) {
|
|
|
5908
5908
|
if (stocksPersonal.length === 0) {
|
|
5909
5909
|
throw new Error(`No se encontr\xF3 el material ${codMaterial} en el stock personal para este trabajo.`);
|
|
5910
5910
|
}
|
|
5911
|
-
for (const [i,
|
|
5912
|
-
const disponible =
|
|
5911
|
+
for (const [i, stockPersonal] of stocksPersonal.entries()) {
|
|
5912
|
+
const disponible = stockPersonal.Despacho - stockPersonal.Devolucion - stockPersonal.Liquidacion + stockPersonal.DespachoTR - stockPersonal.DevolucionTR;
|
|
5913
5913
|
if (disponible < material.Cantidad && i === stocksPersonal.length - 1) {
|
|
5914
|
-
throw new Error(`No
|
|
5914
|
+
throw new Error(`No tiene stock personal suficiente para el material '${codMaterial}' para este trabajo.`);
|
|
5915
5915
|
} else if (disponible < material.Cantidad) {
|
|
5916
5916
|
continue;
|
|
5917
5917
|
} else {
|
|
5918
|
-
|
|
5918
|
+
const _cantidad = material.CantidadPadre ? CantidadPadre : material.CantidadFija ? material.Cantidad : 0;
|
|
5919
|
+
materiales.push({
|
|
5920
|
+
stockPersonal,
|
|
5921
|
+
id,
|
|
5922
|
+
cantidad: _cantidad * material.Factor
|
|
5923
|
+
});
|
|
5919
5924
|
break;
|
|
5920
5925
|
}
|
|
5921
5926
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -5777,7 +5777,7 @@ function updatePriceMOAL04(valorizaciones, priceContractorMO) {
|
|
|
5777
5777
|
__name(updatePriceMOAL04, "updatePriceMOAL04");
|
|
5778
5778
|
|
|
5779
5779
|
// src/Programados/Alemania/buildMaterialsFromPersonalStock.ts
|
|
5780
|
-
function buildMaterialsFromPersonalStock(Materiales, dataStockPersonal) {
|
|
5780
|
+
function buildMaterialsFromPersonalStock(Materiales, dataStockPersonal, id, CantidadPadre = 0) {
|
|
5781
5781
|
const materiales = [];
|
|
5782
5782
|
for (const material of Materiales) {
|
|
5783
5783
|
const { Codigo: codMaterial } = material;
|
|
@@ -5785,14 +5785,19 @@ function buildMaterialsFromPersonalStock(Materiales, dataStockPersonal) {
|
|
|
5785
5785
|
if (stocksPersonal.length === 0) {
|
|
5786
5786
|
throw new Error(`No se encontr\xF3 el material ${codMaterial} en el stock personal para este trabajo.`);
|
|
5787
5787
|
}
|
|
5788
|
-
for (const [i,
|
|
5789
|
-
const disponible =
|
|
5788
|
+
for (const [i, stockPersonal] of stocksPersonal.entries()) {
|
|
5789
|
+
const disponible = stockPersonal.Despacho - stockPersonal.Devolucion - stockPersonal.Liquidacion + stockPersonal.DespachoTR - stockPersonal.DevolucionTR;
|
|
5790
5790
|
if (disponible < material.Cantidad && i === stocksPersonal.length - 1) {
|
|
5791
|
-
throw new Error(`No
|
|
5791
|
+
throw new Error(`No tiene stock personal suficiente para el material '${codMaterial}' para este trabajo.`);
|
|
5792
5792
|
} else if (disponible < material.Cantidad) {
|
|
5793
5793
|
continue;
|
|
5794
5794
|
} else {
|
|
5795
|
-
|
|
5795
|
+
const _cantidad = material.CantidadPadre ? CantidadPadre : material.CantidadFija ? material.Cantidad : 0;
|
|
5796
|
+
materiales.push({
|
|
5797
|
+
stockPersonal,
|
|
5798
|
+
id,
|
|
5799
|
+
cantidad: _cantidad * material.Factor
|
|
5800
|
+
});
|
|
5796
5801
|
break;
|
|
5797
5802
|
}
|
|
5798
5803
|
}
|