Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄成意
/
php_frq_api
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
143a8bfc
authored
Mar 31, 2021
by
hcy001
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
1
parent
a4b9a7bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
app/Model/InquiryItemsReportModel.php
app/Model/InquiryItemsReportModel.php
View file @
143a8bfc
...
...
@@ -130,19 +130,20 @@ class InquiryItemsReportModel extends Model
$quote_id
=
$data
[
"quote_id"
];
#报价id
$status
=
$data
[
"status"
];
#状态: 2 选中 3 确定
$delivery_time
=
$data
[
"delivery_time"
];
#货期
$price
=
@
$data
[
"price"
]
?
$data
[
"price"
]
:
0
;
#销售报价
$
sale_
price
=
@
$data
[
"price"
]
?
$data
[
"price"
]
:
0
;
#销售报价
if
(
$inquiry_items_id
<=
0
)
return
[
1001
,
"询价明细ID不得为空"
];
if
(
$quote_id
<=
0
)
return
[
1001
,
"报价ID不得为空"
];
$QuoteModel
=
new
QuoteModel
();
$CommonModel
=
new
CommonModel
();
$InquiryItemsModel
=
new
InquiryItemsModel
();
$quoteItem
=
$QuoteModel
->
where
(
"id"
,
$quote_id
)
->
first
()
->
toArray
();
$currency
=
$quoteItem
[
"currency"
];
#报价币种
$inquiry
=
(
new
InquiryModel
())
->
select
(
"currency"
)
->
where
(
"id"
,
$quoteItem
[
"inquiry_id"
])
->
first
()
->
toArray
();
$mainCurrency
=
$inquiry
[
"currency"
];
#询价主单币种
$rate
=
(
new
CommonModel
())
->
getRate
(
$mainCurrency
);
#获取汇率
$itemInfo
=
$InquiryItemsModel
->
select
(
"status"
,
"goods_name"
)
->
where
(
"id"
,
$inquiry_items_id
)
->
first
()
->
toArray
();
#询价明细
...
...
@@ -157,12 +158,16 @@ class InquiryItemsReportModel extends Model
return
[
1007
,
"请先撤销已确认的报价"
];
}
$price_rmb
=
$price_origin
=
""
;
if
(
$mainCurrency
==
1
){
#询价币种人民币
$price_rmb
=
$currency
!=
$mainCurrency
?
round
(
$price
*
$rate
,
6
)
:
$price
;
$price_rmb
=
$price_origin
=
""
;
if
(
$mainCurrency
==
1
&&
$currency
!=
$mainCurrency
){
#询价币种人民币
$rate1
=
$CommonModel
->
getRate
(
$currency
);
#获取汇率
$price_rmb
=
round
(
$sale_price
*
$rate1
,
6
);
}
if
(
$mainCurrency
>
1
){
#询价币种美金
$price_origin
=
$currency
!=
$mainCurrency
?
round
(
$price
/
$rate
,
6
)
:
$price
;
if
(
$mainCurrency
>
1
&&
$currency
!=
$mainCurrency
){
#询价单其他币种转人民币
$rate2
=
$CommonModel
->
getRate
(
$currency
);
#转人民币汇率
$rate3
=
$CommonModel
->
getRate
(
$mainCurrency
);
#获取汇率
$salePrice
=
$sale_price
*
$rate2
;
$price_origin
=
round
(
$salePrice
/
$rate3
,
6
);
}
$temp
=
[
...
...
@@ -182,7 +187,7 @@ class InquiryItemsReportModel extends Model
"raw_brand_name"
=>
$quoteItem
[
"raw_brand_name"
],
"price_rmb"
=>
$price_rmb
,
"price_origin"
=>
$price_origin
,
"price_profile"
=>
$price
,
"price_profile"
=>
$
sale_
price
,
"inquiry_number"
=>
$quoteItem
[
"quote_number"
],
"delivery_time"
=>
$delivery_time
,
"batch"
=>
$quoteItem
[
"batch"
],
...
...
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