Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
traffic-front
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangxiaoming
traffic-front
Commits
08e321eb
Commit
08e321eb
authored
Mar 22, 2019
by
chase
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改税金计算表
parent
df9f5f52
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
60 deletions
+110
-60
SpringContextUtil.java
.../java/pwc/taxtech/atms/common/util/SpringContextUtil.java
+2
-2
InvoiceRecordEnum.java
...va/pwc/taxtech/atms/constant/enums/InvoiceRecordEnum.java
+34
-5
TaxesCalculateReportEnum.java
...taxtech/atms/constant/enums/TaxesCalculateReportEnum.java
+12
-11
ReportServiceImpl.java
.../pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
+31
-21
KPSR.java
.../taxtech/atms/vat/service/impl/report/functions/KPSR.java
+27
-21
tax-report-cell-detail-modal.ctrl.js
...rt-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
+4
-0
No files found.
atms-api/src/main/java/pwc/taxtech/atms/common/util/SpringContextUtil.java
View file @
08e321eb
...
...
@@ -60,7 +60,7 @@ public class SpringContextUtil implements ApplicationContextAware {
public
static
TrialBalanceFinalMapper
trialBalanceFinalMapper
;
public
static
ProfitLossStatementMapper
profitLossStatementMapper
;
public
static
RevenueTypeMappingMapper
revenueTypeMappingMapper
;
public
static
BillDetailMapper
billDetail
Mapper
;
public
static
InvoiceRecordMapper
invoiceRecord
Mapper
;
...
...
@@ -145,7 +145,7 @@ public class SpringContextUtil implements ApplicationContextAware {
balanceSheetMapper
=
webApplicationContext
.
getBean
(
BalanceSheetMapper
.
class
);
revenueTypeMappingMapper
=
webApplicationContext
.
getBean
(
RevenueTypeMappingMapper
.
class
);
billDetailMapper
=
webApplicationContext
.
getBean
(
BillDetail
Mapper
.
class
);
invoiceRecordMapper
=
webApplicationContext
.
getBean
(
InvoiceRecord
Mapper
.
class
);
/* map.put("balance_sheet", balanceMapper);
map.put("profit_loss_statement",profitLossStatementMapper);
...
...
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/
BillDetail
Enum.java
→
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/
InvoiceRecord
Enum.java
View file @
08e321eb
...
...
@@ -3,19 +3,19 @@ package pwc.taxtech.atms.constant.enums;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
BillDetail
Enum
{
public
class
InvoiceRecord
Enum
{
/**
* 发票类型
*/
public
enum
Bill
Type
{
public
enum
Invoice
Type
{
ORDINARY
(
1
,
"增值税普票"
),
SPECIAL
(
2
,
"增值税专票"
);
private
Integer
code
;
private
String
name
;
public
static
final
Map
<
Integer
,
String
>
MAPPING
=
new
HashMap
<>();
Bill
Type
(
Integer
code
,
String
name
)
{
Invoice
Type
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
...
...
@@ -29,11 +29,40 @@ public class BillDetailEnum {
}
static
{
for
(
BillDetailEnum
.
BillType
billType
:
BillDetailEnum
.
Bill
Type
.
values
())
{
MAPPING
.
put
(
billType
.
getCode
(),
bill
Type
.
getName
());
for
(
InvoiceRecordEnum
.
InvoiceType
invoiceType
:
InvoiceRecordEnum
.
Invoice
Type
.
values
())
{
MAPPING
.
put
(
invoiceType
.
getCode
(),
invoice
Type
.
getName
());
}
}
}
/**
* 金额类型
*/
public
enum
AmountType
{
INVOICE_AMOUNT
(
1
,
"开票金额"
),
TAX_AMOUNT
(
2
,
"税额"
);
private
Integer
code
;
private
String
name
;
public
static
final
Map
<
Integer
,
String
>
MAPPING
=
new
HashMap
<>();
AmountType
(
Integer
code
,
String
name
)
{
this
.
code
=
code
;
this
.
name
=
name
;
}
public
Integer
getCode
()
{
return
code
;
}
public
String
getName
()
{
return
name
;
}
static
{
for
(
InvoiceRecordEnum
.
AmountType
amountType
:
InvoiceRecordEnum
.
AmountType
.
values
())
{
MAPPING
.
put
(
amountType
.
getCode
(),
amountType
.
getName
());
}
}
}
}
atms-api/src/main/java/pwc/taxtech/atms/constant/enums/TaxesCalculateReportEnum.java
View file @
08e321eb
...
...
@@ -8,18 +8,19 @@ public class TaxesCalculateReportEnum {
public
enum
Column
{
Column_1
(
0
,
"序号"
),
Column_2
(
1
,
"
收入类型名称
"
),
Column_3
(
2
,
"
税金项目
"
),
Column_4
(
3
,
"
期间
"
),
Column_5
(
4
,
"
账载收入-明细
"
),
Column_6
(
5
,
"销项开票
收入数
-专票"
),
Column_2
(
1
,
"
税金项目
"
),
Column_3
(
2
,
"
期间
"
),
Column_4
(
3
,
"
账载收入-明细
"
),
Column_5
(
4
,
"
销项开票收入数-专票
"
),
Column_6
(
5
,
"销项开票
税额
-专票"
),
Column_7
(
6
,
"销项开票收入数-普票"
),
Column_8
(
7
,
"计税基数(应税收入)"
),
Column_9
(
8
,
"税率"
),
Column_10
(
9
,
"税额(元)"
),
Column_11
(
10
,
"收入类别"
),
Column_12
(
11
,
"计税方式"
),
Column_13
(
12
,
"备注"
)
Column_8
(
7
,
"销项开票税额-普票"
),
Column_9
(
8
,
"计税基数 (应税收入)"
),
Column_10
(
9
,
"税率"
),
Column_11
(
10
,
"税额(元)"
),
Column_12
(
11
,
"收入类别"
),
Column_13
(
12
,
"计税方式"
),
Column_14
(
13
,
"备注"
)
;
private
Integer
index
;
private
String
name
;
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/ReportServiceImpl.java
View file @
08e321eb
...
...
@@ -368,18 +368,22 @@ public class ReportServiceImpl extends BaseService {
public
void
assemblePeriodTemplate
(
Template
template
,
Workbook
workbook
,
String
projectId
,
Integer
period
,
List
<
Long
>
configIds
)
throws
ServiceException
{
int
addRowIndex
=
configIds
.
size
();
List
<
Integer
>
hasHandDatas
=
Arrays
.
asList
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
());
TaxesCalculateReportEnum
.
Column
.
Column_9
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_11
.
getIndex
());
List
<
Integer
>
hasFormulaDatas
=
Arrays
.
asList
(
TaxesCalculateReportEnum
.
Column
.
Column_3
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
());
TaxesCalculateReportEnum
.
Column
.
Column_9
.
getIndex
(),
TaxesCalculateReportEnum
.
Column
.
Column_11
.
getIndex
());
try
{
Date
now
=
new
Date
();
Sheet
sheet
=
workbook
.
getSheetAt
(
0
);
...
...
@@ -753,11 +757,13 @@ public class ReportServiceImpl extends BaseService {
List
<
RevenueConfig
>
dataList
=
revenueConfigMapper
.
selectByExample
(
example
);
//合计项map
Map
<
Integer
,
List
<
String
>>
sumMap
=
new
HashMap
<>();
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_9
.
getIndex
(),
new
ArrayList
<>());
sumMap
.
put
(
TaxesCalculateReportEnum
.
Column
.
Column_11
.
getIndex
(),
new
ArrayList
<>());
List
<
Long
>
configIds
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
dataList
))
{
...
...
@@ -770,48 +776,52 @@ public class ReportServiceImpl extends BaseService {
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
.
getIndex
()).
setCellValue
(
"1-"
+
(
dataList
.
size
()+
1
-
rowIndex
));
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_2
.
getIndex
()).
setCellValue
(
config
.
getName
());
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_3
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
()).
setCellValue
(
"PC(\"FilterDate1\",2)"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_3
.
getIndex
()).
setCellValue
(
"PC(\"FilterDate1\",2)"
);
//判断帐载收入明细
if
(
0
==
config
.
getAccountType
())
{
//0值
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
5
.
getIndex
()).
setCellValue
(
0.00
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
4
.
getIndex
()).
setCellValue
(
0.00
);
}
else
if
(
1
==
config
.
getAccountType
())
{
//科目
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
5
.
getIndex
()).
setCellValue
(
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
4
.
getIndex
()).
setCellValue
(
"DFFS(\""
+
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
{
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
5
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
4
.
getIndex
()).
setCellValue
(
""
);
}
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
()).
setCellValue
(
"KPSR(\""
+
config
.
getName
()+
"\",2)"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
()).
setCellValue
(
"KPSR(\""
+
config
.
getName
()+
"\",1)"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
()).
setCellValue
(
"KPSR(\""
+
config
.
getName
()+
"\",2,1)"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
()).
setCellValue
(
"KPSR(\""
+
config
.
getName
()+
"\",2,2)"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
()).
setCellValue
(
"KPSR(\""
+
config
.
getName
()+
"\",1,1)"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
setCellValue
(
"KPSR(\""
+
config
.
getName
()+
"\",1,2)"
);
if
(
1
==
config
.
getTaxBase
())
{
//账载
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
8
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"E
\")"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
9
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"D
\")"
);
}
else
if
(
2
==
config
.
getTaxBase
())
{
//开票收入
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
8
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"F
\")+"
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
9
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"E
\")+"
+
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"G\")"
);
}
else
if
(
3
==
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_
9
.
getIndex
()).
setCellValue
(
"JFFS(\""
+
config
.
getTbSegment3
()
+
"\","
+
project
.
getYear
()
+
","
+
period
+
",1,,)"
);
}
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_
9
.
getIndex
()).
setCellValue
(
"DFFS(\""
+
config
.
getTbSegment3
()
+
"\","
+
project
.
getYear
()
+
","
+
period
+
",1,,)"
);
}
else
{
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
8
.
getIndex
()).
setCellValue
(
""
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
9
.
getIndex
()).
setCellValue
(
""
);
}
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
9
.
getIndex
()).
setCellValue
(
config
.
getTaxRate
().
multiply
(
new
BigDecimal
(
100
)).
intValue
()
+
"%"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
0
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"H
\")*"
+
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"
I
\")"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
1
.
getIndex
()).
setCellValue
(
RevenueConfEnum
.
RevenueType
.
MAPPING
.
get
(
config
.
getRevenueType
()));
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
2
.
getIndex
()).
setCellValue
(
RevenueConfEnum
.
TaxType
.
MAPPING
.
get
(
config
.
getTaxType
()));
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_
10
.
getIndex
()).
setCellValue
(
config
.
getTaxRate
().
multiply
(
new
BigDecimal
(
100
)).
intValue
()
+
"%"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
1
.
getIndex
()).
setCellValue
(
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"I
\")*"
+
"WPNAME(\"VAT020\",\"B\",\""
+
config
.
getName
()+
"\",\"
J
\")"
);
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
2
.
getIndex
()).
setCellValue
(
RevenueConfEnum
.
RevenueType
.
MAPPING
.
get
(
config
.
getRevenueType
()));
row
.
getCell
(
TaxesCalculateReportEnum
.
Column
.
Column_1
3
.
getIndex
()).
setCellValue
(
RevenueConfEnum
.
TaxType
.
MAPPING
.
get
(
config
.
getTaxType
()));
rowIndex
++;
//组装合计项
sumMap
.
get
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
()).
add
(
transNumber
(
TaxesCalculateReportEnum
.
Column
.
Column_4
.
getIndex
()+
1
,
""
)+
rowIndex
);
sumMap
.
get
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
()).
add
(
transNumber
(
TaxesCalculateReportEnum
.
Column
.
Column_5
.
getIndex
()+
1
,
""
)+
rowIndex
);
sumMap
.
get
(
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
()).
add
(
transNumber
(
TaxesCalculateReportEnum
.
Column
.
Column_6
.
getIndex
()+
1
,
""
)+
rowIndex
);
sumMap
.
get
(
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
()).
add
(
transNumber
(
TaxesCalculateReportEnum
.
Column
.
Column_7
.
getIndex
()+
1
,
""
)+
rowIndex
);
sumMap
.
get
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()).
add
(
transNumber
(
TaxesCalculateReportEnum
.
Column
.
Column_8
.
getIndex
()+
1
,
""
)+
rowIndex
);
sumMap
.
get
(
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
()).
add
(
transNumber
(
TaxesCalculateReportEnum
.
Column
.
Column_10
.
getIndex
()+
1
,
""
)+
rowIndex
);
sumMap
.
get
(
TaxesCalculateReportEnum
.
Column
.
Column_9
.
getIndex
()).
add
(
transNumber
(
TaxesCalculateReportEnum
.
Column
.
Column_9
.
getIndex
()+
1
,
""
)+
rowIndex
);
sumMap
.
get
(
TaxesCalculateReportEnum
.
Column
.
Column_11
.
getIndex
()).
add
(
transNumber
(
TaxesCalculateReportEnum
.
Column
.
Column_11
.
getIndex
()+
1
,
""
)+
rowIndex
);
}
//组装合计项数据
assembleSumRow
(
sheet
.
getRow
(
rowIndex
),
sumMap
);
...
...
atms-api/src/main/java/pwc/taxtech/atms/vat/service/impl/report/functions/KPSR.java
View file @
08e321eb
...
...
@@ -5,16 +5,15 @@ import org.apache.poi.ss.formula.OperationEvaluationContext;
import
org.apache.poi.ss.formula.eval.NumberEval
;
import
org.apache.poi.ss.formula.eval.ValueEval
;
import
org.apache.poi.ss.formula.functions.FreeRefFunction
;
import
pwc.taxtech.atms.common.util.DateUtils
;
import
pwc.taxtech.atms.common.util.SpringContextUtil
;
import
pwc.taxtech.atms.constant.Constant
;
import
pwc.taxtech.atms.constant.enums.
BillDetail
Enum
;
import
pwc.taxtech.atms.constant.enums.
InvoiceRecord
Enum
;
import
pwc.taxtech.atms.constant.enums.EnumOperationType
;
import
pwc.taxtech.atms.constant.enums.FormulaDataSourceDetailType
;
import
pwc.taxtech.atms.constant.enums.KeyValueConfigResultType
;
import
pwc.taxtech.atms.dto.vatdto.OutputInvoiceDataSourceDto
;
import
pwc.taxtech.atms.vat.entity.
BillDetail
;
import
pwc.taxtech.atms.vat.entity.
BillDetail
Example
;
import
pwc.taxtech.atms.vat.entity.
InvoiceRecord
;
import
pwc.taxtech.atms.vat.entity.
InvoiceRecord
Example
;
import
pwc.taxtech.atms.vat.entity.RevenueTypeMapping
;
import
pwc.taxtech.atms.vat.entity.RevenueTypeMappingExample
;
...
...
@@ -34,16 +33,17 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
@Override
public
ValueEval
evaluate
(
ValueEval
[]
args
,
OperationEvaluationContext
ec
)
{
if
(
args
.
length
<
2
)
{
if
(
args
.
length
<
3
)
{
return
null
;
}
String
revenueTypeName
=
getStringParam
(
args
[
0
],
ec
);
//收入类型名称
Integer
billType
=
getIntParam
(
args
[
1
],
ec
);
//发票类型
String
formulaExpression
=
"KPSR(\""
+
revenueTypeName
+
"\","
+
billType
+
")"
;
Integer
amountType
=
getIntParam
(
args
[
2
],
ec
);
//金额类型
String
formulaExpression
=
"KPSR(\""
+
revenueTypeName
+
"\","
+
billType
+
","
+
amountType
+
")"
;
logger
.
debug
(
formulaExpression
);
List
<
OutputInvoiceDataSourceDto
>
dataSource
=
new
ArrayList
<>();
double
result
=
assembleData
(
revenueTypeName
,
dataSource
,
billType
,
ec
);
double
result
=
assembleData
(
revenueTypeName
,
dataSource
,
billType
,
amountType
,
ec
);
Long
dataSoureId
=
saveDataSource
(
ec
,
Collections
.
singletonList
(
dataSource
),
FormulaDataSourceDetailType
.
OutputInvoiceDataSourceDto
,
new
BigDecimal
(
result
),
formulaContext
.
getPeriod
(),
formulaContext
.
getReportTemplateGroupId
(),
formulaContext
.
getProjectId
());
saveFormulaBlock
(
formulaContext
.
getPeriod
(),
ec
,
formulaExpression
,
new
BigDecimal
(
result
),
dataSoureId
,
formulaContext
.
getProjectId
());
...
...
@@ -51,7 +51,7 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
}
private
double
assembleData
(
String
revenueTypeName
,
List
<
OutputInvoiceDataSourceDto
>
contain
,
Integer
billType
,
OperationEvaluationContext
ec
)
{
private
double
assembleData
(
String
revenueTypeName
,
List
<
OutputInvoiceDataSourceDto
>
contain
,
Integer
billType
,
Integer
amountType
,
OperationEvaluationContext
ec
)
{
String
queryDate
=
formulaContext
.
getYear
()+(
formulaContext
.
getPeriod
()<
10
?(
"0"
+
formulaContext
.
getPeriod
()):(
formulaContext
.
getPeriod
()+
""
));
RevenueTypeMappingExample
typeMappingExample
=
new
RevenueTypeMappingExample
();
...
...
@@ -67,30 +67,36 @@ public class KPSR extends FunctionBase implements FreeRefFunction {
if
(
CollectionUtils
.
isEmpty
(
contens
))
{
return
0.0
;
}
BillDetailExample
billDetailExample
=
new
BillDetailExample
();
BillDetailExample
.
Criteria
c
=
billDetailExample
.
createCriteria
().
andBillContentIn
(
contens
).
andProjectIdEqualTo
(
formulaContext
.
getProjectId
())
InvoiceRecordExample
invoiceRecordExample
=
new
InvoiceRecordExample
();
InvoiceRecordExample
.
Criteria
c
=
invoiceRecordExample
.
createCriteria
().
andBillingContentIn
(
contens
)
.
andProjectIdEqualTo
(
formulaContext
.
getProjectId
())
.
andPeriodEqualTo
(
Integer
.
valueOf
(
queryDate
))
.
and
BillTypeEqualTo
(
BillDetailEnum
.
Bill
Type
.
MAPPING
.
get
(
billType
));
List
<
BillDetail
>
billDetails
=
SpringContextUtil
.
billDetailMapper
.
selectByExample
(
billDetail
Example
);
for
(
BillDetail
billDetail
:
billDetails
)
{
.
and
InvoiceTypeEqualTo
(
InvoiceRecordEnum
.
Invoice
Type
.
MAPPING
.
get
(
billType
));
List
<
InvoiceRecord
>
billDetails
=
SpringContextUtil
.
invoiceRecordMapper
.
selectByExample
(
invoiceRecord
Example
);
for
(
InvoiceRecord
invoiceRecord
:
billDetails
)
{
OutputInvoiceDataSourceDto
outputInvoiceDataSourceDto
=
new
OutputInvoiceDataSourceDto
();
outputInvoiceDataSourceDto
.
setAmount
(
FormulaHelper
.
roundValue
(
billDetail
.
getBill
Amount
(),
outputInvoiceDataSourceDto
.
setAmount
(
FormulaHelper
.
roundValue
(
invoiceRecord
.
getInvoice
Amount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
outputInvoiceDataSourceDto
.
setResultType
(
KeyValueConfigResultType
.
Accounting
.
getCode
());
outputInvoiceDataSourceDto
.
setTaxAmount
(
FormulaHelper
.
roundValue
(
billDetail
.
getTaxAmount
(),
outputInvoiceDataSourceDto
.
setTaxAmount
(
FormulaHelper
.
roundValue
(
invoiceRecord
.
getTaxAmount
(),
KeyValueConfigResultType
.
Accounting
,
null
,
formulaContext
));
outputInvoiceDataSourceDto
.
setTaxRate
(
billDetail
.
getTaxRate
());
outputInvoiceDataSourceDto
.
setBuyerName
(
billDetail
.
getCustomer
());
outputInvoiceDataSourceDto
.
setInvoiceCode
(
billDetail
.
getBill
Code
());
outputInvoiceDataSourceDto
.
setInvoiceNumber
(
billDetail
.
getBillNo
());
outputInvoiceDataSourceDto
.
setInvoiceDate
(
DateUtils
.
strToDate
(
billDetail
.
getBillDate
()
));
outputInvoiceDataSourceDto
.
setTaxRate
(
invoiceRecord
.
getTaxRate
());
outputInvoiceDataSourceDto
.
setBuyerName
(
invoiceRecord
.
getCustomerCompanyName
());
outputInvoiceDataSourceDto
.
setInvoiceCode
(
invoiceRecord
.
getInvoice
Code
());
outputInvoiceDataSourceDto
.
setInvoiceNumber
(
invoiceRecord
.
getInvoiceNum
());
outputInvoiceDataSourceDto
.
setInvoiceDate
(
invoiceRecord
.
getBillingDate
(
));
outputInvoiceDataSourceDto
.
setInvoiceType
(
billType
);
outputInvoiceDataSourceDto
.
setPeriod
(
formulaContext
.
getPeriod
());
outputInvoiceDataSourceDto
.
setName
(
Constant
.
DataSourceName
.
OutputInvoiceDataSource
);
outputInvoiceDataSourceDto
.
setOperationType
(
EnumOperationType
.
Single
.
getCode
());
contain
.
add
(
outputInvoiceDataSourceDto
);
}
return
billDetails
.
stream
().
mapToDouble
(
a
->
a
.
getBillAmount
().
doubleValue
()).
sum
();
if
(
InvoiceRecordEnum
.
AmountType
.
INVOICE_AMOUNT
.
getCode
().
equals
(
amountType
)){
return
billDetails
.
stream
().
mapToDouble
(
a
->
a
.
getInvoiceAmount
().
doubleValue
()).
sum
();
}
else
if
(
InvoiceRecordEnum
.
AmountType
.
TAX_AMOUNT
.
getCode
().
equals
(
amountType
)){
return
billDetails
.
stream
().
mapToDouble
(
a
->
a
.
getTaxAmount
().
doubleValue
()).
sum
();
}
return
0
;
}
...
...
atms-web/src/main/webapp/app/common/controls/tax-report-cell-detail-modal/tax-report-cell-detail-modal.ctrl.js
View file @
08e321eb
...
...
@@ -642,6 +642,9 @@
||
$scope
.
selectedTabIndex
===
enums
.
formulaDataSourceType
.
InputInvoiceDetail
||
$scope
.
selectedTabIndex
===
enums
.
formulaDataSourceType
.
OutputInvoice
||
$scope
.
selectedTabIndex
===
enums
.
formulaDataSourceType
.
InvoiceFilter
)
{
if
(
new
Number
(
$scope
.
detail
.
cellTemplateId
)
<
0
){
$
(
"#dataGridFooterSummary"
).
html
(
""
);
}
else
{
evalVal
=
_
.
reduce
(
$scope
.
detail
.
dataGridSource
,
function
(
memo
,
x
)
{
if
(
x
.
money
){
return
memo
+
x
.
money
;
...
...
@@ -667,6 +670,7 @@
+
evalVal
.
formatAmount
(
precition
)
+
' '
+
$translate
.
instant
(
'TaxAmount'
)
+
': '
+
evalTaxVal
.
formatAmount
(
precition
));
}
}
else
if
(
$scope
.
selectedTabIndex
===
enums
.
formulaDataSourceType
.
Voucher
)
{
evalVal
=
_
.
reduce
(
$scope
.
detail
.
dataGridSource
,
function
(
memo
,
x
)
{
return
memo
+
x
.
debit
-
x
.
credit
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment