Commit b29bb3c9 authored by eddie.woo's avatar eddie.woo

Merge branch 'dev_oracle' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_oracle

parents 00839ba3 e8bc7bfa
...@@ -63,8 +63,6 @@ public class InputInvoiceDataImportServiceImpl { ...@@ -63,8 +63,6 @@ public class InputInvoiceDataImportServiceImpl {
project.getYear(), paras.getPeriodStart(), Constant.DateFormat.YYYYMM), DateUtils.getPeriodEndFormat(project.getYear(), project.getYear(), paras.getPeriodStart(), Constant.DateFormat.YYYYMM), DateUtils.getPeriodEndFormat(project.getYear(),
paras.getPeriodEnd(), Constant.DateFormat.YYYYMM)).andRZJGEqualTo(INPUT_RZJG_SUCCESS).andRZZTEqualTo(INPUT_RZZT_OVER) paras.getPeriodEnd(), Constant.DateFormat.YYYYMM)).andRZJGEqualTo(INPUT_RZJG_SUCCESS).andRZZTEqualTo(INPUT_RZZT_OVER)
.andFPZTNotEqualTo("1"); .andFPZTNotEqualTo("1");
List<InputInvoice> invoices = inputInvoiceMapper.selectByExample(invoiceExample); List<InputInvoice> invoices = inputInvoiceMapper.selectByExample(invoiceExample);
DecimalFormat df = new DecimalFormat("#,###.00"); DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> { invoices.stream().forEach(x -> {
...@@ -77,8 +75,23 @@ public class InputInvoiceDataImportServiceImpl { ...@@ -77,8 +75,23 @@ public class InputInvoiceDataImportServiceImpl {
} }
public PageInfo<InputInvoice> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras, String projectId) { public PageInfo<InputInvoice> getInputInvoiceTreeViewData(InputInvoicePreviewQueryParam paras, String projectId) {
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
InputInvoiceExample invoiceExample = new InputInvoiceExample();
invoiceExample.createCriteria().andGFSHEqualTo(organization.getTaxPayerNumber()).andRZSQBetween(DateUtils.getPeriodBeginFormat(
project.getYear(), paras.getPeriodStart(), Constant.DateFormat.YYYYMM), DateUtils.getPeriodEndFormat(project.getYear(),
paras.getPeriodEnd(), Constant.DateFormat.YYYYMM)).andRZJGEqualTo(INPUT_RZJG_SUCCESS).andRZZTEqualTo(INPUT_RZZT_OVER)
.andFPZTNotEqualTo("1");
PageHelper.startPage(paras.getPageInfo().getPageIndex(), paras.getPageInfo().getPageSize()); PageHelper.startPage(paras.getPageInfo().getPageIndex(), paras.getPageInfo().getPageSize());
PageInfo<InputInvoice> pageInfo = new PageInfo<>(getInputInvoiceTree(paras, projectId)); List<InputInvoice> invoices = inputInvoiceMapper.selectByExample(invoiceExample);
DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> {
x.setHJJE(df.format(new BigDecimal(x.getHJJE())));
x.setHJSE(df.format(new BigDecimal(x.getHJSE())));
x.setRZJG(convertRzjg(x.getRZJG()));
}
);
PageInfo<InputInvoice> pageInfo = new PageInfo<>(invoices);
return pageInfo; return pageInfo;
} }
......
...@@ -100,7 +100,31 @@ public class OutputInvoiceServiceImpl { ...@@ -100,7 +100,31 @@ public class OutputInvoiceServiceImpl {
} }
public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) { public PageInfo<OutputInvoice> queryOutputInvoiceList(QueryOutputDto queryDto, String projectId) {
PageInfo<OutputInvoice> pageInfo = new PageInfo<>(queryOutputInvoiceAllList(queryDto, projectId));
Project project = projectMapper.selectByPrimaryKey(projectId);
Organization organization = organizationMapper.selectByPrimaryKey(project.getOrganizationId());
OutputInvoiceExample outputInvoiceExample = new OutputInvoiceExample();
if (organization.getTaxPayerNumber() == null) {
outputInvoiceExample.createCriteria().andXFSHIsNull().andKPZTEqualTo(OUTPUT_KPZT_YES).
andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()),
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()))
.andFPZTNotEqualTo("1");
} else {
outputInvoiceExample.createCriteria().andXFSHEqualTo(organization.getTaxPayerNumber()).andKPZTEqualTo(OUTPUT_KPZT_YES).
andKPRQBetween(DateUtils.getPeriodBegin(project.getYear(), queryDto.getPeriodStart()),
DateUtils.getPeriodEnd(project.getYear(), queryDto.getPeriodEnd()))
.andFPZTNotEqualTo("1");
}
PageHelper.startPage(queryDto.getPageInfo().getPageIndex(), queryDto.getPageInfo().getPageSize());
List<OutputInvoice> invoices = outputInvoiceMapper.selectByExample(outputInvoiceExample);
DecimalFormat df = new DecimalFormat("#,###.00");
invoices.stream().forEach(x -> {
x.setHJJE(df.format(new BigDecimal(x.getHJJE())));
x.setHJSE(df.format(new BigDecimal(x.getHJSE())));
}
);
PageInfo<OutputInvoice> pageInfo = new PageInfo<>(invoices);
return pageInfo; return pageInfo;
} }
......
...@@ -119,7 +119,7 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -119,7 +119,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()); 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();
......
...@@ -12,10 +12,7 @@ import pwc.taxtech.atms.constant.Constant; ...@@ -12,10 +12,7 @@ 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.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.*;
import pwc.taxtech.atms.entity.AccountMappingExample;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrg;
import pwc.taxtech.atms.entity.EnterpriseAccountSetOrgExample;
import pwc.taxtech.atms.vat.entity.GlBalance; import pwc.taxtech.atms.vat.entity.GlBalance;
import pwc.taxtech.atms.vat.entity.GlBalanceExample; import pwc.taxtech.atms.vat.entity.GlBalanceExample;
...@@ -68,7 +65,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction { ...@@ -68,7 +65,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
double result = 0; double result = 0;
for(AccountMapping a : accountMappings){ for(AccountMapping a : accountMappings){
result += count(a.getEnterpriseAccountCode(), dataSource, period, year); result += count(a.getEnterpriseAccountCode(), dataSource, period, year,orgId);
} }
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.FormulaDataSourceDto, FormulaDataSourceDetailType.FormulaDataSourceDto,
...@@ -78,7 +75,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction { ...@@ -78,7 +75,7 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
return new NumberEval(result); return new NumberEval(result);
} else if(type == 1){ } else if(type == 1){
double result = count(code, dataSource, period, year); double result = count(code, dataSource, period, year, orgId);
Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource), Long dataSoureId = saveDataSource(ec, Collections.singletonList(dataSource),
FormulaDataSourceDetailType.FormulaDataSourceDto, FormulaDataSourceDetailType.FormulaDataSourceDto,
new BigDecimal(result), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId()); new BigDecimal(result), period, formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
...@@ -93,10 +90,16 @@ public class JFFS extends FunctionBase implements FreeRefFunction { ...@@ -93,10 +90,16 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
return year + "-" + (period > 9 ? period : ("0" + period)); return year + "-" + (period > 9 ? period : ("0" + period));
} }
private double count(String code, List<ReportCellDataSourceDto> contain, int period, int year){ private double count(String code, List<ReportCellDataSourceDto> contain, int period, int year, String orgId){
Organization organization = SpringContextUtil.organizationMapper.selectByPrimaryKey(orgId);
GlBalanceExample glBalanceExample = new GlBalanceExample(); GlBalanceExample glBalanceExample = new GlBalanceExample();
GlBalanceExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3EqualTo(code).andPeriodNameEqualTo(periodName(period, year)); GlBalanceExample.Criteria c1 = glBalanceExample.createCriteria().andSegment3EqualTo(code).andPeriodNameEqualTo(periodName(period, year));
GlBalanceExample.Criteria c2 = glBalanceExample.createCriteria().andSegment4EqualTo(code).andPeriodNameEqualTo(periodName(period, year)); GlBalanceExample.Criteria c2 = glBalanceExample.createCriteria().andSegment4EqualTo(code).andPeriodNameEqualTo(periodName(period, year));
if(organization != null){
c1.andSegment1EqualTo(organization.getClientCode());
c2.andSegment1EqualTo(organization.getClientCode());
}
glBalanceExample.or(c2); glBalanceExample.or(c2);
List<GlBalance> list = SpringContextUtil.glBalanceMapper.selectByExample(glBalanceExample); List<GlBalance> list = SpringContextUtil.glBalanceMapper.selectByExample(glBalanceExample);
if(CollectionUtils.isEmpty(list)){ if(CollectionUtils.isEmpty(list)){
......
...@@ -127,7 +127,9 @@ public interface PeriodReportMapper extends MyVatMapper { ...@@ -127,7 +127,9 @@ public interface PeriodReportMapper extends MyVatMapper {
" LEFT JOIN PERIOD_TEMPLATE pt ON r.TEMPLATE_ID = pt.TEMPLATE_ID " + " LEFT JOIN PERIOD_TEMPLATE pt ON r.TEMPLATE_ID = pt.TEMPLATE_ID " +
"WHERE " + "WHERE " +
" r.PROJECT_ID = #{projectId} " + " r.PROJECT_ID = #{projectId} " +
" AND r.PERIOD = #{period} " + " AND r.PERIOD = #{period}" +
" AND pt.PROJECT_ID = r.PROJECT_ID " +
" AND pt.PERIOD = r.PERIOD " +
"ORDER BY " + "ORDER BY " +
" pt.ORDER_INDEX" + " pt.ORDER_INDEX" +
"") "")
......
...@@ -174,12 +174,12 @@ ...@@ -174,12 +174,12 @@
}; };
function doConfirmEventHandler() { function doConfirmEventHandler() {
swal.close();
var r = /^00\d*|^\.\d+|\.$/; var r = /^00\d*|^\.\d+|\.$/;
if ($scope.detail.inputValue && (isNaN($scope.detail.inputValue) || r.test($scope.detail.inputValue))) { if ($scope.detail.inputValue && (isNaN($scope.detail.inputValue) || r.test($scope.detail.inputValue))) {
SweetAlert.warning($translate.instant('CheckInputValueFormat')); SweetAlert.warning($translate.instant('CheckInputValueFormat'));
return; return;
} } else if ($scope.detail.inputValue && parseFloat($scope.detail.inputValue).toFixed(2) > 9999999999999) {
if ($scope.detail.inputValue && parseFloat($scope.detail.inputValue).toFixed(2) > 9999999999999) {
SweetAlert.warning($translate.instant('CheckInputValueLength')); SweetAlert.warning($translate.instant('CheckInputValueLength'));
return; return;
} }
...@@ -240,6 +240,8 @@ ...@@ -240,6 +240,8 @@
}, },
function (isConfirm) { function (isConfirm) {
if (isConfirm) { if (isConfirm) {
doConfirmEventHandler(); doConfirmEventHandler();
} else { } else {
swal.close(); swal.close();
...@@ -542,7 +544,7 @@ ...@@ -542,7 +544,7 @@
var dataGridCommonOptions = { var dataGridCommonOptions = {
bindingOptions: { bindingOptions: {
columns: 'dataGridColumns', columns: 'dataGridColumns',
dataSource: 'detail.dataGridSource', dataSource: 'detail.dataGridSourceBind',
height: 'dataGridHeight' height: 'dataGridHeight'
}, },
//添加合计(dx的合计行隐藏,用重写合计行替代,fixed bug 10941) //添加合计(dx的合计行隐藏,用重写合计行替代,fixed bug 10941)
...@@ -554,6 +556,9 @@ ...@@ -554,6 +556,9 @@
column: 'cellName', column: 'cellName',
customizeText: function (data) { customizeText: function (data) {
$("#dataSourceGrid .dx-datagrid-total-footer").hide(); $("#dataSourceGrid .dx-datagrid-total-footer").hide();
if($scope.detail.cellType == enums.formulaDataSourceType.TrialBalanceSource) {
return $scope.detail.cellInfo.money;
}
return $scope.detail.summaryExp; return $scope.detail.summaryExp;
} }
}, /*{ }, /*{
...@@ -566,6 +571,9 @@ ...@@ -566,6 +571,9 @@
column: 'cellConditionName', column: 'cellConditionName',
customizeText: function (data) { customizeText: function (data) {
$("#dataSourceGrid .dx-datagrid-total-footer").hide(); $("#dataSourceGrid .dx-datagrid-total-footer").hide();
if($scope.detail.cellType == enums.formulaDataSourceType.TrialBalanceSource) {
return $scope.detail.cellInfo.money;
}
return $scope.detail.summaryExp; return $scope.detail.summaryExp;
} }
}/*, { }/*, {
...@@ -709,59 +717,139 @@ ...@@ -709,59 +717,139 @@
var getDataGridColumns = function () { var getDataGridColumns = function () {
var dataGridColumns; var dataGridColumns;
switch ($scope.detail.cellType) { switch ($scope.detail.cellType) {
case enums.formulaDataSourceType.InputInvoice: case enums.formulaDataSourceType.TrialBalanceSource:
//进项数据源 //平衡表数据源
dataGridColumns = [ dataGridColumns = [
{ {
dataField: 'period', calculateCellValue: function(){
return $scope.projectPeriod
},
// dataField: 'projectPeriod',
caption: $translate.instant('InvoiceQJ'), caption: $translate.instant('InvoiceQJ'),
alignment: 'center', alignment: 'center',
width: '9%' width: '10%'
}, },
{ {
dataField: 'date', calculateCellValue: function(){
caption: $translate.instant('InvoiceRZRQ'), var formula = $scope.detail.config.formula;
alignment: 'left', if(formula.indexOf('DFFS') > -1){
width: '13%' return '贷方发生';
} else if(formula.indexOf('JFFS') > -1){
return '借方发生';
}
return '';
},
// dataField: 'type',
caption: $translate.instant('类型'),
alignment: 'center',
width: '30%'
}, },
{ {
dataField: 'invoiceCode', calculateCellValue: function(){
caption: $translate.instant('InvoiceFPDM'), var formula = $scope.detail.config.formula;
alignment: 'left', return formula.match(/\"\d+\"/);
width: '13%' },
// dataField: 'description',
caption: $translate.instant('描述'),
alignment: 'center',
width: '30%'
}, },
{ {
dataField: 'invoiceNumber', calculateCellValue: function(){
caption: $translate.instant('InvoiceFPHM'), return $scope.detail.cellInfo.money;
alignment: 'left',
width: '13%' },
}, // dataField: 'value',
caption: $translate.instant('数值'),
alignment: 'center',
width: '30%'
}
];
break;
case enums.formulaDataSourceType.InputInvoice:
//进项数据源
dataGridColumns = [
{ {
dataField: 'saleId', calculateCellValue: function(){
caption: $translate.instant('InvoiceXFSBH'), return $scope.projectPeriod
alignment: 'left', },
width: '13%' // dataField: 'projectPeriod',
caption: $translate.instant('InvoiceQJ'),
alignment: 'center',
width: '10%'
}, },
{ {
dataField: 'money', calculateCellValue: function(){
caption: $translate.instant('InvoiceJE'), return '进项发票';
alignment: 'right', },
format: {type: 'fixedPoint', precision: 2}, // dataField: 'type',
width: '13%' caption: $translate.instant('类型'),
alignment: 'center',
width: '30%'
}, },
{ {
dataField: 'taxMoney', calculateCellValue: function(){
caption: $translate.instant('InvoiceSE'), return '';
alignment: 'right', },
format: {type: 'fixedPoint', precision: 2}, // dataField: 'description',
width: '13%' caption: $translate.instant('描述'),
alignment: 'center',
width: '30%'
}, },
{ {
dataField: 'invoiceType', calculateCellValue: function(){
caption: $translate.instant('InvoiceFPLX'), return $scope.detail.cellInfo.money;
alignment: 'left',
width: '13%' },
// dataField: 'value',
caption: $translate.instant('数值'),
alignment: 'center',
width: '30%'
} }
// {
// dataField: 'date',
// caption: $translate.instant('InvoiceRZRQ'),
// alignment: 'left',
// width: '13%'
// },
// {
// dataField: 'invoiceCode',
// caption: $translate.instant('InvoiceFPDM'),
// alignment: 'left',
// width: '13%'
// },
// {
// dataField: 'invoiceNumber',
// caption: $translate.instant('InvoiceFPHM'),
// alignment: 'left',
// width: '13%'
// },
// {
// dataField: 'saleId',
// caption: $translate.instant('InvoiceXFSBH'),
// alignment: 'left',
// width: '13%'
// },
// {
// dataField: 'money',
// caption: $translate.instant('InvoiceJE'),
// alignment: 'right',
// format: {type: 'fixedPoint', precision: 2},
// width: '13%'
// },
// {
// dataField: 'taxMoney',
// caption: $translate.instant('InvoiceSE'),
// alignment: 'right',
// format: {type: 'fixedPoint', precision: 2},
// width: '13%'
// },
// {
// dataField: 'invoiceType',
// caption: $translate.instant('InvoiceFPLX'),
// alignment: 'left',
// width: '13%'
// }
]; ];
break; break;
case enums.formulaDataSourceType.InputInvoiceDetail: case enums.formulaDataSourceType.InputInvoiceDetail:
...@@ -822,6 +910,43 @@ ...@@ -822,6 +910,43 @@
case enums.formulaDataSourceType.OutputInvoice: case enums.formulaDataSourceType.OutputInvoice:
//销项发票数据源 //销项发票数据源
dataGridColumns = [ dataGridColumns = [
{
calculateCellValue: function(){
return $scope.projectPeriod
},
// dataField: 'projectPeriod',
caption: $translate.instant('InvoiceQJ'),
alignment: 'center',
width: '10%'
},
{
calculateCellValue: function(){
return '销项发票';
},
// dataField: 'type',
caption: $translate.instant('类型'),
alignment: 'center',
width: '30%'
},
{
calculateCellValue: function(){
return '';
},
// dataField: 'description',
caption: $translate.instant('描述'),
alignment: 'center',
width: '30%'
},
{
calculateCellValue: function(){
return $scope.detail.cellInfo.money;
},
// dataField: 'value',
caption: $translate.instant('数值'),
alignment: 'center',
width: '30%'
}/*
{ {
dataField: 'period', dataField: 'period',
caption: $translate.instant('InvoiceQJ'), caption: $translate.instant('InvoiceQJ'),
...@@ -877,7 +1002,7 @@ ...@@ -877,7 +1002,7 @@
caption: $translate.instant('InvoiceType'), caption: $translate.instant('InvoiceType'),
alignment: 'left', alignment: 'left',
width: '11%' width: '11%'
} }*/
]; ];
break; break;
case enums.formulaDataSourceType.Voucher: case enums.formulaDataSourceType.Voucher:
...@@ -1943,16 +2068,30 @@ ...@@ -1943,16 +2068,30 @@
_.isEmpty($scope.selectedTypeName) || $scope.selectedTypeName === element.name)) { _.isEmpty($scope.selectedTypeName) || $scope.selectedTypeName === element.name)) {
$scope.detail.dataGridSource = element.dataSource; $scope.detail.dataGridSource = element.dataSource;
$scope.selectedTypeName = element.name; $scope.selectedTypeName = element.name;
switch ($scope.detail.cellType) {
case enums.formulaDataSourceType.OutputInvoice:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break;
case enums.formulaDataSourceType.TrialBalanceSource:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break;
case enums.formulaDataSourceType.InputInvoice:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break;
default :
$scope.detail.dataGridSourceBind = $scope.detail.dataGridSource;
break;
}
//if (element.name === 'MaxConditionDataSource') { //if (element.name === 'MaxConditionDataSource') {
// $scope.dataSourceOptions.summary.totalItems[4].summaryType = 'max'; // $scope.dataSourceOptions.summary.totalItems[4].summaryType = 'max';
//} else { //} else {
// $scope.dataSourceOptions.summary.totalItems[4].summaryType = 'min'; // $scope.dataSourceOptions.summary.totalItems[4].summaryType = 'min';
//} //}
return; return;
} }
}); });
$scope.dataGridColumns = getDataGridColumns(); $scope.dataGridColumns = getDataGridColumns();
getConclusionVal(); getConclusionVal();
...@@ -1961,6 +2100,7 @@ ...@@ -1961,6 +2100,7 @@
//当数据源数量变化是,重新排序数据源 //当数据源数量变化是,重新排序数据源
$scope.$watch('detail.items.length', function (newVal, oldValue) { $scope.$watch('detail.items.length', function (newVal, oldValue) {
if (newVal) { if (newVal) {
$scope.detail.items = _.sortBy($scope.detail.items, function (item) { $scope.detail.items = _.sortBy($scope.detail.items, function (item) {
if (item.type === enums.formulaDataSourceType.ModelDatasource || if (item.type === enums.formulaDataSourceType.ModelDatasource ||
...@@ -1983,6 +2123,7 @@ ...@@ -1983,6 +2123,7 @@
$scope.$watch('detail.items', function (newVal, oldValue) { $scope.$watch('detail.items', function (newVal, oldValue) {
$timeout(function () { $timeout(function () {
$scope.selectedTabIndex = $scope.detail.cellType; $scope.selectedTabIndex = $scope.detail.cellType;
$scope.selectedTabId = $scope.detail.cellTypeId; $scope.selectedTabId = $scope.detail.cellTypeId;
$scope.selectedTypeName = null; $scope.selectedTypeName = null;
...@@ -2008,6 +2149,20 @@ ...@@ -2008,6 +2149,20 @@
//} else { //} else {
// $scope.dataSourceOptions.summary.totalItems[4].summaryType = 'min'; // $scope.dataSourceOptions.summary.totalItems[4].summaryType = 'min';
//} //}
switch ($scope.detail.cellType) {
case enums.formulaDataSourceType.OutputInvoice:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break;
case enums.formulaDataSourceType.TrialBalanceSource:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break;
case enums.formulaDataSourceType.InputInvoice:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break;
default :
$scope.detail.dataGridSourceBind = $scope.detail.dataGridSource;
break;
}
} }
cellAmountValue += calculateFilterDatasourceAmount(element, true); cellAmountValue += calculateFilterDatasourceAmount(element, true);
}); });
...@@ -2021,7 +2176,6 @@ ...@@ -2021,7 +2176,6 @@
$scope.detail.cellInfo.money = $scope.detail.cellInfo.money.formatAmount(2); $scope.detail.cellInfo.money = $scope.detail.cellInfo.money.formatAmount(2);
} }
} }
$scope.dataGridColumns = getDataGridColumns(); $scope.dataGridColumns = getDataGridColumns();
getConclusionVal(); getConclusionVal();
...@@ -2120,9 +2274,12 @@ ...@@ -2120,9 +2274,12 @@
filterWay: 1 filterWay: 1
}; };
$scope.dataSourceOptions = dataGridCommonOptions; $scope.dataSourceOptions = dataGridCommonOptions;
$scope.allItemsDataSourceOptions = allItemsDataSourceOptions; $scope.allItemsDataSourceOptions = allItemsDataSourceOptions;
switch ($scope.detail.cellType) { switch ($scope.detail.cellType) {
case 5: case 5:
//定义表头样式 //定义表头样式
$scope.dataSourceOptions.customizeColumns = function (columns) { $scope.dataSourceOptions.customizeColumns = function (columns) {
......
commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams', commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$log', '$translate', '$timeout', '$q', '$compile', '$state', '$stateParams',
'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService', 'apiInterceptor', 'vatExportService', 'SweetAlert', 'BSPLService', 'vatReportService', 'vatReportCacheService', 'vatSessionService',
'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService','vatApproveService', 'loginContext', 'enums', 'vatCommonService', 'vatWorkflowService', 'projectService', '$uibModal', '$cookies', 'Upload', 'vatImportService','vatApproveService',
function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService, function ($scope, $rootScope, $log, $translate, $timeout, $q, $compile, $state, $stateParams, apiInterceptor, vatExportService, SweetAlert, BSPLService,
...@@ -648,6 +648,7 @@ commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$lo ...@@ -648,6 +648,7 @@ commonModule.controller('VatReportViewController', ['$scope', '$rootScope', '$lo
$scope.taxCellDetail.dataSourceCount++; $scope.taxCellDetail.dataSourceCount++;
} }
}); });
// $scope.taxCellDetail.items = [_.first($scope.taxCellDetail.items)];
} }
else { else {
var flag = true; var flag = true;
......
...@@ -442,10 +442,11 @@ commonModule.factory('enums', ['$translate', function ($translate) { ...@@ -442,10 +442,11 @@ commonModule.factory('enums', ['$translate', function ($translate) {
////未开票数据源 ////未开票数据源
//Unbilled: 9, //Unbilled: 9,
KeyInSource: 10, KeyInSource: 10,
QCYESource: 11, TrialBalanceSource:11,
QMYESource: 12, // QCYESource: 11,
// QMYESource: 12,
ModelSource: 13, ModelSource: 13,
FSESource: 14, // FSESource: 14,
RuleSource: 15, RuleSource: 15,
//凭证筛选 //凭证筛选
...@@ -456,7 +457,10 @@ commonModule.factory('enums', ['$translate', function ($translate) { ...@@ -456,7 +457,10 @@ commonModule.factory('enums', ['$translate', function ($translate) {
ModelDatasource: 18, ModelDatasource: 18,
// 用于存放特殊逻辑中获取的数据源数值与备注等信息,如未开票视同销售等 // 用于存放特殊逻辑中获取的数据源数值与备注等信息,如未开票视同销售等
Special: 19, Special: 19,
BSPL: 20 BSPL: 20,
summary: 100
}, },
VatImportSubStatus: { VatImportSubStatus: {
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
//************************************************************************************************* //*************************************************************************************************
$scope.randomCounter = 0; $scope.randomCounter = 0;
$scope.allResults = []; $scope.allResults = [];
$scope.queryResults = [];
$scope.checkedOrgs = {}; $scope.checkedOrgs = {};
$scope.orgList = []; $scope.orgList = [];
$scope.orderYear = true; $scope.orderYear = true;
...@@ -125,17 +126,14 @@ ...@@ -125,17 +126,14 @@
return _.contains(_.values($scope.checkedOrgs), i.organizationName); return _.contains(_.values($scope.checkedOrgs), i.organizationName);
}); });
} }
if ($scope.serviceTypeId) {
temp = _.filter(temp, function (i) {
return $scope.serviceTypeId == i.serviceTypeID;
});
}
if (vatSessionService.year) { if (vatSessionService.year) {
if ($scope.serviceTypeId === enums.serviceType.VAT) { if ($scope.serviceTypeId === enums.serviceType.VAT) {
temp = _.filter(temp, function (i) { temp = _.filter(temp, function (i) {
if (i.startPeriod <= vatSessionService.month && i.endPeriod >= vatSessionService.month && i.year == vatSessionService.year) { if (i.period == vatSessionService.month) {
return i; return i;
} }
}); });
} }
else if ($scope.serviceTypeId === enums.serviceType.CIT) { else if ($scope.serviceTypeId === enums.serviceType.CIT) {
...@@ -164,28 +162,6 @@ ...@@ -164,28 +162,6 @@
var counter = 0; var counter = 0;
var setWarningToTrue = false; var setWarningToTrue = false;
temp.forEach(function (project) {
setWarningToTrue = false;
project.finalStatus = setLayoutStatusTitle(project.projectStatusList);
project.periodDate = $scope.currentSelectedYear + "." + $scope.currentSelectedMonth;
var oneDemoData = _.find(demoData, function (one) { return one.id === project.id });
if (project.serviceTypeID === enums.serviceType.VAT) {
if (project.projectStatusList !== null && project.projectStatusList[vatSessionService.month] !== undefined && project.projectStatusList[vatSessionService.month] !== 10 && oneDemoData!==undefined) {
project.taxAmount = oneDemoData.taxAmount;
project.prepadidTaxAmount = oneDemoData.prepadidTaxAmount;
project.taxRate = oneDemoData.taxRate;
project.hasWarning = oneDemoData.hasWarning;
}
}
counter++;
});
$scope.queryResults = temp; $scope.queryResults = temp;
$scope.projectMsg = $translate.instant('ProjectResultMsg').formatObj({ "ProjectNum": $scope.queryResults.length }); $scope.projectMsg = $translate.instant('ProjectResultMsg').formatObj({ "ProjectNum": $scope.queryResults.length });
...@@ -283,15 +259,6 @@ ...@@ -283,15 +259,6 @@
}; };
$scope.changeStartDate = function (e) {
if (e&&e.date) {
var tempYear = e.date.getFullYear();
var tempMonth = e.date.getMonth() + 1;
$scope.currentSelectedStartMonth = tempMonth;
$scope.currentSelectedStartYear = tempYear;
}
};
$scope.changeDate = function (e) { $scope.changeDate = function (e) {
if (e && e.date) { if (e && e.date) {
var isDateUpdated = false; var isDateUpdated = false;
...@@ -308,15 +275,15 @@ ...@@ -308,15 +275,15 @@
$scope.currentSelectedYear = tempYear; $scope.currentSelectedYear = tempYear;
if (isDateUpdated) { if (isDateUpdated) {
//$scope.$apply(function () {
// $scope.conditionChange = !$scope.conditionChange;
//});
$timeout(function () { $timeout(function () {
$scope.conditionChange = !$scope.conditionChange; $scope.conditionChange = !$scope.conditionChange;
}); });
} }
if ($scope.serviceTypeId !== enums.serviceType.AssetsManage) {
$scope.query();
}
} }
}; };
...@@ -577,8 +544,18 @@ ...@@ -577,8 +544,18 @@
var loadApprovalFromDB = function () { var loadApprovalFromDB = function () {
vatApproveService.approvalTasks().success(function (data) { vatApproveService.approvalTasks().success(function (data) {
if (data) { if (data) {
data.forEach(function (p) {
if (PWC.isHavePermissionForOrg(p.organizationId, vatSessionService.userPermission))
{
$scope.allResults.push(p);
}
});
$scope.queryResults = _.clone($scope.allResults);
$scope.gridOptions = { $scope.gridOptions = {
dataSource: data, bindingOptions: {
"dataSource": "queryResults"
},
keyExpr: "instanceId", keyExpr: "instanceId",
showBorders: true, showBorders: true,
columns: [ columns: [
...@@ -597,7 +574,15 @@ ...@@ -597,7 +574,15 @@
} }
} }
}, },
{ caption: '审批意见', width: '15%', dataField: "approvalResult"}, { caption: '审批意见', width: '15%',
calculateCellValue: function(data) {
if(data.approvalResult == 'undefined'){
return '';
}else{
return data.approvalResult;
}
}
},
{ caption: '提审时间', width: '7.5%', dataField: "createTime"}, { caption: '提审时间', width: '7.5%', dataField: "createTime"},
{ caption: '审批时间', width: '7.5%', dataField: "approvalTime"} { caption: '审批时间', width: '7.5%', dataField: "approvalTime"}
], ],
...@@ -618,9 +603,11 @@ ...@@ -618,9 +603,11 @@
vatSessionService.project = result; vatSessionService.project = result;
vatSessionService.project.projectName = approvalInfo.projectName; vatSessionService.project.projectName = approvalInfo.projectName;
vatSessionService.project.month = approvalInfo.period; vatSessionService.project.month = approvalInfo.period;
vatSessionService.project.templateGroupID = template.templateGroupId;
vatSessionService.month = approvalInfo.period; vatSessionService.month = approvalInfo.period;
vatSessionService.approvalInfo=approvalInfo; vatSessionService.approvalInfo=approvalInfo;
$state.go('vat.generateReport.reportView', { $state.go('vat.generateReport.reportView', {
id: approvalInfo.reportIds.split(",")[0], id: approvalInfo.reportIds.split(",")[0],
templateid: approvalInfo.templateIds.split(",")[0], templateid: approvalInfo.templateIds.split(",")[0],
......
...@@ -170,9 +170,9 @@ ...@@ -170,9 +170,9 @@
$scope.queryOutputInvoiceResult = { $scope.queryOutputInvoiceResult = {
list: [], list: [],
pageInfo: { pageInfo: {
totalCount: 0, totalCount: -1,
pageIndex: 1, pageIndex: 1,
pageSize: 100, pageSize: constant.pagesize,
totalPage: 0, totalPage: 0,
} }
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
//房地产 //房地产
//projectID = '0cf0945f-d41c-4df3-8235-ae693d5e724d'; //projectID = '0cf0945f-d41c-4df3-8235-ae693d5e724d';
$q.all([ $q.all([
templateGroupService.getGroupTemplateByGroupID(48372654336679936, projectID), templateGroupService.getGroupTemplateByGroupID(vatSessionService.project.templateGroupID, projectID),
vatReportService.getFilterTemplate(vatSessionService.project.id, constant.serviceType.VAT, vatSessionService.month) vatReportService.getFilterTemplate(vatSessionService.project.id, constant.serviceType.VAT, vatSessionService.month)
]).then(function (result) { ]).then(function (result) {
if (!_.isEmpty(result[0]) && !_.isEmpty(result[0].data) && !_.isEmpty(result[0].data.data) if (!_.isEmpty(result[0]) && !_.isEmpty(result[0].data) && !_.isEmpty(result[0].data.data)
...@@ -41,29 +41,46 @@ ...@@ -41,29 +41,46 @@
} }
if ($scope.hasTaxReturnPermission && $scope.hasQueryTaxReturnPermission) { if ($scope.hasTaxReturnPermission && $scope.hasQueryTaxReturnPermission) {
var diffArr = ['会计数据统计','出口数据比对','进项税额差异分析表','收入差异分析表'];
// var templates = _.chain // var templates = _.chain
// 获取 申报表 Report Template // 获取 申报表 Report Template
var diffRtnGrp = {name:'差异分析表', children:[],orderIndex:1};
var taxRtnGrp = { var taxRtnGrp = {
name: 'TaxReturn', name: 'TaxReturn',
children: _.chain(result[1].data.data) children: _.chain(result[1].data.data)
.sortBy(function(x){ .sortBy(function(x){
return x.templateCode; return x.templateCode;
}) })
/*.map(function(x){ .map(function(x){
var nameIndex; var nameIndex;
var tempName = x.templateName.substr(x.templateName.length - 4); // var tempName = x.templateName.substr(x.templateName.length - 4);
if(tempName.search("附表一") != -1){ if(x.templateName == ('增值税纳税申报表')){
nameIndex = 0; nameIndex = 0;
} else if(tempName.search("附表二") != -1){ } else if(x.templateName.search("一") != -1){
nameIndex = 1; nameIndex = 1;
} else if(tempName.search("附表三") != -1){ } else if(x.templateName.search("二") != -1){
nameIndex = 2; nameIndex = 2;
} else if(tempName.search("附表四") != -1){ } else if(x.templateName.search("三") != -1){
nameIndex = 3; nameIndex = 3;
} else if(tempName.search("附表五") != -1){ } else if(x.templateName.search("四") != -1){
nameIndex = 4; nameIndex = 4;
} else { } else if(x.templateName.search("五") != -1){
nameIndex = 5;
} else if(x.templateName.search('代扣代缴') != -1){
nameIndex = 6;
} else if(x.templateName.search('海关专用') != -1){
nameIndex = 7;
} else if(x.templateName.search('增值税减免税申报明细表') != -1){
nameIndex = 8;
} else if(x.templateName.search('营改增') != -1){
nameIndex = 9;
} else if(x.templateName.search('附加税报表') != -1){
nameIndex = 10; nameIndex = 10;
} else {
nameIndex = 20;
if($.inArray(x.templateName, diffArr) != -1){
diffRtnGrp.children.push(x);
}
} }
return { return {
id:x.id, id:x.id,
...@@ -73,9 +90,12 @@ ...@@ -73,9 +90,12 @@
nameIndex:nameIndex nameIndex:nameIndex
} }
}) })
.filter(function(x){
return $.inArray(x.templateName, diffArr) == -1;
})
.sortBy(function(x){ .sortBy(function(x){
return x.nameIndex; return x.nameIndex;
})*/ })
.map(function (x) { .map(function (x) {
return { return {
reportId: x.id, reportId: x.id,
...@@ -86,11 +106,21 @@ ...@@ -86,11 +106,21 @@
}).value(), }).value(),
orderIndex: grps.length orderIndex: grps.length
}; };
diffRtnGrp.children = _.chain(diffRtnGrp.children)
.map(function(x){
return {
reportId: x.id,
id: x.templateId,
name: x.templateName,
code: x.templateCode
};
}).value();
grps.push(taxRtnGrp); grps.push(taxRtnGrp);
grps.push(diffRtnGrp);
} }
$scope.groups = _.chain(grps).sortBy(function (x) { $scope.groups = _.chain(grps).sortBy(function (x) {
return x.orderIndex; return x.orderIndex;
// return x.children.name; // return x.children.name;
}).map(function (x) { }).map(function (x) {
......
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