Commit 474bea32 authored by sherlock's avatar sherlock

DFFS/JFFS type

parent 17b8b48c
...@@ -11,6 +11,7 @@ import pwc.taxtech.atms.common.util.MyAsserts; ...@@ -11,6 +11,7 @@ import pwc.taxtech.atms.common.util.MyAsserts;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto; import pwc.taxtech.atms.dpo.CellTemplatePerGroupDto;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto; import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.entity.AccountMapping; import pwc.taxtech.atms.entity.AccountMapping;
...@@ -113,6 +114,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -113,6 +114,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
dto.setPeriod(period); dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE); dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource); dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType( FormulaDataSourceType.TrialBalanceSource.getCode());
contain.add(dto); contain.add(dto);
} }
return temp.stream().mapToDouble(a -> a.getPtdCr().doubleValue()).sum(); return temp.stream().mapToDouble(a -> a.getPtdCr().doubleValue()).sum();
......
...@@ -10,6 +10,7 @@ import pwc.taxtech.atms.common.util.DateUtils; ...@@ -10,6 +10,7 @@ import pwc.taxtech.atms.common.util.DateUtils;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
import pwc.taxtech.atms.constant.Constant; import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType; import pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType;
import pwc.taxtech.atms.constant.enums.FormulaDataSourceType;
import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto; import pwc.taxtech.atms.dto.vatdto.ReportCellDataSourceDto;
import pwc.taxtech.atms.entity.AccountMapping; import pwc.taxtech.atms.entity.AccountMapping;
import pwc.taxtech.atms.entity.AccountMappingExample; import pwc.taxtech.atms.entity.AccountMappingExample;
...@@ -109,6 +110,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction { ...@@ -109,6 +110,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
dto.setPeriod(period); dto.setPeriod(period);
dto.setIsOnlyManualInput(Boolean.FALSE); dto.setIsOnlyManualInput(Boolean.FALSE);
dto.setName(Constant.DataSourceName.ReportDataSource); dto.setName(Constant.DataSourceName.ReportDataSource);
dto.setType( FormulaDataSourceType.TrialBalanceSource.getCode());
contain.add(dto); contain.add(dto);
} }
return temp.stream().mapToDouble(a -> a.getPtdDr().doubleValue()).sum(); return temp.stream().mapToDouble(a -> a.getPtdDr().doubleValue()).sum();
......
...@@ -159,25 +159,35 @@ ...@@ -159,25 +159,35 @@
_.each($scope.exportDataList, function(exportData){ _.each($scope.exportDataList, function(exportData){
if(exportData.begDebitBal && parseFloat(exportData.begDebitBal.replace(/,/g, "")).toString() != "NaN") { if(exportData.begDebitBal && parseFloat(exportData.begDebitBal.replace(/,/g, "")).toString() != "NaN") {
$scope.totalBegDebitBal += parseFloat(exportData.begDebitBal.replace(/,/g, "")); $scope.totalBegDebitBal += parseFloat(exportData.begDebitBal.replace(/,/g, ""));
exportData.begDebitBal exportData.begDebitBal = parseFloat(exportData.begDebitBal.replace(/,/g, "")).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
} }
if(exportData.begCreditBal && parseFloat(exportData.begCreditBal.replace(/,/g, "")).toString() != "NaN") if(exportData.begCreditBal && parseFloat(exportData.begCreditBal.replace(/,/g, "")).toString() != "NaN"){
$scope.totalBegCreditBal += parseFloat(exportData.begCreditBal.replace(/,/g, "")); $scope.totalBegCreditBal += parseFloat(exportData.begCreditBal.replace(/,/g, ""));
if(exportData.debitBal && parseFloat(exportData.debitBal.replace(/,/g, "")).toString() != "NaN") exportData.begCreditBal = parseFloat(exportData.begCreditBal.replace(/,/g, "")).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
}
if(exportData.debitBal && parseFloat(exportData.debitBal.replace(/,/g, "")).toString() != "NaN"){
$scope.totalDebitBal += parseFloat(exportData.debitBal.replace(/,/g, "")); $scope.totalDebitBal += parseFloat(exportData.debitBal.replace(/,/g, ""));
if(exportData.creditBal && parseFloat(exportData.creditBal.replace(/,/g, "")).toString() != "NaN") exportData.debitBal = parseFloat(exportData.debitBal.replace(/,/g, "")).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
}
if(exportData.creditBal && parseFloat(exportData.creditBal.replace(/,/g, "")).toString() != "NaN") {
$scope.totalCreditBal += parseFloat(exportData.creditBal.replace(/,/g, "")); $scope.totalCreditBal += parseFloat(exportData.creditBal.replace(/,/g, ""));
if(exportData.endDebitBal && parseFloat(exportData.endDebitBal.replace(/,/g, "")).toString() != "NaN") exportData.creditBal = parseFloat(exportData.creditBal.replace(/,/g, "")).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
}
if(exportData.endDebitBal && parseFloat(exportData.endDebitBal.replace(/,/g, "")).toString() != "NaN") {
$scope.totalEndDebitBal += parseFloat(exportData.endDebitBal.replace(/,/g, "")); $scope.totalEndDebitBal += parseFloat(exportData.endDebitBal.replace(/,/g, ""));
if(exportData.endCreditBal && parseFloat(exportData.endCreditBal.replace(/,/g, "")).toString() != "NaN") exportData.endDebitBal = parseFloat(exportData.endDebitBal.replace(/,/g, "")).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
}
if(exportData.endCreditBal && parseFloat(exportData.endCreditBal.replace(/,/g, "")).toString() != "NaN") {
$scope.totalEndCreditBal += parseFloat(exportData.endCreditBal.replace(/,/g, "")); $scope.totalEndCreditBal += parseFloat(exportData.endCreditBal.replace(/,/g, ""));
exportData.endCreditBal = parseFloat(exportData.endCreditBal.replace(/,/g, "")).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
}
}); });
$scope.totalEndCreditBal = $scope.totalEndCreditBal .toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); $scope.totalEndCreditBal = $scope.totalEndCreditBal.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
$scope.totalEndDebitBal = $scope.totalEndDebitBal .toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); $scope.totalEndDebitBal = $scope.totalEndDebitBal.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
$scope.totalCreditBal = $scope.totalCreditBal .toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); $scope.totalCreditBal = $scope.totalCreditBal.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
$scope.totalDebitBal = $scope.totalDebitBal .toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); $scope.totalDebitBal = $scope.totalDebitBal.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
$scope.totalBegCreditBal = $scope.totalBegCreditBal .toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); $scope.totalBegCreditBal = $scope.totalBegCreditBal.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
$scope.totalBegDebitBal = $scope.totalBegDebitBal .toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,'); $scope.totalBegDebitBal = $scope.totalBegDebitBal.toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, '$1,');
} }
else { else {
$scope.gridOptions.data = newTree; $scope.gridOptions.data = newTree;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment