Commit 0267b2fb authored by ken-y's avatar ken-y

add 截止本期科目余额表 预览导出---Ken

parent 44bda2bb
......@@ -18,4 +18,10 @@ public final class ExportTemplatePathConstant {
public static final String BALANCE_SHEET_PRC_MANUAL="/vat_excel_template/balance_sheet_prc_manual.xlsx";
public static final String CASH_FLOW_MANUAL = "/vat_excel_template/cash_flow_manual.xlsx";
/**
* 截止本期科目余额表动态模板,只有路劲
* trial_balance_period_i
*/
public static final String TRIAL_BALANCE_PERIOD = "/vat_excel_template/tb_period/trial_balance_period_";
}
......@@ -32,6 +32,12 @@ public class DataPreviewController extends BaseController {
return dataPreviewSerivceImpl.getTBDataForDisplay(param);
}
@PostMapping("getTBEndPeriodDataForDisplay")
public PageInfo<TrialBalanceDto> getTBEndPeriodDataForDisplay(@RequestBody TrialBalanceParam param) {
logger.debug(String.format("截至本期科目余额查询 Condition:%s", JSON.toJSONString(param)));
return dataPreviewSerivceImpl.getTBEndPeriodDataForDisplay(param);
}
@PostMapping("getPLDataForDisplay")
public PageInfo<ProfitLossStatementDto> getPLDataForDisplay(@RequestBody ProfitLossStatementParam param) {
logger.debug(String.format("利润表PRC查询 Condition:%s", JSON.toJSONString(param)));
......@@ -149,6 +155,13 @@ public class DataPreviewController extends BaseController {
dataPreviewSerivceImpl.exportBalanceSheetPrcManualList(response, param, fileName);
}
@RequestMapping(value = "exportTBEndPeriodData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadTBEndPeriodQueryData(@RequestBody TrialBalanceParam param, HttpServletResponse response) {
logger.debug("enter downloadTBEndPeriodQueryData");
String fileName="testFile";
dataPreviewSerivceImpl.exportTBEndPeriodList(response, param, fileName);
}
@RequestMapping(value = "exportTBData/get", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void downloadTBQueryData(@RequestBody TrialBalanceParam paras, HttpServletResponse response) {
response.setContentType("application/vnd.ms-excel;charset=utf-8");
......
......@@ -6,6 +6,7 @@ import pwc.taxtech.atms.common.util.PwCIdSerialize;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.Map;
/**
*
......@@ -127,6 +128,134 @@ public class TrialBalanceDto implements Serializable {
private Date updateTime;
private BigDecimal monthBalance1;
private BigDecimal monthBalance2;
private BigDecimal monthBalance3;
private BigDecimal monthBalance4;
private BigDecimal monthBalance5;
private BigDecimal monthBalance6;
private BigDecimal monthBalance7;
private BigDecimal monthBalance8;
private BigDecimal monthBalance9;
private BigDecimal monthBalance10;
private BigDecimal monthBalance11;
private BigDecimal monthBalance12;
private BigDecimal monthBalance13;
private Map<Integer,BigDecimal> periodMap;
public Map<Integer, BigDecimal> getPeriodMap() {
return periodMap;
}
public void setPeriodMap(Map<Integer, BigDecimal> periodMap) {
this.periodMap = periodMap;
}
public BigDecimal getMonthBalance1() {
return monthBalance1;
}
public void setMonthBalance1(BigDecimal monthBalance1) {
this.monthBalance1 = monthBalance1;
}
public BigDecimal getMonthBalance2() {
return monthBalance2;
}
public void setMonthBalance2(BigDecimal monthBalance2) {
this.monthBalance2 = monthBalance2;
}
public BigDecimal getMonthBalance3() {
return monthBalance3;
}
public void setMonthBalance3(BigDecimal monthBalance3) {
this.monthBalance3 = monthBalance3;
}
public BigDecimal getMonthBalance4() {
return monthBalance4;
}
public void setMonthBalance4(BigDecimal monthBalance4) {
this.monthBalance4 = monthBalance4;
}
public BigDecimal getMonthBalance5() {
return monthBalance5;
}
public void setMonthBalance5(BigDecimal monthBalance5) {
this.monthBalance5 = monthBalance5;
}
public BigDecimal getMonthBalance6() {
return monthBalance6;
}
public void setMonthBalance6(BigDecimal monthBalance6) {
this.monthBalance6 = monthBalance6;
}
public BigDecimal getMonthBalance7() {
return monthBalance7;
}
public void setMonthBalance7(BigDecimal monthBalance7) {
this.monthBalance7 = monthBalance7;
}
public BigDecimal getMonthBalance8() {
return monthBalance8;
}
public void setMonthBalance8(BigDecimal monthBalance8) {
this.monthBalance8 = monthBalance8;
}
public BigDecimal getMonthBalance9() {
return monthBalance9;
}
public void setMonthBalance9(BigDecimal monthBalance9) {
this.monthBalance9 = monthBalance9;
}
public BigDecimal getMonthBalance10() {
return monthBalance10;
}
public void setMonthBalance10(BigDecimal monthBalance10) {
this.monthBalance10 = monthBalance10;
}
public BigDecimal getMonthBalance11() {
return monthBalance11;
}
public void setMonthBalance11(BigDecimal monthBalance11) {
this.monthBalance11 = monthBalance11;
}
public BigDecimal getMonthBalance12() {
return monthBalance12;
}
public void setMonthBalance12(BigDecimal monthBalance12) {
this.monthBalance12 = monthBalance12;
}
public BigDecimal getMonthBalance13() {
return monthBalance13;
}
public void setMonthBalance13(BigDecimal monthBalance13) {
this.monthBalance13 = monthBalance13;
}
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table trial_balance
......
package pwc.taxtech.atms.dto.vatdto.excelheader;
public class TrialBalanceHeader {
private String companyNameCn ;
private Integer periodStart;
private Integer periodEnd;
//账套名称
private String ledgerName;
//账套币种
private String ledgerCurrencyCode;
private Integer periodYear;
public Integer getPeriodYear() {
return periodYear;
}
public void setPeriodYear(Integer periodYear) {
this.periodYear = periodYear;
}
public String getCompanyNameCn() {
return companyNameCn;
}
public void setCompanyNameCn(String companyNameCn) {
this.companyNameCn = companyNameCn;
}
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public String getLedgerName() {
return ledgerName;
}
public void setLedgerName(String ledgerName) {
this.ledgerName = ledgerName;
}
public String getLedgerCurrencyCode() {
return ledgerCurrencyCode;
}
public void setLedgerCurrencyCode(String ledgerCurrencyCode) {
this.ledgerCurrencyCode = ledgerCurrencyCode;
}
}
......@@ -15,6 +15,7 @@ import pwc.taxtech.atms.dto.vatdto.dd.*;
import pwc.taxtech.atms.dto.vatdto.excelheader.CashFlowHeader;
import pwc.taxtech.atms.dto.vatdto.excelheader.CertifiedInvoicesListHeader;
import pwc.taxtech.atms.dto.vatdto.excelheader.ProfitLossHeader;
import pwc.taxtech.atms.dto.vatdto.excelheader.TrialBalanceHeader;
import pwc.taxtech.atms.entity.Organization;
import pwc.taxtech.atms.exception.ServiceException;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
......@@ -26,11 +27,10 @@ import pwc.taxtech.atms.vat.entity.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.stream.Collectors;
/**
* @Auther: Gary J Li
......@@ -120,6 +120,150 @@ public class DataPreviewSerivceImpl extends BaseService {
return pageInfo;
}
/**
* 截至本期科目余额表
* @param param
* @return
*/
public PageInfo<TrialBalanceDto> getTBEndPeriodDataForDisplay(TrialBalanceParam param) {
TrialBalanceCondition condition = beanUtil.copyProperties(param, new TrialBalanceCondition());
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<TrialBalance> trialBalances = trialBalanceMapper.selectByConditionGroupTen(condition);
List<TrialBalanceDto> tbEndPeriodConditionDate=getTBEndPeriodConditionDate(trialBalances,condition);
PageInfo<TrialBalanceDto> pageInfo = new PageInfo<>(tbEndPeriodConditionDate);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
return pageInfo;
}
public HttpServletResponse exportTBEndPeriodList(HttpServletResponse response, TrialBalanceParam param, String fileName) {
logger.debug("start export TBEndPeriod list to excel");
TrialBalanceCondition condition = beanUtil.copyProperties(param, new TrialBalanceCondition());
//根据条件选择对应月份模板
Integer month=condition.getPeriodEnd()%100;
String excelTemplatePathInClassPath = ExportTemplatePathConstant.TRIAL_BALANCE_PERIOD+month+".xlsx";
List<TrialBalance> trialBalances = trialBalanceMapper.selectByConditionGroupTen(condition);
List<TrialBalanceDto> tbEndPeriodConditionDate=getTBEndPeriodConditionDate(trialBalances,condition);
TrialBalanceHeader header = new TrialBalanceHeader();
if (tbEndPeriodConditionDate.size() > 0) {
Organization org = organizationMapper.selectByPrimaryKey(param.getOrgId());
header.setCompanyNameCn(org.getName());
header.setPeriodEnd(param.getPeriodEnd());
header.setLedgerName(tbEndPeriodConditionDate.get(0).getLedgerName());
header.setLedgerCurrencyCode(tbEndPeriodConditionDate.get(0).getCurrencyCode());
header.setPeriodYear(condition.getPeriodEnd()/100);
}
OutputStream outputStream = commonDocumentHelper.toXlsxFileUsingJxls(header, tbEndPeriodConditionDate, excelTemplatePathInClassPath);
try {
return responseMessageBuilder.getDownloadTmpResponseMessage(response, outputStream, fileName);
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
}
return null;
}
/**
* 根据条件获取截止本期科目余额表,公共方法用于导出
* @param trialBalances
* @param condition
* @return
*/
private List<TrialBalanceDto> getTBEndPeriodConditionDate(List<TrialBalance> trialBalances,TrialBalanceCondition condition) {
List<TrialBalanceDto> trialBalanceDtos = Lists.newArrayList();
//查询单组数据封装
for(TrialBalance item:trialBalances){
condition.setSegment1(item.getSegment1());
condition.setSegment2(item.getSegment2());
condition.setSegment3(item.getSegment3());
condition.setSegment4(item.getSegment4());
condition.setSegment5(item.getSegment5());
condition.setSegment6(item.getSegment6());
condition.setSegment7(item.getSegment7());
condition.setSegment8(item.getSegment8());
condition.setSegment9(item.getSegment9());
condition.setSegment10(item.getSegment10());
//按时间倒序查询
List<TrialBalance> trialBalances1 = trialBalanceMapper.selectByGroupCondition(condition);
TrialBalanceDto trialBalanceDto = new TrialBalanceDto();
beanUtil.copyProperties(trialBalances1.get(0), trialBalanceDto);
//搜集不同月份信息
Map<Integer,BigDecimal> map=new HashMap<>();
for(TrialBalance a:trialBalances1){
//判断key期间是否存在
if(map.containsKey(a.getPeriod())){
//获取已存在value
BigDecimal bigOrg=(BigDecimal)Optional.ofNullable(map.get(a.getPeriod())).orElse(BigDecimal.ZERO);
map.put(a.getPeriod(),(a.getPeriodDrBeq().subtract(a.getPeriodCrBeq())).add(bigOrg));
}else{
map.put(a.getPeriod(),a.getPeriodDrBeq().subtract(a.getPeriodCrBeq()));
}
}
trialBalanceDto.setPeriodMap(map);
//通过反射动态给月份赋值
setMonthBalance(map,trialBalanceDto);
//设置年初年末余额
setBegEndBeq(trialBalances1,trialBalanceDto);
trialBalanceDtos.add(trialBalanceDto);
}
return trialBalanceDtos;
}
/**
* 设置年初年末余额
* @param list
* @param dto
* @return
*/
private TrialBalanceDto setBegEndBeq(List<TrialBalance> list,TrialBalanceDto dto){
if(list.size()>0){
//重新排序时间升序
list=list.stream()
.sorted(Comparator.comparing(TrialBalance::getUpdateTime))
.collect(Collectors.toList());
//年初余额—— 使用period等于YYYY-01的beg_bal_beq(*是本位币本期期初余额),
// 即卡片期间的所在年的的1月的本位币本期期初余额
dto.setBegBalBeq(list.get(0).getBegBalBeq());
//年底余额—— 使用period等于YYYY-MM(页面选择的期间)的end_bal_beq(*是本位币本期期末余额),
// 即卡片期间的所在年的页面选择期间月的本位币本期期末余额
dto.setEndBalBeq(list.get(list.size()-1).getEndBalBeq());
}
return dto;
}
/**
* 通过反射动态给月份赋值
* @param map
* @param trialBalanceDto
* @return
*/
private TrialBalanceDto setMonthBalance(Map<Integer,BigDecimal> map,TrialBalanceDto trialBalanceDto){
logger.debug("map : {}",map.toString());
for(Map.Entry<Integer,BigDecimal> entry:map.entrySet()){
//求余取月份
Integer month=entry.getKey()%100;
//根据反射动态设置属性值
String filedName="monthBalance"+month;
try {
Field name=trialBalanceDto.getClass().getDeclaredField(filedName);
name.setAccessible(true);
name.set(trialBalanceDto,entry.getValue());
name.setAccessible(false);
} catch (Exception e) {
e.printStackTrace();
}
}
return trialBalanceDto;
}
/**
* 查询利润表PRC
* @param param
......@@ -173,14 +317,6 @@ public class DataPreviewSerivceImpl extends BaseService {
Page page = PageHelper.startPage(condition.getPageInfo().getPageIndex(), condition.getPageInfo().getPageSize());
List<ProfitLossStatementPrc> profitLossStatements = profitLossStatementPrcManualMapper.selectByCondition1(condition);
//List<ProfitLossStatementPrcManualDto> profitLossDtos = Lists.newArrayList();
// profitLossStatements.forEach(pl -> {
// ProfitLossStatementPrcManualDto profitLossDto = new ProfitLossStatementPrcManualDto();
// beanUtil.copyProperties(pl, profitLossDto);
// profitLossDtos.add(profitLossDto);
// });
PageInfo<ProfitLossStatementPrc> pageInfo =new PageInfo<>(profitLossStatements);
pageInfo.setTotal(page.getTotal());
pageInfo.setPageNum(param.getPageInfo().getPageIndex());
......@@ -256,7 +392,6 @@ public class DataPreviewSerivceImpl extends BaseService {
String excelTemplatePathInClassPath = ExportTemplatePathConstant.CASH_FLOW;
CashFlowCondition condition = new CashFlowCondition();
beanUtil.copyProperties(param, condition);
PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
List<CashFlow> cashFlows = cashFlowMapper.selectByCondition(condition);
List<CashFlowDto> cashFlowDtos = Lists.newArrayList();
cashFlows.forEach(cf -> {
......@@ -292,7 +427,6 @@ public class DataPreviewSerivceImpl extends BaseService {
String excelTemplatePathInClassPath = ExportTemplatePathConstant.CASH_FLOW_MANUAL;
CashFlowCondition condition = new CashFlowCondition();
beanUtil.copyProperties(param, condition);
PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
List<CashFlow> cashFlows = cashFlowManualMapper.selectByCondition(condition);
List<CashFlowDto> cashFlowDtos = Lists.newArrayList();
cashFlows.forEach(cf -> {
......@@ -327,7 +461,6 @@ public class DataPreviewSerivceImpl extends BaseService {
String excelTemplatePathInClassPath = ExportTemplatePathConstant.ADJUSTMENT_TABLE;
AdjustmentTableCondition condition = new AdjustmentTableCondition();
beanUtil.copyProperties(param, condition);
PageHelper.startPage(param.getPageInfo().getPageIndex(), param.getPageInfo().getPageSize());
List<AdjustmentTable> adjustmentTables = adjustmentTableMapper.selectByCondition(condition);
List<AdjustmentTableDto> adjustmentTableDtos = Lists.newArrayList();
adjustmentTables.forEach(a -> {
......
......@@ -110,4 +110,18 @@ public interface TrialBalanceMapper extends MyVatMapper {
List<TrialBalance> selectByCondition(@Param("tbCondition") TrialBalanceCondition condition);
/**
* 根据segment1-segment10十个字段为唯一组建分组
* @param condition
* @return
*/
List<TrialBalance> selectByConditionGroupTen(@Param("tbCondition") TrialBalanceCondition condition);
/**
* 单组查询
* @param condition
* @return
*/
List<TrialBalance> selectByGroupCondition(@Param("tbCondition") TrialBalanceCondition condition);
}
\ No newline at end of file
......@@ -30,6 +30,61 @@ public class TrialBalanceCondition {
private Boolean containsAdjustmentTable;
private String segment1;
private String segment4;
private String segment7;
private String segment8;
private String segment9;
private String segment10;
public String getSegment1() {
return segment1;
}
public void setSegment1(String segment1) {
this.segment1 = segment1;
}
public String getSegment4() {
return segment4;
}
public void setSegment4(String segment4) {
this.segment4 = segment4;
}
public String getSegment7() {
return segment7;
}
public void setSegment7(String segment7) {
this.segment7 = segment7;
}
public String getSegment8() {
return segment8;
}
public void setSegment8(String segment8) {
this.segment8 = segment8;
}
public String getSegment9() {
return segment9;
}
public void setSegment9(String segment9) {
this.segment9 = segment9;
}
public String getSegment10() {
return segment10;
}
public void setSegment10(String segment10) {
this.segment10 = segment10;
}
public String getSegment5() {
return segment5;
}
......
......@@ -57,4 +57,111 @@
<include refid="QueryCondition"/>
</select>
<sql id="QueryConditionTen">
1 = 1
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.orgId)">
AND organization_id= #{tbCondition.orgId,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment3)">
AND segment3= #{tbCondition.segment3,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment3Name)">
AND segment3_name= #{tbCondition.segment3Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment5)">
AND segment5= #{tbCondition.segment5,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment5Name)">
AND segment5_name= #{tbCondition.segment5Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment6)">
AND segment6= #{tbCondition.segment6,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment6Name)">
AND segment6_name= #{tbCondition.segment6Name,jdbcType=VARCHAR}
</if>
<if test="tbCondition.periodStart!=null">
AND period &gt;= #{tbCondition.periodStart,jdbcType=INTEGER}
</if>
<if test="tbCondition.periodEnd!=null">
AND period &lt;= #{tbCondition.periodEnd,jdbcType=INTEGER}
</if>
group by segment1,segment2,segment3,segment4,segment5,segment6,segment7,segment8,segment9,segment10
order by update_time1 desc
</sql>
<select id="selectByConditionGroupTen" parameterType="pwc.taxtech.atms.vat.dpo.TrialBalanceCondition" resultMap="BaseResultMap">
SELECT
segment1,segment2,segment3,segment4,segment5,segment6,segment7,segment8,segment9,segment10,
MAX(update_time) as update_time1
FROM
trial_balance tb
WHERE
<include refid="QueryConditionTen"/>
</select>
<sql id="QueryGroupCondition">
1 = 1
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.orgId)">
AND organization_id= #{tbCondition.orgId,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment3)">
AND segment3= #{tbCondition.segment3,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment3Name)">
AND segment3_name= #{tbCondition.segment3Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment5)">
AND segment5= #{tbCondition.segment5,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment5Name)">
AND segment5_name= #{tbCondition.segment5Name,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment6)">
AND segment6= #{tbCondition.segment6,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment6Name)">
AND segment6_name= #{tbCondition.segment6Name,jdbcType=VARCHAR}
</if>
<if test="tbCondition.periodStart!=null">
AND period &gt;= #{tbCondition.periodStart,jdbcType=INTEGER}
</if>
<if test="tbCondition.periodEnd!=null">
AND period &lt;= #{tbCondition.periodEnd,jdbcType=INTEGER}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment1)">
AND segment1= #{tbCondition.segment1,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment2)">
AND segment2= #{tbCondition.segment2,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment4)">
AND segment4= #{tbCondition.segment4,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment7)">
AND segment7= #{tbCondition.segment7,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment8)">
AND segment8= #{tbCondition.segment8,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment9)">
AND segment9= #{tbCondition.segment9,jdbcType=VARCHAR}
</if>
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(tbCondition.segment10)">
AND segment10= #{tbCondition.segment10,jdbcType=VARCHAR}
</if>
order by update_time desc
</sql>
<select id="selectByGroupCondition" parameterType="pwc.taxtech.atms.vat.dpo.TrialBalanceCondition" resultMap="BaseResultMap">
SELECT
tb.*
FROM
trial_balance tb
WHERE
<include refid="QueryGroupCondition"/>
</select>
</mapper>
\ No newline at end of file
......@@ -936,6 +936,24 @@ var vatModule = angular.module('app.vat', ['ui.grid', 'ui.grid.selection', 'ui.g
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.trialBalanceEndPeriod',
url: '/trialBalanceEndPeriod',
views: {
'@vat.previewData': {
controller: ['$scope', '$stateParams', 'appTranslation',
function ($scope, $stateParams, appTranslation) {
appTranslation.load([appTranslation.vat]);
}],
template: '<vat-preview-trial-balance-end-period></vat-preview-trial-balance-end-period>'
}
},
resolve: scriptDependencyProvider.createDependenciesMap(scriptDependencyProvider.vat),
deepStateRedirect: true,
sticky: true
});
$stateProvider.state({
name: 'vat.previewData.cashFlow',
url: '/cashFlow',
......
......@@ -1795,6 +1795,7 @@
"otherItem3": "Other Item3",
"otherItem3Amount": "Other Item3 Amount",
"trialBalance": "Trial balance",
"trialBalanceEndPeriod": "Trial balance end period",
"TrialBalanceDDTitle": "Trial balance",
"BegBalBeq": "Beg bal beq",
"EndBalBeq": "End bal beq",
......
......@@ -1850,6 +1850,7 @@
"wronglyDistributedExpenseOrCostsDesc": "业务招待费和广告及宣传费未列支在正确的科目下",
"trialBalance": "科目余额表",
"trialBalanceEndPeriod": "截止本期科目余额表",
"TrialBalanceDDTitle": "科目余额表",
"cashFlow":"现金流量表",
"CashFlowDDTitle":"现金流量表",
......
......@@ -510,6 +510,9 @@ constant.vatPermission = {
},
profitTable: {
queryCode: '02.002.024'
},
trialBalanceEndPeriod: {
queryCode: '02.002.025'
}
},
dataManage: {
......
......@@ -186,6 +186,18 @@
initExportTBData: function (queryParams) {
return $http.post('/dataPreview/exportTBData/get', queryParams, apiConfig.create({ responseType: 'arraybuffer' }));
},
getTBEndPeriodDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getTBEndPeriodDataForDisplay', queryParams, apiConfig.createVat());
},
//服务器导出
initExportTBEndPeriodData: function (queryParm, fileName) {
var thisConfig = apiConfig.create();
thisConfig.responseType = "arraybuffer";
return $http.post('/dataPreview/exportTBEndPeriodData/get', queryParm, thisConfig).then(function (response) {
var data = new Blob([response.data], {type: response.headers('Content-Type')});
FileSaver.saveAs(data,fileName + '_'+queryParm.periodEnd+'_'+vatSessionService.project.name+'.xlsx');
});
},
getCFDataForDisplay: function (queryParams) {
return $http.post('/dataPreview/getCFDataForDisplay', queryParams, apiConfig.createVat());
},
......
......@@ -23,6 +23,10 @@
name: 'trialBalance', permission: constant.vatPermission.dataPreview.trialBalance.queryCode,
text: $translate.instant('trialBalance'), icon: 'fa fa-file-text-o', show: true
},
{
name: 'trialBalanceEndPeriod', permission: constant.vatPermission.dataPreview.trialBalanceEndPeriod.queryCode,
text: $translate.instant('trialBalanceEndPeriod'), icon: 'fa fa-file-text-o', show: true
},
{
name: 'profitLoss', permission: constant.vatPermission.dataPreview.profitLoss.queryCode,
text: $translate.instant('profitLossPRC'), icon: 'fa fa-file-text-o', show: true
......
<div class="popover">
<div class="arrow"></div>
<div class="popover-content">
<div>
<table class="table table-responsive">
<tr>
<td>
<span translate="TBAccountCode"></span>
<input class="form-control input-width-middle" type="text" id="segment3" ng-model="queryParams.segment3" />
</td>
</tr>
<tr>
<td>
<span translate="AccountName"></span>
<input class="form-control input-width-middle" type="text" id="segment3Name" ng-model="queryParams.segment3Name" />
</td>
</tr>
<tr>
<td>
<span translate="ProfitCenter"></span>
<input class="form-control input-width-middle" type="text" id="segment5" ng-model="queryParams.segment5" />
</td>
</tr>
<tr>
<td>
<span translate="ProfitCenterDescription"></span>
<input class="form-control input-width-middle" type="text" id="segment5Name" ng-model="queryParams.segment5Name" />
</td>
</tr>
<tr>
<td>
<span translate="ProductCode"></span>
<input class="form-control input-width-middle" type="text" id="segment6" ng-model="queryParams.segment6" />
</td>
</tr>
<tr>
<td>
<span translate="TBProductName"></span>
<input class="form-control input-width-middle" type="text" id="segment6Name" ng-model="queryParams.segment6Name" />
</td>
</tr>
</table>
</div>
<div class="row">
<div style="float:right;margin-right:10px;">
<button class="btn btn-default btn-primary" ng-click="doDataFilter('')">
<span class="fa fa-chevron-down" aria-hidden="true"> </span> <span translate="Confirm"></span>
</button>
<button class="btn btn-default margin-right10" ng-click="doDataFilterReset()">
<span class="fa fa-times" aria-hidden="true"> </span> <span translate="Reset"></span>
</button>
</div>
</div>
</div>
</div>
vatModule.controller('VatPreviewTrialBalanceEndPeriodController', ['$rootScope','$scope','$filter','$log', '$translate', '$timeout', 'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatPreviewService', 'browserService', 'vatSessionService', 'region', 'enums', 'vatExportService',
function ($rootScope,$scope,$filter, $log,$translate, $timeout, SweetAlert, $q, uiGridConstants, $interval, vatPreviewService, browserService, vatSessionService, region, enums, vatExportService) {
'use strict';
$scope.startDate = new Date(vatSessionService.project.year, 0, 1);
$scope.endDate = new Date(vatSessionService.project.year, 11, 31);
$scope.dateFormat = $translate.instant('dateFormat4YearMonthDay');
//所有启始月份为当年一月
$scope.startMonth =vatSessionService.year * 100 + 1;
$scope.endMonth = vatSessionService.year * 100 + vatSessionService.month;
$scope.monthEnd=vatSessionService.month;
$scope.totalMoneyAmount = 0;
$scope.totalTaxAmount = 0;
$scope.pageSize = constant.vatPagesize;
var minDate = [1, vatSessionService.project.year];
// var minDate = moment().startOf('month').subtract(0, 'months');
var maxDate = [12, vatSessionService.project.year];
var setDate = [
[vatSessionService.month, vatSessionService.project.year],
[vatSessionService.month, vatSessionService.project.year]];
$scope.monthList = [1,2,3,4,5,6,7,8,9,10,11,12,13];
//初始化期间
var initPeriods = function () {
var curMonth = new Date().getMonth() + 1;
$scope.queryParams = {
pageInfo: {},
periodStart: '',
periodEnd: '',
orgId: '',
segment3 : null,
segment3Name : null,
segment5 : null,
segment5Name : null,
segment6 : null,
segment6Name : null,
};
};
//从数据库中load数据
var loadTrialBalanceDataFromDB = function (pageIndex) {
initTrialBalancePagination();
$scope.curTrialBalancePage = pageIndex;
//初始化查询信息
$scope.queryParams.pageInfo = {
totalCount: $scope.queryTrialBalanceResult.pageInfo.totalCount,
pageIndex: pageIndex,
pageSize: $scope.queryTrialBalanceResult.pageInfo.pageSize,
totalPage: 0
};
$scope.queryParams.orgId = vatSessionService.project.organizationID;
$scope.getDataFromDatabase($scope.queryParams);
};
$scope.getDataFromDatabase = function (queryParams){
vatPreviewService.getTBEndPeriodDataForDisplay(queryParams).success(function (data) {
if (data) {
var index = 1;
data.list.forEach(function (v) {
v.index = index++;
});
$scope.gridOptions.data = data.list;
$scope.queryTrialBalanceResult.pageInfo = data;
computeTrialBalancePage();
$scope.ledgerName = data.list[0].ledgerName;
$scope.currencyCode = data.list[0].currencyCode;
$scope.status = data.list[0].status;
$scope.importDate = $filter('date')(data.list[0].createTime, "yyyy-MM-dd HH:mm:ss");
}
});
};
//点击任意一页加载数据事件
var loadIncomeInvoiceDataByPage = function (pageIndex) {
loadTrialBalanceDataFromDB(pageIndex);
};
//计算页数,创建分页栏
var computeTrialBalancePage = function () {
if ($scope.queryTrialBalanceResult.pageInfo && $scope.queryTrialBalanceResult.pageInfo.total > 0) {
var totalPage = parseInt($scope.queryTrialBalanceResult.pageInfo.total / $scope.pageSize);
totalPage = $scope.queryTrialBalanceResult.pageInfo.totalCount % $scope.pageSize == 0 ? totalPage : totalPage + 1;
//计算本页记录数
if ($scope.queryTrialBalanceResult.pageInfo.pageNum === totalPage) {
$scope.curPageItemCount = $scope.queryTrialBalanceResult.pageInfo.total % $scope.pageSize;
}
else {
$scope.curPageItemCount = $scope.pageSize;
}
$scope.queryTrialBalanceResult.pageInfo.totalPage = totalPage;
var createPage = $("#totalInvoicePage").createPage({
pageCount: totalPage,
current: $scope.curTrialBalancePage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
} else {
//如果查询结果为0,则直接设置本页记录数为0
$scope.curPageItemCount = 0;
var createPage = $("#totalInvoicePage").createPage({
pageCount: 0,
current: $scope.curTrialBalancePage,
backFn: function (p) {
//单击回调方法,p是当前页码
loadIncomeInvoiceDataByPage(p);
}
});
$('#totalInvoicePage').css('display', 'inline-block');
}
};
//初始化分页信息
var initTrialBalancePagination = function () {
$scope.queryTrialBalanceResult = {
list: [],
pageInfo: {
totalCount: -1,
pageIndex: 1,
pageSize: constant.pagesize,
totalPage: 0
}
};
$scope.curTrialBalancePage = 1;
};
//将选择了的查询条件显示在grid上方
var doDataFilter = function (removeData) {
if ($scope.queryParams.periodStart > $scope.queryParams.periodEnd) {
$scope.queryParams.periodEnd = $scope.queryParams.periodStart;
}
//设置需要去掉的查询条件的值为空
if (!PWC.isNullOrEmpty(removeData)) {
var removeItem = removeData.split("|");
removeItem.forEach(function (v) {
$scope.queryParams[v] = null;
if ($scope.queryParams.segment3 === null) {
$scope.queryParams.segment3 = '';
}
if ($scope.queryParams.segment3Name === null) {
$scope.queryParams.segment3Name = '';
}
if ($scope.queryParams.segment5 === null) {
$scope.queryParams.segment5 = '';
}
if ($scope.queryParams.segment5Name === null) {
$scope.queryParams.segment5Name = '';
}
if ($scope.queryParams.segment6 === null) {
$scope.queryParams.segment6 = '';
}
if ($scope.queryParams.segment6Name === null) {
$scope.queryParams.segment6Name = '';
}
});
}
loadTrialBalanceDataFromDB(1);
$('.filter-button').popover("hide");
};
//去掉所有的查询条件,重新load数据
var doDataFilterReset = function () {
$scope.queryParams = {
pageInfo: {},
orgId:'',
segment3 : null,
segment3Name : null,
segment5 : null,
segment5Name : null,
segment6 : null,
segment6Name : null,
};
$scope.queryParams.periodStart = $scope.startMonth;
$scope.queryParams.periodEnd = $scope.endMonth;
$scope.queryParams.orgId = vatSessionService.project.organizationID;
// loadTrialBalanceDataFromDB(1);
// $('.filter-button').popover("hide");
};
//在popover打开时执行事件
var showPopover = function () {
$timeout(function () {
initDatePickers();
}, 500);
};
//初始化时间控件
var initDatePickers = function () {
//认证开始时间
var ele1 = $("#certificationDateStart");
ele1.datepicker({
startDate: $scope.startDate,
endDate: $scope.endDate,
language: region,
autoclose: true,//选中之后自动隐藏日期选择框
clearBtn: true,//清除按钮
todayBtn: false,//今日按钮
format: $scope.dateFormat//日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
});
ele1.datepicker("setDate", $scope.queryParams.certificationDateStart);
//认证结束时间
var ele2 = $("#certificationDateEnd");
ele2.datepicker({
startDate: $scope.startDate,
endDate: $scope.endDate,
language: region,
autoclose: true,//选中之后自动隐藏日期选择框
clearBtn: true,//清除按钮
todayBtn: false,//今日按钮
format: $scope.dateFormat//日期格式,详见 http://bootstrap-datepicker.readthedocs.org/en/release/options.html#format
});
ele2.datepicker("setDate", $scope.queryParams.certificationDateEnd);
};
var downloadTB = function () {
var fileName="截止本期科目余额表";
vatPreviewService.initExportTBEndPeriodData($scope.queryParams,fileName).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
}
}).error(function () {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
};
$scope.changeMonth = function () {
console.log($scope.monthEnd);
$scope.queryParams.periodEnd = vatSessionService.year * 100 + $scope.monthEnd;
$scope.endMonth=$scope.queryParams.periodEnd;
initGridOptions();
loadTrialBalanceDataFromDB(1);
}
var columnDefsExtend = function() {
$scope.gridColumns1=[];
$scope.gridColumns1= [
{ name: $translate.instant('AccountCategory'), width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.accountCategory}}<span></div>' },
{ name: $translate.instant('PrimarySubjectCode'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.acctCode1}}<span></div>' },
{ name: $translate.instant('FirstAccountDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.acctName1}}</span></div>' },
{ name: $translate.instant('SecondarySubjectDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.acctName2}}</span></div>' },
{ name: $translate.instant('ThirdAccountDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.acctName3}}</span></div>' },
{ name: $translate.instant('MainBody'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fplx}}">{{row.entity.segment1}}</span></div>' },
{ name: $translate.instant('CostCenter'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.segment2}}</span></div>' },
{ name: $translate.instant('Subject'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.segment3}}</span></div>' },
{ name: $translate.instant('AuxiliarySubject'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment4}}</span></div>' },
{ name: $translate.instant('ProfitCenter'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment5}}</span></div>' },
{ name: $translate.instant('Product'),width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment6}}</span></div>' },
{ name: $translate.instant('ProjectNameCol'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment7}}</span></div>' },
{ name: $translate.instant('TBInterCompany'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment8}}</span></div>' },
{ name: $translate.instant('Alternate1'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment9}}</span></div>' },
{ name: $translate.instant('Alternate2'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment10}}</span></div>' },
{ name: $translate.instant('MainBodyDescription'), width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment1Name}}</span></div>' },
{ name: $translate.instant('CostCenterDescription'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment2Name}}</span></div>' },
{ name: $translate.instant('SubjectDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment3Name}}</span></div>' },
{ name: $translate.instant('AuxiliaryAccountDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment4Name}}</span></div>' },
{ name: $translate.instant('ProfitCenterDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment5Name}}</span></div>' },
{ name: $translate.instant('ProductManual'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment6Name}}</span></div>' },
{ name: $translate.instant('ProjectInstruction'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment7Name}}</span></div>' },
{ name: $translate.instant('InterCompanyDescription'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment8Name}}</span></div>' },
{ name: $translate.instant('Alternate1Description'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment9Name}}</span></div>' },
{ name: $translate.instant('Alternate2Description'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment10Name}}</span></div>' },
{
name: $translate.instant('BegBal'),
headerCellClass:'rightHeader',
width: 160,
cellTemplate: '<div class="ui-grid-cell-contents" style="text-align: right"><span>{{row.entity.begBalBeq | number:2}}</span></div>'
}];
for(var i=$scope.startMonth;i<=$scope.endMonth;i++){
var field1='monthBalance'+(i%100);
$scope.gridColumns1.push(
{
name: i.toString(),
headerCellClass:'rightHeader',
width: 160,
cellTemplate: '<div class="ui-grid-cell-contents" style="text-align: right"><span>{{row.entity.'+field1+' | number:2}}</span></div>'
}
)
};
$scope.gridColumns1.push(
{
name: $translate.instant('EndingBalance'),
headerCellClass:'rightHeader',
width: 160,
cellTemplate: '<div class="ui-grid-cell-contents" style="text-align: right"><span>{{row.entity.endBalBeq | number:2}}</span></div>'
}
);
};
function initGridOptions () {
columnDefsExtend();
$scope.gridOptions = {
rowHeight: constant.UIGrid.rowHeight,
selectionRowHeaderWidth: constant.UIGrid.rowHeight,
virtualizationThreshold: 50,//默认加载50条数据,避免在数据展示时,只显示前面4条
enableSorting: false,
enableColumnMenus: false,
enableHorizontalScrollbar : 1,
columnDefs: $scope.gridColumns1,
};
}
(function initialize() {
$log.debug('VatPreviewInputInvoiceController.ctor()...');
initGridOptions();
// $scope.gridOptions = {
// rowHeight: constant.UIGrid.rowHeight,
// selectionRowHeaderWidth: constant.UIGrid.rowHeight,
// virtualizationThreshold: 50,//默认加载50条数据,避免在数据展示时,只显示前面4条
// enableSorting: false,
// enableColumnMenus: false,
// enableHorizontalScrollbar : 1,
// columnDefs: $scope.gridColumns1,
// [
// { name: $translate.instant('AccountCategory'), width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.accountCategory}}<span></div>' },
// { name: $translate.instant('PrimarySubjectCode'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.acctCode1}}<span></div>' },
// { name: $translate.instant('FirstAccountDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.acctName1}}</span></div>' },
// { name: $translate.instant('SecondarySubjectDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.acctName2}}</span></div>' },
// { name: $translate.instant('ThirdAccountDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.acctName3}}</span></div>' },
// { name: $translate.instant('MainBody'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span title="{{row.entity.fplx}}">{{row.entity.segment1}}</span></div>' },
// { name: $translate.instant('CostCenter'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.segment2}}</span></div>' },
// { name: $translate.instant('Subject'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span >{{row.entity.segment3}}</span></div>' },
// { name: $translate.instant('AuxiliarySubject'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment4}}</span></div>' },
// { name: $translate.instant('ProfitCenter'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment5}}</span></div>' },
// { name: $translate.instant('Product'),width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment6}}</span></div>' },
// { name: $translate.instant('ProjectNameCol'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment7}}</span></div>' },
// { name: $translate.instant('TBInterCompany'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment8}}</span></div>' },
// { name: $translate.instant('Alternate1'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment9}}</span></div>' },
// { name: $translate.instant('Alternate2'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment10}}</span></div>' },
// { name: $translate.instant('MainBodyDescription'), width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment1Name}}</span></div>' },
// { name: $translate.instant('CostCenterDescription'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment2Name}}</span></div>' },
// { name: $translate.instant('SubjectDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment3Name}}</span></div>' },
// { name: $translate.instant('AuxiliaryAccountDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment4Name}}</span></div>' },
// { name: $translate.instant('ProfitCenterDescription'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment5Name}}</span></div>' },
// { name: $translate.instant('ProductManual'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment6Name}}</span></div>' },
// { name: $translate.instant('ProjectInstruction'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment7Name}}</span></div>' },
// { name: $translate.instant('InterCompanyDescription'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment8Name}}</span></div>' },
// { name: $translate.instant('Alternate1Description'),width: 200, cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment9Name}}</span></div>' },
// { name: $translate.instant('Alternate2Description'), width: 200,cellTemplate: '<div class="ui-grid-cell-contents"><span>{{row.entity.segment10Name}}</span></div>' },
// {
// name: $translate.instant('BegBal'),
// headerCellClass:'rightHeader',
// width: 160,
// cellTemplate: '<div class="ui-grid-cell-contents" style="text-align: right"><span>{{row.entity.begBalBeq | number:2}}</span></div>'
// },
// periodExtend(row.entity),
// {
// name: $translate.instant('DebitAmount'),
// headerCellClass:'rightHeader',
// width: 160,
// cellTemplate: '<div class="ui-grid-cell-contents" style="text-align: right"><span>{{row.entity.periodDrBeq | number:2}}</span></div>'
// },
// {
// name: $translate.instant('CreditAmount'),
// headerCellClass:'rightHeader',
// width: 160,
// cellTemplate: '<div class="ui-grid-cell-contents" style="text-align: right"><span>{{row.entity.periodCrBeq | number:2}}</span></div>'
// },
// {
// name: $translate.instant('EndingBalance'),
// headerCellClass:'rightHeader',
// width: 160,
// cellTemplate: '<div class="ui-grid-cell-contents" style="text-align: right"><span>{{row.entity.endBalBeq | number:2}}</span></div>'
// }
// ]
// };
$scope.doDataFilter = doDataFilter;
$scope.doDataFilterReset = doDataFilterReset;
$scope.downloadTB = downloadTB;
initPeriods();
initTrialBalancePagination();
//初始化查询条件-期间范围
$scope.queryParams.periodStart = vatSessionService.year * 100 + 1;
$scope.queryParams.periodEnd = vatSessionService.year * 100 + vatSessionService.month;
$scope.queryParams.orgId = vatSessionService.project.organizationID;
loadTrialBalanceDataFromDB(1);
})();
}
]);
<div class="vat-preview-trial-balance-end-period" id="mainPreviewDiv">
<div class="top-area-wrapper" style="margin-top: 10px">
<button class="filter-button"
atms-popover ng-mouseenter="prepareSummary()" ng-click="showPopover()"
popover-container="body" popover-auto-hide="true" data-overwrite="true"
use-optimized-placement-algorithm="true"
data-placement="bottom"
data-templateurl="/app/vat/preview/vat-preview-trial-balance-end-period/vat-preview-trial-balance-end-period-search.html">
<i class="fa fa-filter" aria-hidden="true"></i>
</button>
<span translate="trialBalanceEndPeriod" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<span class="dropdown">
<select class="form-control"
ng-change='changeMonth()'
ng-model="monthEnd"
ng-options="x for x in monthList" required
style="position: relative; top: -30px; left: 230px;width: 70px;">
</select>
</span>
<span ng-click="downloadTB()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<div style="margin-bottom: 8px;margin-left: 30px">
{{'EnterpriseAccountSetName' | translate}}<span class="numAmount">{{ledgerName}}</span>&nbsp;&nbsp;&nbsp;
{{'EnterpriseAccountSetCurrency' | translate}}<span class="numAmount">{{currencyCode}}</span>&nbsp;&nbsp;&nbsp;
{{'IsCloseAccount' | translate}}<span class="numAmount">{{status?(status=='C'?'是':'否'):status}}</span>
{{'ImportTime' | translate}}<span class="numAmount">{{importDate| date:'yyyy-MM-dd hh:mm:ss'}}</span>
</div>
<div id="filterCriteriaDiv" style="max-width:98%;margin-bottom:2px;" ng-show="criteriaList.length>0">
<span class="text-bold margin-left20" translate="FilterCriteriaTags"></span>:
<span class="tag label label-default" ng-repeat="criteria in criteriaListFirstRow">
<span title="{{criteria.fullName}}">
{{criteria.name}}
</span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white" ng-click="doDataFilter(criteria.propertyName)"></i></a>
</span>
<span ng-if="criteriaList.length>6"><br /></span>
<span ng-if="criteriaList.length>6" style="margin-left: 81px; margin-top: 19px; display: inline-block;"></span>
<span ng-if="criteriaList.length>6" class="tag label label-default" ng-repeat="criteria in criteriaListSecondRow">
<span title="{{criteria.fullName}}">
{{criteria.name}}
</span>
<a><i class="remove glyphicon glyphicon-remove-sign glyphicon-white" ng-click="doDataFilter(criteria.propertyName)"></i></a>
</span>
</div>
<div id="mainAreaDiv" class="main-area">
<div class="inputInvoiceGrid" ui-grid="gridOptions">
<div class="watermark" ng-show="!gridOptions.data.length"><span translate="NoDataAvailable"></span></div>
</div>
<div class="pagination-container">
<span>本页{{curPageItemCount}}条记录,共{{queryTrialBalanceResult.pageInfo.total}}条记录</span>
<div id="totalInvoicePage" class="common-pagination" style="display:none;">
</div>
</div>
</div>
</div>
vatModule.directive('vatPreviewTrialBalanceEndPeriod', ['$log', 'browserService', '$translate', 'region', '$timeout',
function ($log, browserService, $translate, region, $timeout) {
$log.debug('vatPreviewTrialBalanceEndPeriod.ctor()...');
return {
restrict: 'E',
templateUrl: '/app/vat/preview/vat-preview-trial-balance-end-period/vat-preview-trial-balance-end-period.html' + '?_=' + Math.random(),
scope: {},
controller: 'VatPreviewTrialBalanceEndPeriodController',
link: function ($scope, element) {
}
}
}
]);
\ No newline at end of file
@import "~/app-resources/less/theme.less";
.vat-preview-trial-balance-end-period {
background-color: white;
height: 100%;
.numAmount {
padding: 0 3px;
height: 21px;
margin-left: 5px;
/* font-family: 'Arial'; */
font-weight: 600;
border-radius: 2px;
font-style: normal;
outline: none;
border: none;
min-width: 20px;
background-color: #DDDDDD;
color: #AA0000;
}
.top-area-wrapper {
height: 60px;
width: 98%;
margin: 0 20px;
.filter-button {
width: 30px;
margin-top: 16px;
}
.operation-wrapper {
margin: 15px 25px 10px 10px;
span {
cursor: pointer;
}
}
}
.filter-popup-wrapper {
display: none;
}
.margin-left20 {
margin-left: 20px;
}
/*******************************************/
/*Filter Criteria tags:*/
.tag {
font-size: 12px;
padding: .3em .4em .4em;
margin: 0 .1em;
a {
color: #bbb;
cursor: pointer;
opacity: 0.6;
margin: 0 0 0 .3em;
&:hover {
opacity: 1.0;
}
.glyphicon-white {
color: #fff;
margin-bottom: 2px;
}
}
.remove {
vertical-align: bottom;
top: 0;
}
}
/*Filter Criteria tags:*/
/*******************************************/
.main-area {
height: 100%;
margin: 0 20px;
.watermark {
position: absolute;
top: 50%;
transform: translateY(-50%);
opacity: .25;
font-size: 3em;
width: 100%;
text-align: center;
z-index: 1000;
}
.inputInvoiceGrid {
width: 100%;
height: calc(~'100% - 158px');
.ui-grid-header-cell-wrapper .ui-grid-header-cell-row .ui-grid-cell-contents {
height: 40px;
i {
display: none;
}
}
}
}
.form-control {
&:focus {
border-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
border: 1px solid #ccc;
}
}
.input-width-middle {
width: 217px;
}
}
.rightHeader{
text-align: right;
}
.popover {
min-width: 370px;
left: 119px !important;
.arrow {
left: 5% !important;
}
}
.popover-content {
td {
text-align: right;
padding: 6px;
span {
float: left;
}
}
.form-control {
display: inline-block;
&:focus {
border-color: transparent;
-webkit-box-shadow: none;
box-shadow: none;
border: 1px solid #ccc;
}
}
.input-width-small {
width: 100px;
}
.input-width-middle {
width: 217px;
}
}
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