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
dcc48924
Commit
dcc48924
authored
Jul 06, 2024
by
13420
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
采购收票bug处理
parent
2eabad05
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
32 deletions
+59
-32
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
+34
-11
HGCW012A.js
src/main/webapp/HG/CW/HGCW012A.js
+25
-21
No files found.
src/main/java/com/baosight/hggp/hg/cw/service/ServiceHGCW012.java
View file @
dcc48924
This diff is collapsed.
Click to expand it.
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
View file @
dcc48924
...
@@ -441,6 +441,22 @@ public class HGCWTools {
...
@@ -441,6 +441,22 @@ public class HGCWTools {
return
results
.
get
(
0
);
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
)
{
public
static
void
cutAmount
(
String
settlementNumber
,
BigDecimal
cutAmount
)
{
AssertUtils
.
isNull
(
settlementNumber
,
"来源单号不能为空!"
);
AssertUtils
.
isNull
(
settlementNumber
,
"来源单号不能为空!"
);
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
...
@@ -462,7 +478,6 @@ public class HGCWTools {
...
@@ -462,7 +478,6 @@ public class HGCWTools {
DaoUtils
.
update
(
"HGCW012.updateDeductionAmount"
,
HGCW012
);
DaoUtils
.
update
(
"HGCW012.updateDeductionAmount"
,
HGCW012
);
}
}
public
static
List
<
HGCW012
>
checkList
(
Map
paramMap
)
{
public
static
List
<
HGCW012
>
checkList
(
Map
paramMap
)
{
AssertUtils
.
isEmpty
(
paramMap
,
"数据检查参数不能为空"
);
AssertUtils
.
isEmpty
(
paramMap
,
"数据检查参数不能为空"
);
return
DaoBase
.
getInstance
().
query
(
"HGCW012.queryCheckList"
,
paramMap
);
return
DaoBase
.
getInstance
().
query
(
"HGCW012.queryCheckList"
,
paramMap
);
...
@@ -486,7 +501,6 @@ public class HGCWTools {
...
@@ -486,7 +501,6 @@ public class HGCWTools {
* 采购收票明细清单
* 采购收票明细清单
*/
*/
public
static
class
HgCw013
{
public
static
class
HgCw013
{
public
static
HGCW013
getId
(
Long
id
)
{
public
static
HGCW013
getId
(
Long
id
)
{
AssertUtils
.
isNull
(
id
,
"销售开票单ID不能为空!"
);
AssertUtils
.
isNull
(
id
,
"销售开票单ID不能为空!"
);
List
<
HGCW013
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW013
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HGCW013
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW013
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
...
@@ -496,22 +510,29 @@ public class HGCWTools {
...
@@ -496,22 +510,29 @@ public class HGCWTools {
}
}
public
static
List
<
HGCW013
>
mapToList
(
List
<
Map
>
rows
,
Long
mainId
)
{
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
))
{
if
(
CollectionUtils
.
isNotEmpty
(
rows
))
{
rows
.
forEach
(
row
->
{
rows
.
forEach
(
row
->
{
HGCW013
hgcw
013
=
new
HGCW013
();
HGCW013
HGCW
013
=
new
HGCW013
();
hgcw
013
.
fromMap
(
row
);
HGCW
013
.
fromMap
(
row
);
String
settlementNumber
=
row
.
get
(
"settlementNumber"
).
toString
();
String
settlementNumber
=
row
.
get
(
"settlementNumber"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisSettlementAmount"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisAmount"
).
toString
();
hgcw013
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
BigDecimal
taxPoints
=
new
BigDecimal
(
row
.
get
(
"taxPoints"
).
toString
());
// 假设这是以整数形式给出的税率,比如17表示17%
hgcw013
.
setSettlementNumber
(
settlementNumber
);
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
)
{
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
>
getMainId
(
Long
mainId
)
{
public
static
List
<
HGCW013
>
getMainId
(
Long
mainId
)
{
...
@@ -521,6 +542,8 @@ public class HGCWTools {
...
@@ -521,6 +542,8 @@ public class HGCWTools {
});
});
return
results
;
return
results
;
}
}
}
}
public
static
class
HgCw014
{
public
static
class
HgCw014
{
...
...
src/main/webapp/HG/CW/HGCW012A.js
View file @
dcc48924
...
@@ -46,39 +46,43 @@ function cancelFunc() {
...
@@ -46,39 +46,43 @@ function cancelFunc() {
}
}
function
btnSaveFunc
(
btnNode
,
gridNode
)
{
function
btnSaveFunc
(
btnNode
,
gridNode
)
{
let
nobe
=
''
;
let
buld
=
''
;
let
rows
;
let
rows
;
if
(
gridNode
==
"result"
)
{
if
(
gridNode
==
"result"
)
{
rows
=
resultGrid
.
getCheckedRows
();
rows
=
resultGrid
.
getCheckedRows
();
nobe
=
"HGCW012"
;
buld
=
"selecta"
;
}
else
if
(
gridNode
==
"resultA"
)
{
}
else
if
(
gridNode
==
"resultA"
)
{
rows
=
resultAGrid
.
getCheckedRows
();
rows
=
resultAGrid
.
getCheckedRows
();
nobe
=
"HGCW012"
;
buld
=
"select"
;
}
else
if
(
gridNode
==
"resultB"
)
{
}
else
if
(
gridNode
==
"resultB"
)
{
rows
=
resultBGrid
.
getCheckedRows
();
rows
=
resultBGrid
.
getCheckedRows
();
nobe
=
"HGCW012"
;
buld
=
"selectb"
;
}
}
if
(
rows
.
length
<
1
)
{
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
)
message
(
"请选择数据"
)
return
;
return
;
}
}
let
flag
=
true
;
let
flag
=
true
;
if
(
gridNode
==
'resultA'
){
$
.
each
(
rows
,
function
(
index
,
item
)
{
$
.
each
(
rows
,
function
(
index
,
item
)
{
let
thisAmount
=
item
[
'this
Settlement
Amount'
];
let
thisAmount
=
item
[
'thisAmount'
];
let
remainingAmount
=
item
[
'remainingAmount'
];
let
remainingAmount
=
item
[
'remainingAmount'
];
let
billNumber
=
item
[
'billNumber'
];
if
(
!
isNumber
(
thisAmount
)
&&
!
isPositiveNumber
(
thisAmount
))
{
if
(
!
isNumber
(
thisAmount
)
&&
!
isPositiveNumber
(
thisAmount
))
{
message
(
"勾选的第"
+
(
index
+
1
)
+
"行本次
开
票金额必须是大于0的数字"
);
message
(
"勾选的第"
+
(
index
+
1
)
+
"行本次
收
票金额必须是大于0的数字"
);
flag
=
false
;
flag
=
false
;
return
false
;
return
false
;
}
}
if
(
parseFloat
(
thisAmount
)
>
parseFloat
(
remainingAmount
))
{
if
(
parseFloat
(
thisAmount
)
>
parseFloat
(
remainingAmount
))
{
message
(
"第"
+
(
index
+
1
)
+
"行本次开票金额不能大于剩余开票金额"
);
message
(
"第"
+
(
index
+
1
)
+
"行本次收票金额不能大于剩余收票金额"
);
flag
=
false
;
return
false
;
}
if
(
isBlank
(
billNumber
))
{
message
(
"第"
+
(
index
+
1
)
+
"行发票号不能为空,请填写发票号"
);
flag
=
false
;
flag
=
false
;
return
false
;
return
false
;
}
}
});
})
}
;
if
(
flag
){
if
(
flag
){
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据生成票据吗?"
,
{
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据生成票据吗?"
,
{
ok
:
function
()
{
ok
:
function
()
{
...
@@ -86,7 +90,7 @@ function btnSaveFunc(btnNode, gridNode) {
...
@@ -86,7 +90,7 @@ function btnSaveFunc(btnNode, gridNode) {
info
.
addBlock
(
JSUtils
.
checkedRows2Block
(
gridNode
));
info
.
addBlock
(
JSUtils
.
checkedRows2Block
(
gridNode
));
info
.
set
(
"inqu_status-0-type"
,
gridNode
);
info
.
set
(
"inqu_status-0-type"
,
gridNode
);
info
.
set
(
"inqu_status-0-mainId"
,
$
(
"#inqu_status-0-mainId"
).
val
());
info
.
set
(
"inqu_status-0-mainId"
,
$
(
"#inqu_status-0-mainId"
).
val
());
EiCommunicator
.
send
(
"HGCW012"
,
"select"
,
info
,
{
EiCommunicator
.
send
(
nobe
,
buld
,
info
,
{
onSuccess
:
function
(
ei
)
{
onSuccess
:
function
(
ei
)
{
if
(
ei
.
getStatus
()
>=
0
)
{
if
(
ei
.
getStatus
()
>=
0
)
{
try
{
try
{
...
@@ -256,31 +260,31 @@ $(function () {
...
@@ -256,31 +260,31 @@ $(function () {
{
{
field
:
"thisPriceTax"
,
field
:
"thisPriceTax"
,
title
:
"收款价税合计金额"
,
title
:
"收款价税合计金额"
,
headerTemplate
:
"<span style='color: '>
结算
价税合计金额 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
价税合计金额 </span>"
,
locked
:
false
locked
:
false
},
},
{
{
field
:
"thisSettlementTax"
,
field
:
"thisSettlementTax"
,
title
:
"收款税金"
,
title
:
"收款税金"
,
headerTemplate
:
"<span style='color: '>
结算
税金 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
税金 </span>"
,
locked
:
false
locked
:
false
},
},
{
{
field
:
"thisSettlementAmount"
,
field
:
"thisSettlementAmount"
,
title
:
"收款金额"
,
title
:
"收款金额"
,
headerTemplate
:
"<span style='color: '>
结算税金
</span>"
,
headerTemplate
:
"<span style='color: '>
收款金额
</span>"
,
locked
:
false
locked
:
false
},
},
{
{
field
:
"thisAmount"
,
field
:
"thisAmount"
,
title
:
"本次收款金额"
,
title
:
"本次收款金额"
,
headerTemplate
:
"<span style='color: '>
结算税金
</span>"
,
headerTemplate
:
"<span style='color: '>
本次收款金额
</span>"
,
locked
:
false
locked
:
false
},
},
{
{
field
:
"remainingAmount"
,
field
:
"remainingAmount"
,
title
:
"剩余收款金额"
,
title
:
"剩余收款金额"
,
headerTemplate
:
"<span style='color: '>
结算税金
</span>"
,
headerTemplate
:
"<span style='color: '>
剩余收款金额
</span>"
,
locked
:
false
locked
:
false
}],
}],
loadComplete
:
function
(
grid
)
{
loadComplete
:
function
(
grid
)
{
...
@@ -342,26 +346,26 @@ $(function () {
...
@@ -342,26 +346,26 @@ $(function () {
locked
:
false
locked
:
false
},
},
{
{
field
:
"totalContractPrice
Ex
cluding"
,
field
:
"totalContractPrice
In
cluding"
,
title
:
"收款价税合计金额"
,
title
:
"收款价税合计金额"
,
headerTemplate
:
"<span style='color: '>
结算
价税合计金额 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
价税合计金额 </span>"
,
locked
:
false
locked
:
false
},
},
{
{
field
:
"valueAddedTax"
,
field
:
"valueAddedTax"
,
title
:
"收款税金"
,
title
:
"收款税金"
,
headerTemplate
:
"<span style='color: '>
结算
税金 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
税金 </span>"
,
locked
:
false
locked
:
false
},
},
{
{
field
:
"totalContractPriceExcluding"
,
field
:
"totalContractPriceExcluding"
,
title
:
"收款金额"
,
title
:
"收款金额"
,
headerTemplate
:
"<span style='color: '>
结算
金额 </span>"
,
headerTemplate
:
"<span style='color: '>
收款
金额 </span>"
,
locked
:
false
locked
:
false
},{
},{
field
:
"thisAmount"
,
field
:
"thisAmount"
,
title
:
"本次收款金额"
,
title
:
"本次收款金额"
,
headerTemplate
:
"<span style='color: '>
剩余付
款金额 </span>"
,
headerTemplate
:
"<span style='color: '>
本次收
款金额 </span>"
,
locked
:
false
locked
:
false
}],
}],
loadComplete
:
function
(
grid
)
{
loadComplete
:
function
(
grid
)
{
...
...
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