Commit a3ba953d authored by gary's avatar gary

Merge remote-tracking branch 'origin/dev_mysql' into dev_mysql

parents 5f5521a2 6433e6a3
package pwc.taxtech.atms.constant; package pwc.taxtech.atms.constant;
import java.io.File; import java.io.File;
import java.text.DecimalFormat;
import java.util.Locale;
import java.util.UUID; import java.util.UUID;
public final class Constant { public final class Constant {
...@@ -50,6 +48,7 @@ public final class Constant { ...@@ -50,6 +48,7 @@ public final class Constant {
public static final String IMAGE_FORMART_ = "png"; public static final String IMAGE_FORMART_ = "png";
public static final String EMPTY = ""; public static final String EMPTY = "";
public static final String DateTimeFormate = "%d年%d月"; public static final String DateTimeFormate = "%d年%d月";
public static final String DateTimeFormate1 = "%d-%d";
public static final String INPUT_RZJG_SUCCESS="1"; public static final String INPUT_RZJG_SUCCESS="1";
public static final String INPUT_RZJG_FAILED="2"; public static final String INPUT_RZJG_FAILED="2";
......
...@@ -14,6 +14,15 @@ public class ManualDataSourceDto { ...@@ -14,6 +14,15 @@ public class ManualDataSourceDto {
Integer period; Integer period;
Long reportId; Long reportId;
Long id; Long id;
String penValue;//穿透修改值
public String getPenValue() {
return penValue;
}
public void setPenValue(String penValue) {
this.penValue = penValue;
}
public Long getCellId() { public Long getCellId() {
return this.cellId; return this.cellId;
......
...@@ -159,7 +159,7 @@ public class TaxDocumentServiceImpl { ...@@ -159,7 +159,7 @@ public class TaxDocumentServiceImpl {
} }
//创建人 creator //创建人 creator
if (StringUtils.isNotBlank(taxDocumentDto.getCreator())) { if (StringUtils.isNotBlank(taxDocumentDto.getCreator())) {
criteria.andCreatorEqualTo(taxDocumentDto.getCreator()); criteria.andCreatorLike("%" + taxDocumentDto.getCreator() + "%");
} }
return example; return example;
} }
......
...@@ -396,6 +396,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -396,6 +396,7 @@ public class ReportServiceImpl extends BaseService {
Long cellTemplateId = distributedIdService.nextId(); Long cellTemplateId = distributedIdService.nextId();
PeriodCellTemplate cellTemplate = new PeriodCellTemplate(); PeriodCellTemplate cellTemplate = new PeriodCellTemplate();
cellTemplate.setPeriod(period); cellTemplate.setPeriod(period);
cellTemplate.setRowName(POIUtil.getCellFormulaString(cell));
cellTemplate.setProjectId(projectId); cellTemplate.setProjectId(projectId);
cellTemplate.setColumnIndex(c); cellTemplate.setColumnIndex(c);
cellTemplate.setCreateTime(now); cellTemplate.setCreateTime(now);
...@@ -407,9 +408,9 @@ public class ReportServiceImpl extends BaseService { ...@@ -407,9 +408,9 @@ public class ReportServiceImpl extends BaseService {
if (cell.getCellComment() != null) { if (cell.getCellComment() != null) {
cellTemplate.setComment(cell.getCellComment().getString().getString()); cellTemplate.setComment(cell.getCellComment().getString().getString());
} }
cellTemplate.setIsReadOnly(cell.getCellStyle().getLocked() ? 1 : 0); cellTemplate.setIsReadOnly(hasHandDatas.contains(c) ? 0 : 1);
cellTemplateList.add(cellTemplate); cellTemplateList.add(cellTemplate);
if (hasFormulaDatas.contains(c) && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) { if (r>0&&hasFormulaDatas.contains(c) && StringUtils.isNotBlank(POIUtil.getCellFormulaString(cell))) {
PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig(); PeriodCellTemplateConfig periodCellTemplateConfig = new PeriodCellTemplateConfig();
periodCellTemplateConfig.setId(distributedIdService.nextId()); periodCellTemplateConfig.setId(distributedIdService.nextId());
periodCellTemplateConfig.setPeriod(period); periodCellTemplateConfig.setPeriod(period);
...@@ -429,8 +430,8 @@ public class ReportServiceImpl extends BaseService { ...@@ -429,8 +430,8 @@ public class ReportServiceImpl extends BaseService {
fixedAccountCode(periodCellTemplateConfig); fixedAccountCode(periodCellTemplateConfig);
cellTemplateConfigList.add(periodCellTemplateConfig); cellTemplateConfigList.add(periodCellTemplateConfig);
} }
if (hasHandDatas.contains(c)) { if (r>0&&hasHandDatas.contains(c)) {
addManualConfig(template.getId(), cellTemplateId, cell, now, cellTemplateConfigList); addManualConfig(cellTemplate, cell, now, cellTemplateConfigList);
} }
} else { } else {
//查询原来行cell是否有CellTemplate //查询原来行cell是否有CellTemplate
...@@ -513,14 +514,16 @@ public class ReportServiceImpl extends BaseService { ...@@ -513,14 +514,16 @@ public class ReportServiceImpl extends BaseService {
} }
} }
private void addManualConfig(Long templateId, Long cellTemplateId, Cell cell, Date now, List<PeriodCellTemplateConfig> list) { private void addManualConfig(PeriodCellTemplate cellTemplate, Cell cell, Date now, List<PeriodCellTemplateConfig> list) {
PeriodCellTemplateConfig configManual = new PeriodCellTemplateConfig(); PeriodCellTemplateConfig configManual = new PeriodCellTemplateConfig();
configManual.setId(distributedIdService.nextId()); configManual.setId(distributedIdService.nextId());
configManual.setCellTemplateId(cellTemplateId); configManual.setCellTemplateId(cellTemplate.getCellTemplateId());
configManual.setReportTemplateId(templateId); configManual.setReportTemplateId(cellTemplate.getReportTemplateId());
configManual.setPeriod(cellTemplate.getPeriod());
configManual.setProjectId(cellTemplate.getProjectId());
configManual.setDataSourceType(CellDataSourceType.KeyIn.getCode()); configManual.setDataSourceType(CellDataSourceType.KeyIn.getCode());
configManual.setFormula(POIUtil.getCellFormulaString(cell)); configManual.setFormula(POIUtil.getCellFormulaString(cell));
// config.setFormula(cell.getCellFormula()); // configManual.setFormula(cell.getCellFormula());
configManual.setFormulaDataSource("报表数据"); //todo KV相关 configManual.setFormulaDataSource("报表数据"); //todo KV相关
configManual.setUpdateTime(now); configManual.setUpdateTime(now);
// configManual.setUpdateBy(authUserHelper.getCurrentUserId()); // configManual.setUpdateBy(authUserHelper.getCurrentUserId());
...@@ -714,42 +717,48 @@ public class ReportServiceImpl extends BaseService { ...@@ -714,42 +717,48 @@ public class ReportServiceImpl extends BaseService {
for (RevenueConfig config : dataList) { for (RevenueConfig config : dataList) {
Row row = POIUtil.createAndCloneRow(tWorkbook, sheet, 1, sourceRow); Row row = POIUtil.createAndCloneRow(tWorkbook, sheet, 1, sourceRow);
row.getCell(TaxesCalculateReportEnum.Column.Column_1.getIndex()).setCellValue("1-" + rowIndex); row.getCell(TaxesCalculateReportEnum.Column.Column_1.getIndex()).setCellValue("1-" + rowIndex);
row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue(config.getName()); row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue(config.getName());
row.getCell(TaxesCalculateReportEnum.Column.Column_2.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_3.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue("PC(\"TimeInterval\",\"\""); row.getCell(TaxesCalculateReportEnum.Column.Column_4.getIndex()).setCellValue("PC(\"FilterDate1\",2)");
//判断帐载收入明细 //判断帐载收入明细
if (0 == config.getAccountType()) {//0值 if (0 == config.getAccountType()) {//0值
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(0.00); row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(0.00);
} else if (1 == config.getAccountType()) {//科目 } else if (1 == config.getAccountType()) {//科目
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-" row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")-"
+"JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")"); + "JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"" + config.getTbSegment5() + "\",\"" + config.getTbSegment6() + "\")");
} else if(2 == config.getAccountType()){//手工输入 } else if (2 == config.getAccountType()) {//手工输入
}else{ } else {
row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_5.getIndex()).setCellValue("");
} }
row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_6.getIndex()).setCellValue("");
row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_7.getIndex()).setCellValue("");
if (1 == config.getTaxBase()) {//账载 if (1 == config.getTaxBase()) {//账载
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")");
// row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")");
// row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\"" + config.getName() + "\",\"E\")");
//838b9b6513422e029c38575f9b029b1fdd18dadb
} else if (2 == config.getTaxBase()) {//开票收入 } else if (2 == config.getTaxBase()) {//开票收入
} else if (3 == config.getTaxBase()) {//手工录入 } else if (3 == config.getTaxBase()) {//手工录入
} else if (4 == config.getTaxBase()) {//借方发生额 } else if (4 == config.getTaxBase()) {//借方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"\",\"\")"); row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("JFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",,)");
} else if (5 == config.getTaxBase()) {//贷方发生额 } else if (5 == config.getTaxBase()) {//贷方发生额
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"\",\"\")");
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",,)");
}else{ }else{
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue(""); row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("DFFS(\"" + config.getTbSegment3() + "\"," + project.getYear() + "," + period + "," + 1 + ",\"\",\"\")");
} }
row.getCell(TaxesCalculateReportEnum.Column.Column_8.getIndex()).setCellValue("WPNAME(\"VAT020\",\"C\",\"增值税进项税\",\"G\")");
row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%"); row.getCell(TaxesCalculateReportEnum.Column.Column_9.getIndex()).setCellValue(config.getTaxRate().multiply(new BigDecimal(100)).intValue() + "%");
row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue(0); // row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"E\")*"
// +"WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")");
if(rowIndex == 3){
row.getCell(TaxesCalculateReportEnum.Column.Column_10.getIndex()).setCellValue("WPNAME(\"VAT020\",\"B\",\""+config.getName()+"\",\"I\")");
}
row.getCell(TaxesCalculateReportEnum.Column.Column_11.getIndex()).setCellValue(RevenueConfEnum.RevenueType.MAPPING.get(config.getRevenueType())); row.getCell(TaxesCalculateReportEnum.Column.Column_11.getIndex()).setCellValue(RevenueConfEnum.RevenueType.MAPPING.get(config.getRevenueType()));
row.getCell(TaxesCalculateReportEnum.Column.Column_12.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType())); row.getCell(TaxesCalculateReportEnum.Column.Column_12.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType()));
row.getCell(TaxesCalculateReportEnum.Column.Column_13.getIndex()).setCellValue(RevenueConfEnum.TaxType.MAPPING.get(config.getTaxType()));
rowIndex++; rowIndex++;
} }
} }
...@@ -974,7 +983,7 @@ public class ReportServiceImpl extends BaseService { ...@@ -974,7 +983,7 @@ public class ReportServiceImpl extends BaseService {
PeriodCellDataExample cellDataExample = new PeriodCellDataExample(); PeriodCellDataExample cellDataExample = new PeriodCellDataExample();
cellDataExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andProjectIdEqualTo(projectId).andReportIdEqualTo(reportId); cellDataExample.createCriteria().andPeriodEqualTo(report.getPeriod()).andProjectIdEqualTo(projectId).andReportIdEqualTo(reportId);
List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample); List<PeriodCellData> currentCellDataList = periodCellDataMapper.selectByExample(cellDataExample); //这是取的是单元格中显示的值
PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample(); PeriodFormulaBlockExample periodFormulaBlockExample = new PeriodFormulaBlockExample();
periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(report.getPeriod()) periodFormulaBlockExample.createCriteria().andProjectIdEqualTo(projectId).andPeriodEqualTo(report.getPeriod())
.andReportIdEqualTo(reportId); .andReportIdEqualTo(reportId);
...@@ -1299,17 +1308,35 @@ public class ReportServiceImpl extends BaseService { ...@@ -1299,17 +1308,35 @@ public class ReportServiceImpl extends BaseService {
data.setCellId(cellData.getId()); data.setCellId(cellData.getId());
} else { } else {
PeriodCellData cellData = periodCellDataMapper.selectByPrimaryKey(data.getCellId()); PeriodCellData cellData = periodCellDataMapper.selectByPrimaryKey(data.getCellId());
if (StringUtils.isNotBlank(data.getKeyinData())) { /*if (StringUtils.isNotBlank(data.getKeyinData())) {
cellData.setKeyinData(data.getKeyinData()); cellData.setKeyinData(data.getKeyinData());
if (StringUtils.isEmpty(cellData.getFormulaExp())) if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getKeyinData()); cellData.setFormulaExp(data.getKeyinData());
periodCellDataMapper.updateByPrimaryKeySelective(cellData); periodCellDataMapper.updateByPrimaryKeySelective(cellData);
} else if (data.getAmount() != null && cellData.getData() != data.getAmount().toString()) { }*/ /*else if (data.getAmount() != null && cellData.getData() != data.getAmount().toString()) {
cellData.setData(data.getAmount().toString()); cellData.setData(data.getAmount().toString());
if (StringUtils.isEmpty(cellData.getFormulaExp())) if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString()); cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData); periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*//* else if (StringUtils.isNotBlank(data.getPenValue())) {//穿透调整数据
cellData.setData(data.getPenValue());
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
}*/
boolean boo1 = StringUtils.isNotBlank(data.getPenValue());//穿透合并值
boolean boo2 = StringUtils.isNotBlank(data.getKeyinData());//手工输入
if (boo1 && boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getPenValue()) + Double.parseDouble(data.getKeyinData()))));
} else if (boo1 && !boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getPenValue()))));
} else if (!boo1 && boo2) {
cellData.setData(String.valueOf((Double.parseDouble(data.getKeyinData()))));
} }
if (StringUtils.isEmpty(cellData.getFormulaExp()))
cellData.setFormulaExp(data.getAmount().toString());
periodCellDataMapper.updateByPrimaryKeySelective(cellData);
} }
......
...@@ -4,6 +4,7 @@ import com.google.common.collect.Lists; ...@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext; import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.MissingArgEval;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
...@@ -31,12 +32,18 @@ public class DFFS extends FunctionBase implements FreeRefFunction { ...@@ -31,12 +32,18 @@ public class DFFS extends FunctionBase implements FreeRefFunction {
return null; return null;
} }
String code = getStringParam(args[0], ec); String code = getStringParam(args[0], ec);//科目代码
int year = getIntParam(args[1], ec); int year = getIntParam(args[1], ec);
int period = getIntParam(args[2], ec); int period = getIntParam(args[2], ec);
int sourceDataType = getIntParam(args[3], ec);//科目代码 int sourceDataType = getIntParam(args[3], ec);//取值数据源
String segment5 = getStringParam(args[4], ec);//利润中心代码 String segment5 = null;
String segment6 = getStringParam(args[5], ec);//产品代码 if(!(args[4] instanceof MissingArgEval)){
segment5 = getStringParam(args[4], ec);//利润中心代码
}
String segment6 = null;
if(!(args[4] instanceof MissingArgEval)){
segment6 = getStringParam(args[5], ec);//产品代码
}
String formulaExpression = "DFFS(\"" + code + "\"," + year + "," + period + "," + sourceDataType + ",\"" + segment5 + "\",\"" + segment6 + "\")"; String formulaExpression = "DFFS(\"" + code + "\"," + year + "," + period + "," + sourceDataType + ",\"" + segment5 + "\",\"" + segment6 + "\")";
logger.debug(formulaExpression); logger.debug(formulaExpression);
......
...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.service.impl.report.functions; ...@@ -2,6 +2,7 @@ package pwc.taxtech.atms.vat.service.impl.report.functions;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext; import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.WorkbookEvaluator; import org.apache.poi.ss.formula.WorkbookEvaluator;
import org.apache.poi.ss.formula.eval.*; import org.apache.poi.ss.formula.eval.*;
...@@ -10,7 +11,6 @@ import org.slf4j.LoggerFactory; ...@@ -10,7 +11,6 @@ import org.slf4j.LoggerFactory;
import pwc.taxtech.atms.common.util.SpringContextUtil; import pwc.taxtech.atms.common.util.SpringContextUtil;
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.exception.Exceptions;
import pwc.taxtech.atms.vat.entity.*; import pwc.taxtech.atms.vat.entity.*;
import pwc.taxtech.atms.vat.service.impl.FormulaAgent; import pwc.taxtech.atms.vat.service.impl.FormulaAgent;
...@@ -222,20 +222,42 @@ public class FunctionBase { ...@@ -222,20 +222,42 @@ public class FunctionBase {
if (!dss.isEmpty()) return dss.get(0).getAmount(); if (!dss.isEmpty()) return dss.get(0).getAmount();
} else { } else {
String evalStr = OperandResolver.coerceValueToString(eval); String evalStr = OperandResolver.coerceValueToString(eval);
if(StringUtils.isBlank(evalStr)){
evalStr = "0";
}
LOGGER.debug("[Formula_debug] eval other cell value {}", evalStr); LOGGER.debug("[Formula_debug] eval other cell value {}", evalStr);
try { if(evalStr.endsWith("%")){
BigDecimal bigDecimal = new BigDecimal(evalStr); evalStr = evalStr.replace("%","");
if (!dss.isEmpty()) { try {
return bigDecimal.add(dss.get(0).getAmount()); BigDecimal bigDecimal = new BigDecimal(evalStr);
} else { bigDecimal.divide(new BigDecimal(100));
return bigDecimal; if (!dss.isEmpty()) {
return bigDecimal.add(dss.get(0).getAmount());
} else {
return bigDecimal;
}
} catch (Exception e) {
if (!dss.isEmpty())
return dss.get(0).getAmount();
e.printStackTrace();
}
}else{
try {
BigDecimal bigDecimal = new BigDecimal(evalStr);
if (!dss.isEmpty()) {
return bigDecimal.add(dss.get(0).getAmount());
} else {
return bigDecimal;
}
} catch (Exception e) {
if (!dss.isEmpty())
return dss.get(0).getAmount();
e.printStackTrace();
} }
} catch (Exception e) {
if (!dss.isEmpty())
return dss.get(0).getAmount();
e.printStackTrace();
} }
} }
return new BigDecimal(0); return new BigDecimal(0);
......
...@@ -4,6 +4,7 @@ import com.google.common.collect.Lists; ...@@ -4,6 +4,7 @@ import com.google.common.collect.Lists;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.formula.OperationEvaluationContext; import org.apache.poi.ss.formula.OperationEvaluationContext;
import org.apache.poi.ss.formula.eval.MissingArgEval;
import org.apache.poi.ss.formula.eval.NumberEval; import org.apache.poi.ss.formula.eval.NumberEval;
import org.apache.poi.ss.formula.eval.ValueEval; import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
...@@ -31,12 +32,19 @@ public class JFFS extends FunctionBase implements FreeRefFunction { ...@@ -31,12 +32,19 @@ public class JFFS extends FunctionBase implements FreeRefFunction {
return null; return null;
} }
String code = getStringParam(args[0], ec); String code = getStringParam(args[0], ec);//科目代码
int year = getIntParam(args[1], ec); int year = getIntParam(args[1], ec);
int period = getIntParam(args[2], ec); int period = getIntParam(args[2], ec);
int sourceDataType = getIntParam(args[3], ec);//科目代码 int sourceDataType = getIntParam(args[3], ec);//取值数据源
String segment5 = getStringParam(args[4], ec);//利润中心代码 String segment5 = null;
String segment6 = getStringParam(args[5], ec);//产品代码 if(!(args[4] instanceof MissingArgEval)){
segment5 = getStringParam(args[4], ec);//利润中心代码
}
String segment6 = null;
if(!(args[4] instanceof MissingArgEval)){
segment6 = getStringParam(args[5], ec);//产品代码
}
String formulaExpression = "JFFS(\"" + code + "\"," + year + "," + period + "," + sourceDataType + ",\"" + segment5 + "\",\"" + segment6 + "\")"; String formulaExpression = "JFFS(\"" + code + "\"," + year + "," + period + "," + sourceDataType + ",\"" + segment5 + "\",\"" + segment6 + "\")";
logger.debug(formulaExpression); logger.debug(formulaExpression);
......
...@@ -7,7 +7,6 @@ import org.apache.poi.ss.formula.eval.ValueEval; ...@@ -7,7 +7,6 @@ import org.apache.poi.ss.formula.eval.ValueEval;
import org.apache.poi.ss.formula.functions.FreeRefFunction; import org.apache.poi.ss.formula.functions.FreeRefFunction;
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.vat.entity.PeriodReport;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -40,6 +39,9 @@ public class PC extends FunctionBase implements FreeRefFunction { ...@@ -40,6 +39,9 @@ public class PC extends FunctionBase implements FreeRefFunction {
return new StringEval(String.format(Constant.DateTimeFormate, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH))); return new StringEval(String.format(Constant.DateTimeFormate, calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH)));
case "FilterDate": case "FilterDate":
return new StringEval(String.format(Constant.DateTimeFormate, formulaContext.getYear(), formulaContext.getPeriod())); return new StringEval(String.format(Constant.DateTimeFormate, formulaContext.getYear(), formulaContext.getPeriod()));
case "FilterDate1":
// String month = formulaContext.getPeriod()<10?"0"+formulaContext.getPeriod():formulaContext.getPeriod()+"";
return new StringEval(String.format(Constant.DateTimeFormate1, formulaContext.getYear(), formulaContext.getPeriod()));
case "TimeInterval": case "TimeInterval":
Date beginOfPeriod = new Date(formulaContext.getYear(), formulaContext.getIsYear() ? 1 : formulaContext.getPeriod(), 1); Date beginOfPeriod = new Date(formulaContext.getYear(), formulaContext.getIsYear() ? 1 : formulaContext.getPeriod(), 1);
calendar.setTime(beginOfPeriod); calendar.setTime(beginOfPeriod);
......
...@@ -59,7 +59,7 @@ public class WPNAME extends FunctionBase implements FreeRefFunction { ...@@ -59,7 +59,7 @@ public class WPNAME extends FunctionBase implements FreeRefFunction {
MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL); MyAsserts.assertNotEmpty(cellTemplateDataList, Exceptions.BB_CELL_TEMP_NULL);
cellTemplateData = cellTemplateDataList.get(0); cellTemplateData = cellTemplateDataList.get(0);
int index = ec.getWorkbook().getSheetIndex(bo.getReportCode()); int index = ec.getWorkbook().getSheetIndex(bo.getReportCode());
cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), "VAT020".equals(bo.getReportCode())?bo.getColumnIndex():(bo.getColumnIndex() - 1), cellValue = getCellValue(index, ec, formulaContext, agent, cellTemplateData.getRowIndex(), bo.getColumnIndex(),
Long.parseLong(cellTemplateData.getCellTemplateId())); Long.parseLong(cellTemplateData.getCellTemplateId()));
nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData); nullCellDto.extractFromGroup(bo, formulaContext.getPeriod(), formulaContext.getYear(), cellTemplateData);
nullCellDto.setAmount(cellValue); nullCellDto.setAmount(cellValue);
......
...@@ -36,7 +36,7 @@ public class CitTbam extends BaseEntity implements Serializable { ...@@ -36,7 +36,7 @@ public class CitTbam extends BaseEntity implements Serializable {
private String organizationId; private String organizationId;
private Long adjustAccount; private Long adjustAccount;
private List<OperationLogEntryLog> operationLogEntryLogList; private OperationLogEntryLog[] operationLogEntryLogList;
public Long getAdjustAccount() { public Long getAdjustAccount() {
return adjustAccount; return adjustAccount;
...@@ -46,11 +46,11 @@ public class CitTbam extends BaseEntity implements Serializable { ...@@ -46,11 +46,11 @@ public class CitTbam extends BaseEntity implements Serializable {
this.adjustAccount = adjustAccount; this.adjustAccount = adjustAccount;
} }
public List<OperationLogEntryLog> getOperationLogEntryLogList() { public OperationLogEntryLog[] getOperationLogEntryLogList() {
return operationLogEntryLogList; return operationLogEntryLogList;
} }
public void setOperationLogEntryLogList(List<OperationLogEntryLog> operationLogEntryLogList) { public void setOperationLogEntryLogList(OperationLogEntryLog[] operationLogEntryLogList) {
this.operationLogEntryLogList = operationLogEntryLogList; this.operationLogEntryLogList = operationLogEntryLogList;
} }
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
"ProjectYearCol": "年份", "ProjectYearCol": "年份",
"AssignRoleCol": "分配角色", "AssignRoleCol": "分配角色",
"SequenceNoCol": "序号", "SequenceNoCol": "序号",
"SequenceNumber":"序号",
"DocumentID": "档案ID", "DocumentID": "档案ID",
"TaxGroup":"税种", "TaxGroup":"税种",
"DocumentAttr": "档案属性", "DocumentAttr": "档案属性",
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
columns: [ columns: [
{ {
dataField: "id", dataField: "id",
caption: $translate.instant('DocumentID'), caption: $translate.instant('SequenceNumber'),
allowHeaderFiltering: true, allowHeaderFiltering: true,
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
try { try {
...@@ -241,6 +241,9 @@ ...@@ -241,6 +241,9 @@
}; };
}; };
$scope.exportEventTrigger = function(){
$(".dx-datagrid-export-button").click();
};
//弹出框 //弹出框
var openEditPop = function (rowId) { var openEditPop = function (rowId) {
if (rowId) { if (rowId) {
......
...@@ -7,6 +7,11 @@ ...@@ -7,6 +7,11 @@
line-height: 34px; line-height: 34px;
float: none; float: none;
} }
div.dx-datagrid-export-button{
display: none;
}
</style> </style>
<div class="menu-header"> <div class="menu-header">
<div class="menu-title" translate="DocumentTypeSets"></div> <div class="menu-title" translate="DocumentTypeSets"></div>
...@@ -17,13 +22,14 @@ ...@@ -17,13 +22,14 @@
</div> </div>
<div class="content-container"> <div class="content-container">
<div class="row" style="margin-top:15px; text-align:right;padding:1rem;background: #fff"> <div class="row" style="margin-top:15px; text-align:right;padding:1rem;background: #fff">
<button style="width: 150px;" class="btn btn-in-panel-big" ng-click="exportEventTrigger()">
<i class="fa fa-file-excel-o"></i>
{{'ExportTable' | translate}}
</button>
<button style="width: 150px;" class="btn btn-in-panel-big" ng-click="openEditPop()"> <button style="width: 150px;" class="btn btn-in-panel-big" ng-click="openEditPop()">
<i class="material-icons button-icons">add_circle_outline</i> <i class="material-icons button-icons">add_circle_outline</i>
{{'addFileType' | translate}} {{'addFileType' | translate}}
</button><!----><!--ng-disabled="!hasAddPermission"--> </button>
<!--<button class="btn btn-export">
导出档案类型
</button>-->
</div> </div>
<div style="padding:0 1rem;background:#fff"> <div style="padding:0 1rem;background:#fff">
<div class="dx-viewport demo-container"> <div class="dx-viewport demo-container">
...@@ -42,14 +48,15 @@ ...@@ -42,14 +48,15 @@
<div class="modal-dialog" style="width:550px;height:200px;" role="document"> <div class="modal-dialog" style="width:550px;height:200px;" role="document">
<div class="modal-content"> <div class="modal-content">
<form class="form-horizontal" name="newDocFileTypeForm" ng-submit="confirmDocFileType()"> <form class="form-horizontal" name="newDocFileTypeForm" ng-submit="confirmDocFileType()">
<div class="modal-header"> <div class="modal-header">
<div class="modal-title"><span translate="createDocFileType"></span></div> <div class="modal-title"><span translate="CreateDocFileType"></span></div>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<!--序号--> <!--序号-->
<div class="form-group" hidden> <div class="form-group" hidden>
<label for="SequenceNoCol" class="col-sm-3 control-label" translate="SequenceNoCol"></label> <label for="SequenceNoCol" class="col-sm-3 control-label" translate="SequenceNumber"></label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input class="form-control" <input class="form-control"
id="SequenceNoCol" id="SequenceNoCol"
...@@ -93,17 +100,16 @@ ...@@ -93,17 +100,16 @@
<!--<span style="color:red"> * <span translate="Require"></span> </span>--> <!--<span style="color:red"> * <span translate="Require"></span> </span>-->
<!--</div>--> <!--</div>-->
</div> </div>
<!--说明--> <!--描述-->
<div class="form-group"> <div class="form-group">
<label for="Description" class="col-sm-3 control-label"> <label for="Description" class="col-sm-3 control-label">
<span style="color:red"> * </span>
<span translate="DescriptionWithOutColon"></span> <span translate="DescriptionWithOutColon"></span>
</label> </label>
<div class="col-sm-11" style="width:61.67%"> <div class="col-sm-11" style="width:61.67%">
<input class="form-control" id="Description" <input class="form-control" id="Description"
ng-model="editModel.description" ng-model="editModel.description"
placeholder="请输入..." placeholder="请输入..."
required style="width:320px;" maxlength="50" /> style="width:320px;" maxlength="50" />
</div> </div>
</div> </div>
<!--必填字段--> <!--必填字段-->
...@@ -131,7 +137,7 @@ ...@@ -131,7 +137,7 @@
<input class="form-control" id="Remarks" <input class="form-control" id="Remarks"
ng-model="editModel.remarks" ng-model="editModel.remarks"
placeholder="请输入..." placeholder="请输入..."
required style="width:320px;" maxlength="50" /> style="width:320px;" maxlength="50" />
</div> </div>
</div> </div>
<!--状态--> <!--状态-->
...@@ -145,8 +151,8 @@ ...@@ -145,8 +151,8 @@
<label class="col-sm-5 DM-state-label"> <label class="col-sm-5 DM-state-label">
<input type="radio" name="editModelState" <input type="radio" name="editModelState"
value=1 value=1
ng-checked="editModel.status == 1" ng-checked="editModel.status == 1 || editModel.status == null || editModel.status == undefined"
ng-model="editModel.status" required /> ng-model="editModel.status"/>
<span translate="Enable"></span> <span translate="Enable"></span>
</label> </label>
<label class="col-sm-5 DM-state-label"> <label class="col-sm-5 DM-state-label">
......
...@@ -1212,6 +1212,7 @@ ...@@ -1212,6 +1212,7 @@
// 更新spreadjs计算所需datasource信息 // 更新spreadjs计算所需datasource信息
$scope.updateCellByManualChange = function (manualData) { $scope.updateCellByManualChange = function (manualData) {
debugger;
var cellData = _.find($scope.reportData, function (x) { var cellData = _.find($scope.reportData, function (x) {
return x.cellTemplateID == manualData.cellTemplateId return x.cellTemplateID == manualData.cellTemplateId
|| x.cellID === manualData.cellId; || x.cellID === manualData.cellId;
...@@ -1551,36 +1552,48 @@ ...@@ -1551,36 +1552,48 @@
//单元格详细信息点击确定时执行 //单元格详细信息点击确定时执行
$scope.confirm = function () { $scope.confirm = function () {
if (vatSessionService.month) if (vatSessionService.month)
vatSessionService.project.period = vatSessionService.month; vatSessionService.project.period = vatSessionService.month;
vatApproveService.approvalStatus(vatSessionService.project.id, vatSessionService.project.period).success(function (result) { vatApproveService.approvalStatus(vatSessionService.project.id, vatSessionService.project.period).success(function (result) {
$scope.handInputModel.name = $scope.taxCellDetail.inputMemo;
$scope.handInputModel.description = $scope.taxCellDetail.inputMemo;
$scope.handInputModel.projectID = vatSessionService.project.id;
$scope.handInputModel.serviceTypeID = vatSessionService.project.serviceTypeID;
$scope.handInputModel.period = vatSessionService.month;
//日志对象
logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date();
logDto.UpdateTime = new Date();
logDto.OperationContent = "Amount: " + $scope.handInputModel.amount
+ "; Description: " + $scope.handInputModel.description + "keyinData:" + $scope.handInputModel.keyinData;
logDto.OperationName = $translate.instant('ManualInputDataSource');
logDto.Comment = comment + "(Cell ID:" + $scope.handInputModel.cellID
+ ", Cell Template ID:" + $scope.handInputModel.cellTemplateID + ")";
logDto.OperationType = enums.vatLogOperationTypeEnum.RV_ManualInput;
if (result && result == 'committed') { if (result && result == 'committed') {
SweetAlert.error('报表提审中!'); SweetAlert.error('报表提审中!');
} else { }/*else if(($scope.taxCellDetail.penValue != undefined && $scope.taxCellDetail.penValue != null) && $scope.taxCellDetail.keyinData){//手工输入和穿透合并值都存在
$scope.handInputModel.name = $scope.taxCellDetail.inputMemo; $scope.handInputModel.penValue = $scope.taxCellDetail.penValue;//
var r = /^(-[1-9]\d*|[1-9]\d*|[0]{1,1})$/; $scope.handInputModel.keyinData = $scope.taxCellDetail.keyinData;
return vatReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) {
var obj = manualData.data.data;
obj.dataSourceType = manualData.dataSourceType;
$scope.updateCellByManualChange(obj);
return $q.when();
});
return $q.reject();
}*/ else {
/* var r = /^(-[1-9]\d*|[1-9]\d*|[0]{1,1})$/;*/
if ($scope.taxCellDetail.keyinData) { if ($scope.taxCellDetail.keyinData) {
$scope.handInputModel.keyinData = $scope.taxCellDetail.keyinData; $scope.handInputModel.keyinData = $scope.taxCellDetail.keyinData;
} else { } else {
$scope.handInputModel.amount = $scope.taxCellDetail.inputValue; $scope.handInputModel.amount = $scope.taxCellDetail.inputValue;
} }
$scope.handInputModel.description = $scope.taxCellDetail.inputMemo; if($scope.taxCellDetail.penValue != undefined && $scope.taxCellDetail.penValue != null){
$scope.handInputModel.projectID = vatSessionService.project.id; $scope.handInputModel.penValue = $scope.taxCellDetail.penValue;
$scope.handInputModel.serviceTypeID = vatSessionService.project.serviceTypeID; }
$scope.handInputModel.period = vatSessionService.month; if ($scope.handInputModel.amount || $scope.handInputModel.name || $scope.handInputModel.keyinData || $scope.handInputModel.penValue ) {
if ($scope.handInputModel.amount || $scope.handInputModel.name || $scope.handInputModel.keyinData) {
//日志对象
logDto.ID = PWC.newGuid();
logDto.CreateTime = new Date();
logDto.UpdateTime = new Date();
logDto.OperationContent = "Amount: " + $scope.handInputModel.amount
+ "; Description: " + $scope.handInputModel.description + "keyinData:" + $scope.handInputModel.keyinData;
logDto.OperationName = $translate.instant('ManualInputDataSource');
logDto.Comment = comment + "(Cell ID:" + $scope.handInputModel.cellID
+ ", Cell Template ID:" + $scope.handInputModel.cellTemplateID + ")";
logDto.OperationType = enums.vatLogOperationTypeEnum.RV_ManualInput;
// 前端保存数据 // 前端保存数据
return vatReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) { return vatReportService.addCellManualData($scope.handInputModel, logDto).then(function (manualData) {
var obj = manualData.data.data; var obj = manualData.data.data;
...@@ -2072,7 +2085,6 @@ ...@@ -2072,7 +2085,6 @@
$scope.closeModal = function () { $scope.closeModal = function () {
$scope.modalInstance.dismiss('cancel'); $scope.modalInstance.dismiss('cancel');
}; };
setApproveValue(operationTypeId); setApproveValue(operationTypeId);
} }
...@@ -2294,6 +2306,7 @@ ...@@ -2294,6 +2306,7 @@
} }
var modelFillBackFunc = $scope.$on("ModelWriteBackHasChanged", function (event, data) { var modelFillBackFunc = $scope.$on("ModelWriteBackHasChanged", function (event, data) {
var dataSource = { var dataSource = {
id: data.dataSourceId, id: data.dataSourceId,
name: 'ModelBackFill', name: 'ModelBackFill',
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
QMYETotalend: "" QMYETotalend: ""
} }
} }
var _logIndex =0;
if($scope.relObj.logs == undefined || $scope.relObj.logs.length == 0){ if($scope.relObj.logs == undefined || $scope.relObj.logs.length == 0){
$scope.relObj.logs = []; $scope.relObj.logs = [];
} }
...@@ -51,14 +52,17 @@ ...@@ -51,14 +52,17 @@
$log.debug($scope.selectedItems);*/ $log.debug($scope.selectedItems);*/
$scope.doCalcute(selectedItems.selectedRowsData); $scope.doCalcute(selectedItems.selectedRowsData);
var _in = {};
if(selectedItems.currentDeselectedRowKeys.length == 0){ if(selectedItems.currentDeselectedRowKeys.length == 0){
selectedItems.currentSelectedRowKeys[0].operate = '增' _in.operate = "增";
$scope.relObj.logs.push(selectedItems.currentSelectedRowKeys[0]); _in.accountingDate = selectedItems.currentSelectedRowKeys[0];
_in.voucherNum = selectedItems.currentSelectedRowKeys[0];
}else{ }else{
selectedItems.currentDeselectedRowKeys[0].operate = '减'; _in.operate = "减";
$scope.relObj.logs.push(selectedItems.currentDeselectedRowKeys[0]); _in.accountingDate = selectedItems.currentDeselectedRowKeys[0];
_in.voucherNum = selectedItems.currentDeselectedRowKeys[0];
} }
$scope.relObj.logs.push(_in);
}, },
allowColumnResizing: true, allowColumnResizing: true,
hoverStateEnabled: true, hoverStateEnabled: true,
......
<div> <div>
<div class="modal fade" id="entryLogModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="z-index: 1100"> <div class="modal fade" id="entryLogModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" style="z-index: 1100">
<div class="modal-dialog modal-lg" style="width: 1200px;"> <div class="modal-dialog modal-lg" style="width: 1200px;">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
......
citModule.controller('citTaxReportCellDetailModalController', ['$log', 'apiInterceptor', 'Upload', '$scope', '$q', '$translate', '$uibModal', '$document', '$rootScope', 'SweetAlert', 'enums', citModule.controller('citTaxReportCellDetailModalController', ['$log', 'apiInterceptor', 'Upload', '$scope', '$q', '$translate', '$uibModal', '$document', '$rootScope', 'SweetAlert', 'enums',
'vatReportService', 'loginContext', 'vatSessionService', 'stdAccountService', 'vatCommonService', 'formulaService', 'KeyValueConfigService', 'modelConfigurationService', '$timeout', 'cellCommentService', 'modifiedReportCellService', 'commonWebService', 'dxDataGridService', 'vatReportService', 'loginContext', 'vatSessionService', 'stdAccountService', 'vatCommonService', 'formulaService', 'KeyValueConfigService', 'modelConfigurationService', '$timeout', 'cellCommentService', 'modifiedReportCellService', 'commonWebService', 'dxDataGridService', 'commonWebService',
function ($log, apiInterceptor, Upload, $scope, $q, $translate, $uibModal, $document, $rootScope, SweetAlert, enums, vatReportService, loginContext, function ($log, apiInterceptor, Upload, $scope, $q, $translate, $uibModal, $document, $rootScope, SweetAlert, enums, vatReportService, loginContext,
vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService, commonWebService, dxDataGridService) { vatSessionService, stdAccountService, vatCommonService, formulaService, KeyValueConfigService, modelConfigurationService, $timeout, cellCommentService, modifiedReportCellService, commonWebService, dxDataGridService, commonWebService) {
var activeClass = 'active'; var activeClass = 'active';
$scope.currentUserName = loginContext.userName; $scope.currentUserName = loginContext.userName;
...@@ -578,7 +578,6 @@ ...@@ -578,7 +578,6 @@
$scope.selectedTabIndex != enums.formulaDataSourceType.Special) { $scope.selectedTabIndex != enums.formulaDataSourceType.Special) {
$("#dataGridFooterSummary").show(); $("#dataGridFooterSummary").show();
$scope.dataGridHeight = 165; $scope.dataGridHeight = 165;
} else { } else {
$("#dataGridFooterSummary").hide(); $("#dataGridFooterSummary").hide();
$scope.dataGridHeight = 195; $scope.dataGridHeight = 195;
...@@ -1549,28 +1548,28 @@ ...@@ -1549,28 +1548,28 @@
//重新计算合计值 //重新计算合计值
var calculateSum = function (n) { var calculateSum = function (n) {
var precition = 2;
var evalVal = _.reduce($scope.detail.dataGridSourceBind, function (memo, x) { var evalVal = _.reduce($scope.detail.dataGridSourceBind, function (memo, x) {
if (x.accountCode == $scope.relObj.account) { if ((x.accountCode == $scope.relObj.account) && x.accountCode != undefined && $scope.relObj.account != undefined) {
memo + n; memo + n;
} else { } else {
return memo + x.endBalance; return memo + x.endingBalance;
} }
}, 0); }, 0);
$("#dataGridFooterSummary").html($translate.instant('Conclusion') $("#dataGridFooterSummary").html($translate.instant('Conclusion')
+ '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(precition)); + '&nbsp;&nbsp;&nbsp;&nbsp;' + evalVal.formatAmount(evalVal, true));
$scope.detail.penValue = evalVal.formatAmount(evalVal, true);
} }
$scope.showLog = function () {//显示日志 $scope.showLog = function () {//显示日志
alert('调用了');
//在点击日志前 科目代码下是否有日志 //在点击日志前 科目代码下是否有日志
cellCommentService.selectEntryLog(entryLogIdByCode).success(function(res){ cellCommentService.selectEntryLog($scope.detail.entryLogIdByCode).success(function (res) {
if(res.data){ if (res.data) {
$scope.relObj.logs = res.data; $scope.relObj.logs = commonWebService._index(res.data.concat($scope.relObj.logs));
$('#entryLogModal').modal('show');
} }
}).error(); }).error(function (error) {
$('#entryLogModal').modal('show'); alert("日志信息获取失败");
});
} }
//显示分录信息 同时加载数据 //显示分录信息 同时加载数据
...@@ -1580,14 +1579,18 @@ ...@@ -1580,14 +1579,18 @@
cellCommentService.loadEntryListDataList(e.data.accountCode).success(function (res) { cellCommentService.loadEntryListDataList(e.data.accountCode).success(function (res) {
$scope.relObj.account = e.data.accountCode; $scope.relObj.account = e.data.accountCode;
if (res.resultMsg == "success") { if (res.resultMsg == "success") {
$scope.relObj.entryDataSource = commonWebService._index(res.data) $scope.relObj.entryDataSource = commonWebService._index(res.data);
} }
$('#entryListModal').modal('show') $('#entryListModal').modal('show');
}).error(function (error) { }).error(function (error) {
alert(error); alert(error);
}); });
} }
//-------------------------------------------------------------------- end --------------------------------------------------------------
//设置数据源表格的列 //设置数据源表格的列
var getAllDataGridColumns = function () { var getAllDataGridColumns = function () {
var dataGridColumns; var dataGridColumns;
...@@ -1742,9 +1745,6 @@ ...@@ -1742,9 +1745,6 @@
} }
return dataGridColumns; return dataGridColumns;
}; };
//-------------------------------------------------------------------- end --------------------------------------------------------------
//添加数据源(发票|凭证)数据过滤 //添加数据源(发票|凭证)数据过滤
var allDataFilter = function (config, data) { var allDataFilter = function (config, data) {
var dataGridColumns; var dataGridColumns;
...@@ -2228,6 +2228,7 @@ ...@@ -2228,6 +2228,7 @@
} }
$scope.$watch('detail.dataGridSource', function (newVal, oldValue) { $scope.$watch('detail.dataGridSource', 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;
...@@ -2278,8 +2279,10 @@ ...@@ -2278,8 +2279,10 @@
}); });
var getBlowGridData = function (data) { var getBlowGridData = function (data) {
cellCommentService.getCellInformation(data).success(function (res) { cellCommentService.getCellInformation(data).success(function (res) {
debugger;
if (res.resultMsg) { if (res.resultMsg) {
$scope.detail.dataGridSourceBind = [res.data[0]]; $scope.detail.dataGridSourceBind = res.data;
calculateSum(null);
} }
}).error(function (error) { }).error(function (error) {
}); });
......
...@@ -302,9 +302,8 @@ ...@@ -302,9 +302,8 @@
<!--分录弹框--> <!--分录弹框-->
<entry-list-modal id ="entryListId" rel-obj = "relObj" ></entry-list-modal> <entry-list-modal id ="entryListId" rel-obj = "relObj" show-log = "showLog()" ></entry-list-modal>
<entry-log id ="entryLogId" rel-obj = "relObj" show-log = "showLog" ></entry-log> <entry-log id ="entryLogId" rel-obj = "relObj" ></entry-log>
</div> </div>
<div class="tax-report-cell-detail" id="addSourceContainer"></div> <div class="tax-report-cell-detail" id="addSourceContainer"></div>
......
...@@ -50,7 +50,10 @@ ...@@ -50,7 +50,10 @@
} }
if (!Number.prototype.formatAmount) { if (!Number.prototype.formatAmount) {
Number.prototype.formatAmount = function (decPlaces) { Number.prototype.formatAmount = function (decPlaces, type) {
if(type){
return Number(decPlaces.toString().match(/^\d+(?:\.\d{0,2})?/));
}
decPlaces = isNaN(decPlaces = Math.abs(decPlaces)) ? 2 : decPlaces; decPlaces = isNaN(decPlaces = Math.abs(decPlaces)) ? 2 : decPlaces;
var n = this.toFixed(decPlaces); var n = this.toFixed(decPlaces);
if (decPlaces) { if (decPlaces) {
......
...@@ -111,7 +111,8 @@ ...@@ -111,7 +111,8 @@
title="{{selected}}" title="{{selected}}"
readonly readonly
ng-model="selected"> ng-model="selected">
<button type="button" class="input-arrow-drop-button"> <button type="button" class="input-arrow-drop-button"
ng-click="showMenu()">
</button> </button>
<button type="button" class="input-reset-button" <button type="button" class="input-reset-button"
ng-click="clearInput()" ng-click="clearInput()"
......
...@@ -92,17 +92,10 @@ taxDocumentManageModule.controller('taxDocumentListController', ...@@ -92,17 +92,10 @@ taxDocumentManageModule.controller('taxDocumentListController',
dataField: "id", dataField: "id",
caption: "", caption: "",
cellTemplate: function (container, options) { cellTemplate: function (container, options) {
// var targetString = '<input name="dataGridCheckBox" ng-click="sniffCheckbox()"' + var target = $('<input name="dataGridCheckBox" type="checkbox" ' +
// 'data-id="'+options.data.id+'" ' + 'data-id="' + options.data.id + '" ' +
// 'data-url="'+options.data.filePositionUrl+'" ' + 'data-url="' + options.data.filePositionUrl + '"/>');
// 'type="checkbox">'; target.off('click').on('click', function () {
// var eventTarget = $(targetString);
// $compile(eventTarget)($scope);
// container.append(eventTarget);
var target = $('<input name="dataGridCheckBox" type="checkbox" '+
'data-id="'+options.data.id+'" '+
'data-url="'+options.data.filePositionUrl+'"/>');
target.off('click').on('click',function(){
$scope.sniffCheckbox(); $scope.sniffCheckbox();
}); });
container.append(target); container.append(target);
...@@ -1127,6 +1120,16 @@ taxDocumentManageModule.directive('helpPop', function () { ...@@ -1127,6 +1120,16 @@ taxDocumentManageModule.directive('helpPop', function () {
$("#helpPopDialog").modal("show"); $("#helpPopDialog").modal("show");
}) })
}; };
$scope.sniffHelpPopRadio = function(){
$("input[name='helpPopRadio']").each(function (index,item) {
if(item.checked){
$scope.editFieldModel.fileAttr = item.getAttribute("data-fileAttr");
$scope.editFieldModel.fileType = item.getAttribute("data-fileType");
$scope.syncRequiredFields($scope.editFieldModel);
}
});
};
$scope.help_dataGridUpdate = function (_data) { $scope.help_dataGridUpdate = function (_data) {
$scope.help_cacheData = _data.items; $scope.help_cacheData = _data.items;
$scope.help_dataGridOptions = { $scope.help_dataGridOptions = {
...@@ -1151,6 +1154,21 @@ taxDocumentManageModule.directive('helpPop', function () { ...@@ -1151,6 +1154,21 @@ taxDocumentManageModule.directive('helpPop', function () {
columnAutoWidth: true, columnAutoWidth: true,
allowColumnReordering: true, allowColumnReordering: true,
columns: [ columns: [
{
dataField: "",
caption: "",
cellTemplate: function (container, options) {
var target = $('<input name="helpPopRadio" type="radio" ' +
'data-id="helpPop_' + options.data.id + '" ' +
'data-fileAttr="' + options.data.fileAttr + '" ' +
'data-fileType="' + options.data.fileType +
'" />');
container.append(target);
// target.parents("tr").off('click').on('click', function () {
// $scope.sniffHelpPopRadio(options.data.id);
// });
}
},
{ {
dataField: "fileAttr", dataField: "fileAttr",
caption: $translate.instant('DocumentAttr'), caption: $translate.instant('DocumentAttr'),
......
...@@ -922,10 +922,10 @@ ...@@ -922,10 +922,10 @@
</select> </select>
</div> </div>
<div class="DTL-special-external-btn" title="查看类型列表"> <!--<div class="DTL-special-external-btn" title="查看类型列表">
<a href="javascript:void(0)" ng-click="openHelpPop()"><i <a href="javascript:void(0)" ng-click="openHelpPop()"><i
class="fa fake-question-circle" aria-hidden="true"></i></a> class="fa fake-question-circle" aria-hidden="true"></i></a>
</div> </div>-->
</div> </div>
<div class="col-sm-6 form-group"> <div class="col-sm-6 form-group">
<label class="col-sm-3 control-label"> <label class="col-sm-3 control-label">
...@@ -1151,6 +1151,11 @@ ...@@ -1151,6 +1151,11 @@
<div class="dx-viewport demo-container" id="helpPopContainer"> <div class="dx-viewport demo-container" id="helpPopContainer">
</div> </div>
</div> </div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" ng-click="sniffHelpPopRadio()"></button>
<button type="button" class="btn btn-third" data-dismiss="modal" ng-click="cancelDocFileType()"
translate="Cancel"></button>
</div>
</div> </div>
</div> </div>
</div> </div>
......
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