|
|
@@ -703,7 +703,7 @@ function setMonthToLedger(ledgerList, slm) {
|
|
|
for(const s of slm) {
|
|
|
const index = _.findIndex(ledgerList, { 'ledger_id': s.lid });
|
|
|
const canCalc = _.find(scheduleMonth, { 'yearmonth': s.yearmonth, 'stage_gcl_used': 1});
|
|
|
- if (index && index !== -1 && canCalc) {
|
|
|
+ if (index !== -1 && canCalc) {
|
|
|
ledgerList[index][s.yearmonth + '_plan_tp'] = s.plan_tp;
|
|
|
ledgerList[index][s.yearmonth + '_plan_gcl'] = s.plan_gcl;
|
|
|
ledgerList[index][s.yearmonth + '_sj_tp'] = s.sj_tp;
|
|
|
@@ -717,7 +717,7 @@ function setGclMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
|
|
|
if (slm.length > 0) {
|
|
|
for(const s of slm) {
|
|
|
const index = _.findIndex(ledgerList, { 'ledger_id': s.lid });
|
|
|
- if (index && index !== -1) {
|
|
|
+ if (index !== -1) {
|
|
|
ledgerList[index].plan_tp = s.plan_tp;
|
|
|
ledgerList[index].plan_gcl = s.plan_gcl;
|
|
|
ledgerList[index].sj_tp = s.sj_tp;
|
|
|
@@ -728,7 +728,7 @@ function setGclMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
|
|
|
if (nextSlm.length > 0) {
|
|
|
for (const ns of nextSlm) {
|
|
|
const index = _.findIndex(ledgerList, {'ledger_id': ns.lid});
|
|
|
- if (index && index !== -1) {
|
|
|
+ if (index !== -1) {
|
|
|
ledgerList[index].next_plan_tp = ns.plan_tp;
|
|
|
ledgerList[index].next_plan_gcl = ns.plan_gcl;
|
|
|
}
|
|
|
@@ -737,7 +737,7 @@ function setGclMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
|
|
|
if (endSlm.length > 0) {
|
|
|
for (const es of endSlm) {
|
|
|
const index = _.findIndex(ledgerList, {'ledger_id': es.lid});
|
|
|
- if (index && index !== -1) {
|
|
|
+ if (index !== -1) {
|
|
|
ledgerList[index].end_plan_tp = es.plan_tp;
|
|
|
ledgerList[index].end_plan_gcl = es.plan_gcl;
|
|
|
ledgerList[index].end_sj_tp = es.sj_tp;
|
|
|
@@ -748,7 +748,7 @@ function setGclMonthToLedger(ledgerList, slm, nextSlm, endSlm, yearSlm) {
|
|
|
if (yearSlm.length > 0) {
|
|
|
for (const ys of yearSlm) {
|
|
|
const index = _.findIndex(ledgerList, {'ledger_id': ys.lid});
|
|
|
- if (index && index !== -1) {
|
|
|
+ if (index !== -1) {
|
|
|
ledgerList[index].year_plan_tp = ys.plan_tp;
|
|
|
ledgerList[index].year_plan_gcl = ys.plan_gcl;
|
|
|
ledgerList[index].year_sj_tp = ys.sj_tp;
|