Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
18591263
Commit
18591263
authored
Jul 08, 2024
by
江和松
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
5d3037e5
47381568
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
120 additions
and
36 deletions
+120
-36
ServiceHGCW012.java
.../java/com/baosight/hggp/hg/cw/service/ServiceHGCW012.java
+0
-0
HGCWTools.java
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
+87
-12
HGCW012A.js
src/main/webapp/HG/CW/HGCW012A.js
+25
-21
HGKC013.js
src/main/webapp/HG/KC/HGKC013.js
+8
-3
No files found.
src/main/java/com/baosight/hggp/hg/cw/service/ServiceHGCW012.java
View file @
18591263
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
View file @
18591263
...
...
@@ -441,6 +441,22 @@ public class HGCWTools {
return
results
.
get
(
0
);
}
public
static
void
updateAmount
(
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"采购收票单ID不能为空!"
);
HGCW012
HGCW012
=
HGCWTools
.
HgCw012
.
getId
(
id
.
toString
());
List
<
HGCW013
>
HGCW013s
=
HGCWTools
.
HgCw013
.
getMainId
(
HGCW012
.
getId
());
if
(
CollectionUtils
.
isNotEmpty
(
HGCW013s
))
{
// 更新主表
BigDecimal
totalContractPriceIncluding
=
BigDecimal
.
ZERO
;
StringBuffer
contractNumber
=
new
StringBuffer
();
for
(
HGCW013
HGCW013
:
HGCW013s
)
{
totalContractPriceIncluding
=
totalContractPriceIncluding
.
add
(
HGCW013
.
getTotalContractPriceIncluding
());
}
HGCW012
.
setTotalContractPriceIncluding
(
totalContractPriceIncluding
);
HGCW012
.
setPartyA
(
HGCW013s
.
get
(
0
).
getPartyA
());
DaoUtils
.
update
(
"HGCW012.update"
,
HGCW012
);
}
}
public
static
void
cutAmount
(
String
settlementNumber
,
BigDecimal
cutAmount
)
{
AssertUtils
.
isNull
(
settlementNumber
,
"来源单号不能为空!"
);
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
...
...
@@ -462,7 +478,6 @@ public class HGCWTools {
DaoUtils
.
update
(
"HGCW012.updateDeductionAmount"
,
HGCW012
);
}
public
static
List
<
HGCW012
>
checkList
(
Map
paramMap
)
{
AssertUtils
.
isEmpty
(
paramMap
,
"数据检查参数不能为空"
);
return
DaoBase
.
getInstance
().
query
(
"HGCW012.queryCheckList"
,
paramMap
);
...
...
@@ -486,7 +501,6 @@ public class HGCWTools {
* 采购收票明细清单
*/
public
static
class
HgCw013
{
public
static
HGCW013
getId
(
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"销售开票单ID不能为空!"
);
List
<
HGCW013
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW013
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
...
...
@@ -494,26 +508,85 @@ public class HGCWTools {
});
return
results
.
get
(
0
);
}
public
static
List
<
HGCW013
>
mapTofList
(
List
<
Map
>
rows
,
Long
mainId
)
{
List
<
HGCW013
>
HGCW013List
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rows
))
{
rows
.
forEach
(
row
->
{
HGCW013
HGCW013
=
new
HGCW013
();
HGCW013
.
fromMap
(
row
);
String
settlementNumber
=
row
.
get
(
"contractNumber"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisAmount"
).
toString
();
BigDecimal
taxPoints
=
new
BigDecimal
(
row
.
get
(
"taxPoints"
).
toString
());
// 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal
thisAmount
=
new
BigDecimal
(
row
.
get
(
"thisAmount"
).
toString
());
BigDecimal
taxRateAsDecimal
=
taxPoints
.
divide
(
new
BigDecimal
(
"100"
)).
add
(
new
BigDecimal
(
"1"
));
// 将税率转换为小数形式
BigDecimal
thisSettlementAmount
=
thisAmount
.
divide
(
taxRateAsDecimal
,
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
thisSettlementTax
=
thisAmount
.
subtract
(
thisSettlementAmount
);
// 计算税额
HGCW013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
HGCW013
.
setSettlementNumber
(
settlementNumber
);
HGCW013
.
setThisSettlementTax
(
thisSettlementTax
.
toString
());
HGCW013
.
setThisSettlementAmount
(
thisSettlementAmount
.
toString
());
if
(
mainId
!=
null
)
{
HGCW013
.
setMainId
(
mainId
);
}
HGCW013List
.
add
(
HGCW013
);
});
}
return
HGCW013List
;
}
public
static
List
<
HGCW013
>
mapToList
(
List
<
Map
>
rows
,
Long
mainId
)
{
List
<
HGCW013
>
hgcw
013List
=
new
ArrayList
<>();
List
<
HGCW013
>
HGCW
013List
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rows
))
{
rows
.
forEach
(
row
->
{
HGCW013
hgcw
013
=
new
HGCW013
();
hgcw
013
.
fromMap
(
row
);
HGCW013
HGCW
013
=
new
HGCW013
();
HGCW
013
.
fromMap
(
row
);
String
settlementNumber
=
row
.
get
(
"settlementNumber"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisSettlementAmount"
).
toString
();
hgcw013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
hgcw013
.
setSettlementNumber
(
settlementNumber
);
String
remainingAmount
=
row
.
get
(
"thisAmount"
).
toString
();
BigDecimal
taxPoints
=
new
BigDecimal
(
row
.
get
(
"taxPoints"
).
toString
());
// 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal
thisAmount
=
new
BigDecimal
(
row
.
get
(
"thisAmount"
).
toString
());
BigDecimal
taxRateAsDecimal
=
taxPoints
.
divide
(
new
BigDecimal
(
"100"
)).
add
(
new
BigDecimal
(
"1"
));
// 将税率转换为小数形式
BigDecimal
thisSettlementAmount
=
thisAmount
.
divide
(
taxRateAsDecimal
,
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
thisSettlementTax
=
thisAmount
.
subtract
(
thisSettlementAmount
);
// 计算税额
HGCW013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
HGCW013
.
setSettlementNumber
(
settlementNumber
);
HGCW013
.
setThisSettlementTax
(
thisSettlementTax
.
toString
());
HGCW013
.
setThisSettlementAmount
(
thisSettlementAmount
.
toString
());
if
(
mainId
!=
null
)
{
hgcw
013
.
setMainId
(
mainId
);
HGCW
013
.
setMainId
(
mainId
);
}
hgcw013List
.
add
(
hgcw
013
);
HGCW013List
.
add
(
HGCW
013
);
});
}
return
hgcw
013List
;
return
HGCW
013List
;
}
public
static
List
<
HGCW013
>
mapToeList
(
List
<
Map
>
rows
,
Long
mainId
)
{
List
<
HGCW013
>
HGCW013List
=
new
ArrayList
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rows
))
{
rows
.
forEach
(
row
->
{
HGCW013
HGCW013
=
new
HGCW013
();
HGCW013
.
fromMap
(
row
);
String
settlementNumber
=
row
.
get
(
"receiveNo"
).
toString
();
String
partA
=
row
.
get
(
"supName"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisSettlementAmount"
).
toString
();
BigDecimal
taxPoints
=
new
BigDecimal
(
"13"
);
// 假设这是以整数形式给出的税率,比如17表示17%
BigDecimal
thisAmount
=
new
BigDecimal
(
row
.
get
(
"thisSettlementAmount"
).
toString
());
BigDecimal
taxRateAsDecimal
=
taxPoints
.
divide
(
new
BigDecimal
(
"100"
)).
add
(
new
BigDecimal
(
"1"
));
// 将税率转换为小数形式
BigDecimal
thisSettlementAmount
=
thisAmount
.
divide
(
taxRateAsDecimal
,
2
,
RoundingMode
.
HALF_UP
);
BigDecimal
thisSettlementTax
=
thisAmount
.
subtract
(
thisSettlementAmount
);
// 计算税额
HGCW013
.
setPartyA
(
partA
);
HGCW013
.
setTaxPoints
(
new
Integer
(
String
.
valueOf
(
taxPoints
)));
HGCW013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
HGCW013
.
setSettlementNumber
(
settlementNumber
);
HGCW013
.
setThisSettlementTax
(
thisSettlementTax
.
toString
());
HGCW013
.
setThisSettlementAmount
(
thisSettlementAmount
.
toString
());
if
(
mainId
!=
null
)
{
HGCW013
.
setMainId
(
mainId
);
}
HGCW013List
.
add
(
HGCW013
);
});
}
return
HGCW013List
;
}
public
static
List
<
HGCW013
>
getMainId
(
Long
mainId
)
{
AssertUtils
.
isNull
(
mainId
,
"主表ID不能为空!"
);
List
<
HGCW013
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW013
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
...
...
@@ -521,6 +594,8 @@ public class HGCWTools {
});
return
results
;
}
}
public
static
class
HgCw014
{
...
...
src/main/webapp/HG/CW/HGCW012A.js
View file @
18591263
...
...
@@ -46,39 +46,43 @@ function cancelFunc() {
}
function
btnSaveFunc
(
btnNode
,
gridNode
)
{
let
nobe
=
''
;
let
buld
=
''
;
let
rows
;
if
(
gridNode
==
"result"
)
{
rows
=
resultGrid
.
getCheckedRows
();
nobe
=
"HGCW012"
;
buld
=
"selecta"
;
}
else
if
(
gridNode
==
"resultA"
)
{
rows
=
resultAGrid
.
getCheckedRows
();
nobe
=
"HGCW012"
;
buld
=
"select"
;
}
else
if
(
gridNode
==
"resultB"
)
{
rows
=
resultBGrid
.
getCheckedRows
();
nobe
=
"HGCW012"
;
buld
=
"selectb"
;
}
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
)
return
;
}
let
flag
=
true
;
if
(
gridNode
==
'resultA'
){
$
.
each
(
rows
,
function
(
index
,
item
)
{
let
thisAmount
=
item
[
'this
Settlement
Amount'
];
let
thisAmount
=
item
[
'thisAmount'
];
let
remainingAmount
=
item
[
'remainingAmount'
];
let
billNumber
=
item
[
'billNumber'
];
if
(
!
isNumber
(
thisAmount
)
&&
!
isPositiveNumber
(
thisAmount
))
{
message
(
"勾选的第"
+
(
index
+
1
)
+
"行本次
开
票金额必须是大于0的数字"
);
message
(
"勾选的第"
+
(
index
+
1
)
+
"行本次
收
票金额必须是大于0的数字"
);
flag
=
false
;
return
false
;
}
if
(
parseFloat
(
thisAmount
)
>
parseFloat
(
remainingAmount
))
{
message
(
"第"
+
(
index
+
1
)
+
"行本次开票金额不能大于剩余开票金额"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
billNumber
))
{
message
(
"第"
+
(
index
+
1
)
+
"行发票号不能为空,请填写发票号"
);
message
(
"第"
+
(
index
+
1
)
+
"行本次收票金额不能大于剩余收票金额"
);
flag
=
false
;
return
false
;
}
});
})
}
;
if
(
flag
){
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据生成票据吗?"
,
{
ok
:
function
()
{
...
...
@@ -86,7 +90,7 @@ function btnSaveFunc(btnNode, gridNode) {
info
.
addBlock
(
JSUtils
.
checkedRows2Block
(
gridNode
));
info
.
set
(
"inqu_status-0-type"
,
gridNode
);
info
.
set
(
"inqu_status-0-mainId"
,
$
(
"#inqu_status-0-mainId"
).
val
());
EiCommunicator
.
send
(
"HGCW012"
,
"select"
,
info
,
{
EiCommunicator
.
send
(
nobe
,
buld
,
info
,
{
onSuccess
:
function
(
ei
)
{
if
(
ei
.
getStatus
()
>=
0
)
{
try
{
...
...
@@ -256,31 +260,31 @@ $(function () {
{
field
:
"thisPriceTax"
,
title
:
"收款价税合计金额"
,
headerTemplate
:
"<span style='color: '>
结算
价税合计金额 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
价税合计金额 </span>"
,
locked
:
false
},
{
field
:
"thisSettlementTax"
,
title
:
"收款税金"
,
headerTemplate
:
"<span style='color: '>
结算
税金 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
税金 </span>"
,
locked
:
false
},
{
field
:
"thisSettlementAmount"
,
title
:
"收款金额"
,
headerTemplate
:
"<span style='color: '>
结算税金
</span>"
,
headerTemplate
:
"<span style='color: '>
收款金额
</span>"
,
locked
:
false
},
{
field
:
"thisAmount"
,
title
:
"本次收款金额"
,
headerTemplate
:
"<span style='color: '>
结算税金
</span>"
,
headerTemplate
:
"<span style='color: '>
本次收款金额
</span>"
,
locked
:
false
},
{
field
:
"remainingAmount"
,
title
:
"剩余收款金额"
,
headerTemplate
:
"<span style='color: '>
结算税金
</span>"
,
headerTemplate
:
"<span style='color: '>
剩余收款金额
</span>"
,
locked
:
false
}],
loadComplete
:
function
(
grid
)
{
...
...
@@ -342,26 +346,26 @@ $(function () {
locked
:
false
},
{
field
:
"totalContractPrice
Ex
cluding"
,
field
:
"totalContractPrice
In
cluding"
,
title
:
"收款价税合计金额"
,
headerTemplate
:
"<span style='color: '>
结算
价税合计金额 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
价税合计金额 </span>"
,
locked
:
false
},
{
field
:
"valueAddedTax"
,
title
:
"收款税金"
,
headerTemplate
:
"<span style='color: '>
结算
税金 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
税金 </span>"
,
locked
:
false
},
{
field
:
"totalContractPriceExcluding"
,
title
:
"收款金额"
,
headerTemplate
:
"<span style='color: '>
结算
金额 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
金额 </span>"
,
locked
:
false
},{
field
:
"thisAmount"
,
title
:
"本次收款金额"
,
headerTemplate
:
"<span style='color: '>
剩余付
款金额 </span>"
,
headerTemplate
:
"<span style='color: '>
本次收
款金额 </span>"
,
locked
:
false
}],
loadComplete
:
function
(
grid
)
{
...
...
src/main/webapp/HG/KC/HGKC013.js
View file @
18591263
...
...
@@ -135,15 +135,20 @@ $(function () {
grid
.
dataSource
.
bind
(
"change"
,
function
(
e
)
{
// 判断父级节点是否发生变化
if
(
e
.
field
===
"calloutCompanyCode"
)
{
if
(
e
.
items
[
0
][
"allotType"
]
==
1
){
e
.
items
[
0
][
"callinCompanyCode"
]
=
e
.
items
[
0
][
"calloutCompanyCode"
];
}
e
.
items
[
0
][
"calloutWhCode"
]
=
''
;
e
.
items
[
0
][
"calloutWhName"
]
=
''
;
e
.
items
[
0
][
"callinWhCode"
]
=
''
;
e
.
items
[
0
][
"callinWhName"
]
=
''
;
if
(
e
.
items
[
0
][
"allotType"
]
==
2
){
loadChange
(
grid
,
e
,
"calloutWhCode"
);
}
else
if
(
e
.
items
[
0
][
"allotType"
]
==
1
){
e
.
items
[
0
][
"callinCompanyCode"
]
=
e
.
items
[
0
][
"calloutCompanyCode"
];
loadChange
(
grid
,
e
,
"callinCompanyCode"
);
loadChange
(
grid
,
e
,
"calloutWhCode"
);
}
/*if (e.items[0]["allotType"] == 1){
}*/
}
if
(
e
.
field
==
"calloutWhCode"
)
{
if
(
e
.
items
[
0
][
"allotType"
]
==
2
&&
isBlank
(
e
.
items
[
0
][
"callinCompanyCode"
])){
...
...
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