Commit 675b89bc 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 ffe48f13 bdb6d685
...@@ -56,10 +56,12 @@ public enum FormulaDataSourceType { ...@@ -56,10 +56,12 @@ public enum FormulaDataSourceType {
TrialBalanceSource(11), TrialBalanceSource(11),
//QMYESource(12), //QMYESource(12),
ModelSource(13), ModelSource(13),
WPSRSource(33),
TrialBalance(20), TrialBalance(20),
AssetListSource(21); AssetListSource(21);
// FSESource(14), // FSESource(14),
private Integer code; private Integer code;
FormulaDataSourceType(Integer code) { FormulaDataSourceType(Integer code) {
...@@ -98,6 +100,8 @@ public enum FormulaDataSourceType { ...@@ -98,6 +100,8 @@ public enum FormulaDataSourceType {
return FormulaDataSourceType.TrialBalance; return FormulaDataSourceType.TrialBalance;
case 21: case 21:
return FormulaDataSourceType.AssetListSource; return FormulaDataSourceType.AssetListSource;
case 33:
return FormulaDataSourceType.WPSRSource;
default: default:
return FormulaDataSourceType.Other; return FormulaDataSourceType.Other;
} }
......
...@@ -2402,6 +2402,13 @@ public class OrganizationServiceImpl { ...@@ -2402,6 +2402,13 @@ public class OrganizationServiceImpl {
newRule.setTaxPayerType(newTaxPayerType); // Use tax payer type related to template group newRule.setTaxPayerType(newTaxPayerType); // Use tax payer type related to template group
newRule.setCreateTime(now); newRule.setCreateTime(now);
newRule.setUpdateTime(now); newRule.setUpdateTime(now);
TaxPayerReportRuleExample exam = new TaxPayerReportRuleExample();
exam.createCriteria().andOrganizationIdEqualTo(orgDto.getId()).andTemplateGroupIdEqualTo(vatSetting.getTemplateGroupId());
List<TaxPayerReportRule> rules = taxPayerReportRuleMapper.selectByExample(exam);
if (!rules.isEmpty()) {
newRule.setId(rules.get(0).getId());
taxPayerReportRuleMapper.updateByPrimaryKeySelective(newRule);
} else
taxPayerReportRuleMapper.insertSelective(newRule); taxPayerReportRuleMapper.insertSelective(newRule);
} else { } else {
activeRule.setTemplateGroupId(vatSetting.getTemplateGroupId()); activeRule.setTemplateGroupId(vatSetting.getTemplateGroupId());
...@@ -2417,6 +2424,14 @@ public class OrganizationServiceImpl { ...@@ -2417,6 +2424,14 @@ public class OrganizationServiceImpl {
newRule.setTaxPayerType(newTaxPayerType); // Use tax payer type related to template group newRule.setTaxPayerType(newTaxPayerType); // Use tax payer type related to template group
newRule.setCreateTime(now); newRule.setCreateTime(now);
newRule.setUpdateTime(now); newRule.setUpdateTime(now);
TaxPayerReportRuleExample exam = new TaxPayerReportRuleExample();
exam.createCriteria().andOrganizationIdEqualTo(orgDto.getId()).andTemplateGroupIdEqualTo(vatSetting.getTemplateGroupId());
List<TaxPayerReportRule> rules = taxPayerReportRuleMapper.selectByExample(exam);
if (!rules.isEmpty()) {
newRule.setId(rules.get(0).getId());
taxPayerReportRuleMapper.updateByPrimaryKeySelective(newRule);
} else
taxPayerReportRuleMapper.insertSelective(newRule); taxPayerReportRuleMapper.insertSelective(newRule);
} }
} else if (activeRule != null) { // If no setting, remove non-default rule } else if (activeRule != null) { // If no setting, remove non-default rule
......
...@@ -694,13 +694,16 @@ public class ReportServiceImpl { ...@@ -694,13 +694,16 @@ public class ReportServiceImpl {
if (z.getItem2().getItems() != null && !z.getItem2().getItems().isEmpty() && z.getItem2().getItems().get(0).contains("tag")) { if (z.getItem2().getItems() != null && !z.getItem2().getItems().isEmpty() && z.getItem2().getItems().get(0).contains("tag")) {
z.getItem2().getItems().forEach(m -> { z.getItem2().getItems().forEach(m -> {
ReportCellDataSourceDto dto = JSON.parseObject(m, ReportCellDataSourceDto.class); ReportCellDataSourceDto dto = JSON.parseObject(m, ReportCellDataSourceDto.class);
if(dto != null && dto.getReportTemplateId() != null && !Pattern.compile("\\D").matcher(dto.getReportTemplateId()).find()){
PeriodTemplateExample periodTemplateExample1 = new PeriodTemplateExample(); PeriodTemplateExample periodTemplateExample1 = new PeriodTemplateExample();
periodTemplateExample1.createCriteria().andTemplateIdEqualTo(a.getReportTemplateId()) periodTemplateExample1.createCriteria().andTemplateIdEqualTo(Long.parseLong(dto.getReportTemplateId()))
.andPeriodEqualTo(report.getPeriod()); .andPeriodEqualTo(report.getPeriod());
Optional<PeriodTemplate> optional = periodTemplateMapper.selectByExample(periodTemplateExample1).stream().findFirst(); Optional<PeriodTemplate> optional = periodTemplateMapper.selectByExample(periodTemplateExample1).stream().findFirst();
if(optional.isPresent()){ if(optional.isPresent()){
dto.setReportName(optional.get().getName()); dto.setReportName(optional.get().getName());
} }
}
dataSourceDtoList.add(dto); dataSourceDtoList.add(dto);
}); });
} else } else
......
...@@ -127,7 +127,7 @@ public class WPSR extends FunctionBase implements FreeRefFunction { ...@@ -127,7 +127,7 @@ public class WPSR extends FunctionBase implements FreeRefFunction {
dto.setColumnName(""); dto.setColumnName("");
dto.setRowName(""); dto.setRowName("");
dto.setReportName(ec.getWorkbook().getSheetName(ec.getSheetIndex())); dto.setReportName(ec.getWorkbook().getSheetName(ec.getSheetIndex()));
dto.setType(FormulaDataSourceType.TrialBalanceSource.getCode()); dto.setType(FormulaDataSourceType.WPSRSource.getCode());
Long dataSourceId = saveDataSource(ec, Lists.newArrayList(dto), FormulaDataSourceDetailType.InputInvoiceDataSourceDto, val, formulaContext.getPeriod(), Long dataSourceId = saveDataSource(ec, Lists.newArrayList(dto), FormulaDataSourceDetailType.InputInvoiceDataSourceDto, val, formulaContext.getPeriod(),
formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId()); formulaContext.getReportTemplateGroupId(), formulaContext.getProjectId());
saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, val, dataSourceId, saveFormulaBlock(formulaContext.getPeriod(), ec, formulaExpression, val, dataSourceId,
......
...@@ -122,16 +122,16 @@ ...@@ -122,16 +122,16 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal" role="form" id="userForm"> <form class="form-horizontal" role="form" id="userForm">
<div class="form-group"> <!--<div class="form-group">-->
<label class="control-label col-sm-3" for="checkIsAdmin" translate="Admin"></label> <!--<label class="control-label col-sm-3" for="checkIsAdmin" translate="Admin"></label>-->
<div class="col-sm-9"> <!--<div class="col-sm-9">-->
<div class="checkbox"> <!--<div class="checkbox">-->
<label> <!--<label>-->
<input type="checkbox" ng-model="editUserModel.IsAdmin"> Admin <!--<input type="checkbox" ng-model="editUserModel.IsAdmin"> Admin-->
</label> <!--</label>-->
</div> <!--</div>-->
</div> <!--</div>-->
</div> <!--</div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" for="inputUserName" translate="UserName"></label> <label class="control-label col-sm-3" for="inputUserName" translate="UserName"></label>
<div class="col-sm-9"> <div class="col-sm-9">
......
...@@ -8,17 +8,17 @@ ...@@ -8,17 +8,17 @@
</div> </div>
<div class="modal-body"> <div class="modal-body">
<form class="form-horizontal" role="form" id="userForm"> <form class="form-horizontal" role="form" id="userForm">
<div class="form-group"> <!--<div class="form-group">-->
<label class="control-label col-sm-3" for="checkIsAdmin" translate="Admin"></label> <!--<label class="control-label col-sm-3" for="checkIsAdmin" translate="Admin"></label>-->
<div class="col-sm-9"> <!--<div class="col-sm-9">-->
<div class="checkbox"> <!--<div class="checkbox">-->
<label> <!--<label>-->
<input type="checkbox" ng-model="editUserModel.isAdmin"> Admin <!--<input type="checkbox" ng-model="editUserModel.isAdmin"> Admin-->
</label> <!--</label>-->
</div> <!--</div>-->
</div> <!--</div>-->
</div> <!--</div>-->
<div class="form-group"> <div class="form-group">
<label class="control-label col-sm-3" for="inputUserName"><span class="red-color">*</span><span translate="UserNameColon"></span></label> <label class="control-label col-sm-3" for="inputUserName"><span class="red-color">*</span><span translate="UserNameColon"></span></label>
<div class="col-sm-9"> <div class="col-sm-9">
......
...@@ -6,7 +6,7 @@ controller('roleMultiSelectorController', ['$scope', 'roleService', ...@@ -6,7 +6,7 @@ controller('roleMultiSelectorController', ['$scope', 'roleService',
}); });
$scope.toggleRoleSpan = function(role){ $scope.toggleRoleSpan = function(role){
if (!role.data.roleCategoryID){ if (!role.data.roleCategoryId){
return; return;
} }
if (role.isChecked){ if (role.isChecked){
......
...@@ -767,8 +767,6 @@ ...@@ -767,8 +767,6 @@
return '贷方发生'; return '贷方发生';
} else if(formula.indexOf('JFFS') > -1){ } else if(formula.indexOf('JFFS') > -1){
return '借方发生'; return '借方发生';
} else if(formula.indexOf('WPSR') > -1){
return 'WPSR';
} }
return ''; return '';
}, },
...@@ -797,6 +795,48 @@ ...@@ -797,6 +795,48 @@
alignment: 'center', alignment: 'center',
width: '30%' width: '30%'
} }
];
break;
case enums.formulaDataSourceType.WPSR:
//平衡表数据源
dataGridColumns = [
{
calculateCellValue: function(){
return $scope.projectPeriod
},
// dataField: 'projectPeriod',
caption: $translate.instant('InvoiceQJ'),
alignment: 'center',
width: '10%'
},
{
calculateCellValue: function(){
return 'WPSR';
},
// 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%'
}
]; ];
break; break;
case enums.formulaDataSourceType.InputInvoice: case enums.formulaDataSourceType.InputInvoice:
...@@ -2105,6 +2145,9 @@ ...@@ -2105,6 +2145,9 @@
case enums.formulaDataSourceType.OutputInvoice: case enums.formulaDataSourceType.OutputInvoice:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]]; $scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break; break;
case enums.formulaDataSourceType.WPSR:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break;
case enums.formulaDataSourceType.TrialBalanceSource: case enums.formulaDataSourceType.TrialBalanceSource:
$scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]]; $scope.detail.dataGridSourceBind = [$scope.detail.dataGridSource[0]];
break; break;
......
...@@ -459,7 +459,7 @@ commonModule.factory('enums', ['$translate', function ($translate) { ...@@ -459,7 +459,7 @@ commonModule.factory('enums', ['$translate', function ($translate) {
Special: 19, Special: 19,
BSPL: 20, BSPL: 20,
summary: 100 WPSR: 33
}, },
......
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