Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
郑小冰
/
orthopedics
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
7c44c165
authored
Dec 05, 2019
by
ice
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
增加集团同步过来的接收单的成本计算
parent
1253dd21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
src/main/java/orthopedics/controller/bookcity/RcvReceiptController.java
src/main/java/orthopedics/controller/bookcity/RcvReceiptController.java
View file @
7c44c165
...
...
@@ -3,6 +3,7 @@ package orthopedics.controller.bookcity;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.util.StringUtils
;
import
org.springframework.web.bind.annotation.*
;
import
orthopedics.controller.error.ErrorEnum
;
import
orthopedics.controller.v1.TransactionController
;
...
...
@@ -211,6 +212,14 @@ public class RcvReceiptController {
if
(
invLocator
!=
null
){
locator_code
=
invLocator
.
getLocatorCode
();
}
//找到成本
Double
cost
=
null
;
if
(
StringUtils
.
isEmpty
(
rcvReceiptLine
.
getAttribute3
())){
BigDecimal
b
=
new
BigDecimal
(
Double
.
valueOf
(
invItem
.
getPurchasePrice
())
*
0.64
);
cost
=
b
.
setScale
(
2
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
}
else
{
cost
=
Double
.
valueOf
(
rcvReceiptLine
.
getAttribute3
());
}
jsonObject
.
put
(
"id"
,
UuidUtil
.
get32UUIDString
());
jsonObject
.
put
(
"inv_code"
,
inventory
.
getInvCode
());
jsonObject
.
put
(
"subinv_code"
,
subinventory
.
getSubinvCode
());
...
...
@@ -221,7 +230,7 @@ public class RcvReceiptController {
jsonObject
.
put
(
"tx_quantity"
,
quantity
);
jsonObject
.
put
(
"source_header_id"
,
id
);
jsonObject
.
put
(
"source_line_id"
,
rcvReceiptLine
.
getId
());
BigDecimal
b
=
new
BigDecimal
(
Double
.
valueOf
(
rcvReceiptLine
.
getAttribute3
())
*
quantity
);
BigDecimal
b
=
new
BigDecimal
(
cost
*
quantity
);
Double
tx_amount
=
b
.
setScale
(
4
,
BigDecimal
.
ROUND_HALF_UP
).
doubleValue
();
jsonObject
.
put
(
"tx_amount"
,
tx_amount
);
jsonObject
.
put
(
"tx_price"
,
tx_amount
);
...
...
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