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
92afc429
Commit
92afc429
authored
Sep 03, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.fixBug:按税率计算金额错误问题修复
parent
60e6b5de
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
70 deletions
+74
-70
ServiceHGCG002.java
.../java/com/baosight/hggp/hg/cg/service/ServiceHGCG002.java
+7
-8
ServiceHGCG003A.java
...java/com/baosight/hggp/hg/cg/service/ServiceHGCG003A.java
+8
-4
HGCG002A.xml
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG002A.xml
+0
-0
HGCG002.js
src/main/webapp/HG/CG/HGCG002.js
+56
-55
HGCG002.jsp
src/main/webapp/HG/CG/HGCG002.jsp
+3
-3
No files found.
src/main/java/com/baosight/hggp/hg/cg/service/ServiceHGCG002.java
View file @
92afc429
...
...
@@ -216,8 +216,6 @@ public class ServiceHGCG002 extends ServiceBase {
HGCGTools
.
HgCg001A
.
updateStatus
(
hgcg002B
.
getPlanDetailId
(),
HGConstant
.
CgPlanStatus
.
S_2
);
}
}
}
/**
...
...
@@ -244,7 +242,7 @@ public class ServiceHGCG002 extends ServiceBase {
}
return
inInfo
;
}
/**
* 数据校验
*
...
...
@@ -256,16 +254,17 @@ public class ServiceHGCG002 extends ServiceBase {
String
contractNo
=
fCg002
.
getContractNo
();
HGCG002
dbCg002
=
dbCg002AMap
.
get
(
contractNo
);
AssertUtils
.
isNull
(
dbCg002
,
String
.
format
(
"合同[%s]不存在"
,
contractNo
));
AssertUtils
.
is
True
(
StringUtils
.
isBlank
(
fCg002
.
getSupName
()
),
String
.
format
(
"合同[%s]供应商为空"
,
contractNo
));
AssertUtils
.
is
True
(
StringUtils
.
isBlank
(
fCg002
.
getPurUserName
()
),
String
.
format
(
"合同[%s]采购员为空"
,
contractNo
));
AssertUtils
.
is
Empty
(
dbCg002
.
getSupName
(
),
String
.
format
(
"合同[%s]供应商为空"
,
contractNo
));
AssertUtils
.
is
Empty
(
dbCg002
.
getPurUserName
(
),
String
.
format
(
"合同[%s]采购员为空"
,
contractNo
));
AssertUtils
.
isNotEquals
(
HGConstant
.
CgContractStatus
.
S_0
,
dbCg002
.
getStatus
(),
String
.
format
(
"合同[%s]状态不是\"待审核\",不允许操作"
,
contractNo
));
AssertUtils
.
isTrue
(
fCg002
.
getAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
String
.
format
(
"合同[%s]不含税金额小于等于0,不允许操作"
,
contractNo
));
AssertUtils
.
isTrue
(
fCg002
.
getTaxIncludeAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
String
.
format
(
"合同[%s]含税金额小于等于0,不允许操作"
,
contractNo
));
AssertUtils
.
isTrue
(
dbCg002
.
getAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
String
.
format
(
"合同[%s]不含税金额小于等于0,不允许操作"
,
contractNo
));
AssertUtils
.
isTrue
(
dbCg002
.
getTaxIncludeAmount
().
compareTo
(
BigDecimal
.
ZERO
)
<=
0
,
String
.
format
(
"合同[%s]含税金额小于等于0,不允许操作"
,
contractNo
));
}
}
/**
* 提交数据
*
...
...
src/main/java/com/baosight/hggp/hg/cg/service/ServiceHGCG003A.java
View file @
92afc429
...
...
@@ -143,22 +143,26 @@ public class ServiceHGCG003A extends ServiceBase {
Long
id
=
fCg002B
.
getId
();
HGCG002B
dbCg002b
=
dbCg002BMap
.
get
(
id
);
// 总重
BigDecimal
bcReceiveQty
=
fCg002B
.
getBcReceiveQty
();
BigDecimal
bcReceiveWeight
=
fCg002B
.
getBcReceiveWeight
();
if
(
bcReceiveWeight
==
null
||
bcReceiveWeight
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
fCg002B
.
setReceiveWeight
(
fCg002B
.
getBcReceiveQty
().
multiply
(
dbCg002b
.
getPurUnitWeight
()));
fCg002B
.
setReceiveWeight
(
bcReceiveQty
.
multiply
(
dbCg002b
.
getPurUnitWeight
()));
fCg002B
.
setPurUnitWeight
(
dbCg002b
.
getPurUnitWeight
());
}
else
{
fCg002B
.
setReceiveWeight
(
bcReceiveWeight
);
fCg002B
.
setPurUnitWeight
(
bcReceiveWeight
.
divide
(
bcReceiveQty
,
3
,
RoundingMode
.
HALF_UP
));
}
// 含税总金额
BigDecimal
amount
;
if
(
HgCgConst
.
CalculationMethod
.
S1
.
equals
(
fCg002B
.
getCalculationMethod
()))
{
amount
=
fCg002B
.
getReceiveWeight
()
.
multiply
(
dbCg002b
.
getPrice
());
amount
=
bcReceiveWeight
.
multiply
(
dbCg002b
.
getPrice
());
}
else
{
amount
=
fCg002B
.
getBcReceiveQty
()
.
multiply
(
dbCg002b
.
getPrice
());
amount
=
bcReceiveQty
.
multiply
(
dbCg002b
.
getPrice
());
}
// 如果税率不为空,总金额减去税额
if
(
dbCg002b
.
getTaxRate
()
!=
null
)
{
amount
=
amount
.
subtract
(
amount
.
multiply
(
dbCg002b
.
getTaxRate
()).
divide
(
new
BigDecimal
(
"100"
)));
BigDecimal
taxRate
=
dbCg002b
.
getTaxRate
().
multiply
(
new
BigDecimal
(
"0.01"
)).
add
(
BigDecimal
.
ONE
);
amount
=
amount
.
divide
(
taxRate
,
2
,
RoundingMode
.
HALF_UP
);
}
fCg002B
.
setAmount
(
amount
);
}
...
...
src/main/java/com/baosight/hggp/hg/cg/sql/HGCG002A.xml
View file @
92afc429
This diff is collapsed.
Click to expand it.
src/main/webapp/HG/CG/HGCG002.js
View file @
92afc429
...
...
@@ -9,68 +9,69 @@ $(function () {
pageSize
:
20
,
pageSizes
:
[
20
,
50
,
70
,
100
],
},
columns
:
[
{
field
:
"operator"
,
title
:
"操作"
,
width
:
120
,
template
:
function
(
item
)
{
let
template
=
''
;
if
(
!
isBlank
(
item
.
id
)){
columns
:
[{
field
:
"operator"
,
title
:
"操作"
,
template
:
function
(
item
)
{
let
template
=
''
;
if
(
!
isBlank
(
item
.
id
))
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
',0, '
+
item
.
source
+
')" >详情</a>'
;
}
if
(
!
isBlank
(
item
.
id
))
{
//审核通过的,可以进行合同变更
if
(
item
.
status
==
2
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
',0, '
+
item
.
source
+
')" >详情</a>'
;
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
', 1, '
+
item
.
source
+
')" >合同变更</a>'
;
}
if
(
!
isBlank
(
item
.
id
)){
//审核通过的,可以进行合同变更
if
(
item
.
status
==
2
)
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
', '
+
item
.
status
+
', 1, '
+
item
.
source
+
')" >合同变更</a>'
;
}
return
template
;
}
},
{
field
:
"companyCode"
,
title
:
"公司编码"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
companyCodeBox
.
length
;
i
++
)
{
if
(
companyCodeBox
[
i
][
'companyCode'
]
===
dataItem
[
'companyCode'
])
{
return
companyCodeBox
[
i
][
'companyCode'
];
}
return
template
;
}
},
{
field
:
"companyCode"
,
title
:
"公司编码"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
companyCodeBox
.
length
;
i
++
)
{
if
(
companyCodeBox
[
i
][
'companyCode'
]
===
dataItem
[
'companyCode'
])
{
return
companyCodeBox
[
i
][
'companyCode'
];
}
return
dataItem
[
"companyCode"
];
}
},
{
field
:
"projCode"
,
title
:
"项目编码"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
projCodeBox
.
length
;
i
++
)
{
if
(
projCodeBox
[
i
][
'valueField'
]
===
dataItem
[
'projCode'
])
{
dataItem
[
'projName'
]
=
projCodeBox
[
i
][
'textField'
]
return
projCodeBox
[
i
][
'valueField'
];
}
return
dataItem
[
"companyCode"
];
}
},
{
field
:
"projCode"
,
title
:
"项目编码"
,
template
:
function
(
dataItem
)
{
for
(
let
i
=
0
;
i
<
projCodeBox
.
length
;
i
++
)
{
if
(
projCodeBox
[
i
][
'valueField'
]
===
dataItem
[
'projCode'
])
{
dataItem
[
'projName'
]
=
projCodeBox
[
i
][
'textField'
]
return
projCodeBox
[
i
][
'valueField'
];
}
return
dataItem
[
"projCode"
]
==
null
?
""
:
dataItem
[
"projCode"
];
},
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-companyCode"
,
options
.
model
[
"companyCode"
]);
inInfo
.
set
(
"inqu_status-0-approvalStatus"
,
2
);
inInfo
.
set
(
"field"
,
options
.
field
);
EiCommunicator
.
send
(
"HGSC003"
,
"projComboBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
projCodeBox
=
ei
.
getBlock
(
"projRecordByRole_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
return
dataItem
[
"projCode"
];
},
editor
:
function
(
container
,
options
)
{
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"inqu_status-0-companyCode"
,
options
.
model
[
"companyCode"
]);
inInfo
.
set
(
"inqu_status-0-approvalStatus"
,
2
);
inInfo
.
set
(
"field"
,
options
.
field
);
EiCommunicator
.
send
(
"HGSC003"
,
"projComboBox"
,
inInfo
,
{
onSuccess
:
function
(
ei
)
{
projCodeBox
=
ei
.
getBlock
(
"projRecordByRole_block_id"
).
getMappedRows
();
},
onFail
:
function
(
ei
)
{
}
},
{
async
:
false
});
var
input
=
$
(
'<input />'
);
input
.
attr
(
"name"
,
options
.
field
);
input
.
attr
(
"id"
,
options
.
field
);
input
.
appendTo
(
container
);
input
.
kendoDropDownList
({
dataSource
:
projCodeBox
,
minLength
:
0
,
dataTextField
:
"textField"
,
},
{
async
:
false
});
var
input
=
$
(
'<input />'
);
input
.
attr
(
"name"
,
options
.
field
);
input
.
attr
(
"id"
,
options
.
field
);
input
.
appendTo
(
container
);
input
.
kendoDropDownList
({
dataSource
:
projCodeBox
,
minLength
:
0
,
dataTextField
:
"textField"
,
dataValueField
:
"valueField"
,
optionLabelTemplate
:
"[#:valueField#]#:textField#"
,
valueTemplate
:
"[#:valueField#]#:textField#"
,
...
...
src/main/webapp/HG/CG/HGCG002.jsp
View file @
92afc429
...
...
@@ -39,7 +39,7 @@
<EF:EFRegion
id=
"result"
title=
"明细信息"
>
<EF:EFGrid
blockId=
"result"
autoDraw=
"override"
isFloat=
"true"
checkMode=
"row"
height=
"65vh"
>
<EF:EFColumn
ename=
"id"
cname=
"内码"
hidden=
"true"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
locked=
"true"
enable=
"false"
width=
"
8
0"
align=
"center"
/>
<EF:EFColumn
ename=
"operator"
cname=
"操作"
locked=
"true"
enable=
"false"
width=
"
11
0"
align=
"center"
/>
<EF:EFComboColumn
ename=
"source"
cname=
"数据来源"
enable=
"false"
width=
"80"
align=
"center"
defaultValue=
"1"
>
<EF:EFCodeOption
codeName=
"hggp.hpcg.receiveSource"
/>
</EF:EFComboColumn>
...
...
@@ -50,8 +50,8 @@
align=
"center"
filter=
"contains"
sort=
"true"
>
<EF:EFOptions
blockId=
"roleCompany"
textField=
"companyName"
valueField=
"companyCode"
/>
</EF:EFComboColumn>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
width=
"
12
0"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
width=
"1
0
0"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"companyName"
cname=
"公司名称"
width=
"
20
0"
enable=
"false"
readonly=
"true"
align=
"center"
/>
<EF:EFColumn
ename=
"projCode"
cname=
"项目编码"
width=
"1
4
0"
align=
"center"
required=
"true"
/>
<EF:EFColumn
ename=
"projName"
cname=
"项目名称"
enable=
"false"
width=
"130"
align=
"center"
/>
<EF:EFColumn
ename=
"contractDate"
cname=
"合同日期"
width=
"100"
align=
"center"
editType=
"date"
dateFormat=
"yyyy-MM-dd"
parseFormats=
"['yyyyMMdd']"
required=
"true"
/>
...
...
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