Skip to content

Commit

Permalink
fix: researcher export not working
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasPabloFerreira committed Oct 16, 2024
1 parent 2c64183 commit 449a877
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/app/services/export/export-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,15 @@ export class ExportService {

// Add columns with nurient data
let total: number = 0;
result.dqis.forEach(res => {
res.foodCategoryRecList.forEach(dqis => {
resultCol[dqis.categoryName] = dqis.calculatedAmount.toFixed(2);
total = total + +dqis.calculatedAmount;
if(result.dqis?.length > 0) {
result.dqis.forEach(res => {
res.foodCategoryRecList.forEach(dqis => {
resultCol[dqis.categoryName] = dqis.calculatedAmount.toFixed(2);
total = total + +dqis.calculatedAmount;
});
resultCol['TOTAL'] = total;
});
resultCol['TOTAL'] = total;
});
}

// Push columns to array of rows
resultRows.push(resultCol);
Expand Down

0 comments on commit 449a877

Please sign in to comment.