bdpformulas 1.0.30 → 1.0.31
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.
|
@@ -27,10 +27,10 @@ const commmon = __importStar(require("./common/balance.calc"));
|
|
|
27
27
|
class Balance {
|
|
28
28
|
execute(data) {
|
|
29
29
|
let result = {};
|
|
30
|
-
if (data.strategy != null)
|
|
31
|
-
data = data.strategy.execute(data);
|
|
32
30
|
const balanceClone = trasponer(commmon.clone(data.balance));
|
|
33
31
|
const eerrClone = trasponer(commmon.clone(data.eerr));
|
|
32
|
+
if (data.strategy != null)
|
|
33
|
+
data = data.strategy.execute(data);
|
|
34
34
|
result.balance = calcularBalance(data.balance);
|
|
35
35
|
result.eerr = calcularEERR(data.eerr);
|
|
36
36
|
result.DataOriginal = {
|
|
@@ -156,7 +156,7 @@ const trasponer = (data) => {
|
|
|
156
156
|
let result = data.reduce((acc, item) => {
|
|
157
157
|
const uuid = item.UUID != null ? item.UUID : '0';
|
|
158
158
|
const key = `${item.RubroId}_${uuid}`;
|
|
159
|
-
if (!acc.has(key))
|
|
159
|
+
if (!acc.has(key)) {
|
|
160
160
|
acc.set(key, {
|
|
161
161
|
RubroId: item.RubroId,
|
|
162
162
|
RubroPadreId: item.RubroPadreId,
|
|
@@ -165,15 +165,26 @@ const trasponer = (data) => {
|
|
|
165
165
|
Clasificador: item.Clasificador,
|
|
166
166
|
Borrable: esBorrable(item.RubroId),
|
|
167
167
|
Editable: item.Editable,
|
|
168
|
+
Secuencia: item.Secuencia,
|
|
169
|
+
UUID: item.UUID,
|
|
170
|
+
Rango: item.Rango,
|
|
168
171
|
});
|
|
169
|
-
|
|
172
|
+
for (let i = 1; i <= item.Rango; i++) {
|
|
173
|
+
acc.get(key)[`MontoEmpresa_${i}`] = 0;
|
|
174
|
+
acc.get(key)[`MontoFamiliar_${i}`] = 0;
|
|
175
|
+
acc.get(key)[`MontoTotal_${i}`] = 0;
|
|
176
|
+
acc.get(key)[`Fecha_${i}`] = null;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
170
179
|
acc.get(key)[`MontoEmpresa_${item.Correlativo}`] = item.MontoEmpresa;
|
|
171
180
|
acc.get(key)[`MontoFamiliar_${item.Correlativo}`] = item.MontoFamiliar;
|
|
172
181
|
acc.get(key)[`MontoTotal_${item.Correlativo}`] = item.MontoTotal;
|
|
173
182
|
acc.get(key)[`Fecha_${item.Correlativo}`] = item.Fecha;
|
|
174
183
|
return acc;
|
|
175
184
|
}, new Map());
|
|
176
|
-
|
|
185
|
+
result = Array.from(result.values());
|
|
186
|
+
result = result.sort((a, b) => a.RubroId.localeCompare(b.RubroId));
|
|
187
|
+
return result;
|
|
177
188
|
};
|
|
178
189
|
const esBorrable = (rubroId) => {
|
|
179
190
|
const rubrosBorrables = ['ACT_CN_11004', 'ACT_CN_12005',
|