Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
FmTakeaway
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shangshang.dai
FmTakeaway
Commits
10ea5cfd
Commit
10ea5cfd
authored
Jun 28, 2017
by
shangshang.dai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upd 1: 启用新的入账计算方式(根据成本额度算出销售额)
parent
cfd48cd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
7 deletions
+28
-7
fmPlugin/fmPlugin.cpp
+28
-7
No files found.
fmPlugin/fmPlugin.cpp
View file @
10ea5cfd
...
@@ -201,7 +201,7 @@ bool FmPlugin::DoOrderEntry(const OrderObject *orderObject, const QString &cashi
...
@@ -201,7 +201,7 @@ bool FmPlugin::DoOrderEntry(const OrderObject *orderObject, const QString &cashi
}
}
recvArray
.
clear
();
recvArray
.
clear
();
// 写入配送费&服务费
// 写入配送费&服务费
&包装费
fee_data
=
_GetFeeData
(
orderObject
,
uuid
);
fee_data
=
_GetFeeData
(
orderObject
,
uuid
);
if
(
http
.
post
(
request_fee
,
_GetFeeData
(
orderObject
,
uuid
),
recvArray
,
20000
,
error
))
if
(
http
.
post
(
request_fee
,
_GetFeeData
(
orderObject
,
uuid
),
recvArray
,
20000
,
error
))
{
{
...
@@ -480,13 +480,34 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject, const QS
...
@@ -480,13 +480,34 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject, const QS
ProductObject
*
pObj
=
orderObject
->
proList
.
at
(
i
);
ProductObject
*
pObj
=
orderObject
->
proList
.
at
(
i
);
if
(
!
pObj
->
sub_products
.
isEmpty
())
if
(
!
pObj
->
sub_products
.
isEmpty
())
{
{
// 组合商品应收的钱
float
zh_ys_fee
=
_Penny2Dollar
(
pObj
->
price
*
pObj
->
productAmount
);
// 组合商品实际收到的钱
float
zh_ss_fee
=
zh_ys_fee
*
(
1
-
(
float
)
orderObject
->
dis_shop_fee
/
orderObject
->
product_fee
);
// 组合的成本
float
zh_cb_fee
=
0
;
foreach
(
ProductObject
*
cpObj
,
pObj
->
sub_products
)
foreach
(
ProductObject
*
cpObj
,
pObj
->
sub_products
)
{
{
float
ratio
=
(
float
)
cpObj
->
unit_ratio
/
100
;
float
ratio
=
(
float
)
cpObj
->
unit_ratio
/
100
;
// 该商品应收的钱
zh_cb_fee
+=
_Penny2Dollar
(
cpObj
->
productAmount
*
ratio
*
cpObj
->
cost
);
float
ys_fee
=
_Penny2Dollar
(
cpObj
->
price
*
cpObj
->
productAmount
);
}
// 该商品实际收到的钱
float
ss_fee
=
ys_fee
*
(
1
-
(
float
)
orderObject
->
dis_shop_fee
/
orderObject
->
product_fee
);
foreach
(
ProductObject
*
cpObj
,
pObj
->
sub_products
)
{
float
ratio
=
(
float
)
cpObj
->
unit_ratio
/
100
;
// 该商品的成本金额
float
cb_fee
=
_Penny2Dollar
(
cpObj
->
productAmount
*
ratio
*
cpObj
->
cost
);
// 该商品应收的钱 组合应收的钱*(该商品的成本/组合成本)
float
ys_fee
=
zh_ys_fee
*
(
cb_fee
/
zh_cb_fee
);
// 该商品实际收到的钱 组合实际收的钱*(该商品的成本/组合成本)
float
ss_fee
=
zh_ss_fee
*
(
cb_fee
/
zh_cb_fee
);
// // 该商品应收的钱
// float ys_fee = _Penny2Dollar(cpObj->price*cpObj->productAmount);
// // 该商品实际收到的钱
// float ss_fee = ys_fee*(1-(float)orderObject->dis_shop_fee/orderObject->product_fee);
if
(
_proMap
.
contains
(
cpObj
->
pid
))
if
(
_proMap
.
contains
(
cpObj
->
pid
))
{
{
...
@@ -495,7 +516,7 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject, const QS
...
@@ -495,7 +516,7 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject, const QS
elemet
.
qty
=
_proMap
.
value
(
cpObj
->
pid
).
qty
+
cpObj
->
productAmount
*
ratio
;
elemet
.
qty
=
_proMap
.
value
(
cpObj
->
pid
).
qty
+
cpObj
->
productAmount
*
ratio
;
elemet
.
ys_fee
=
_proMap
.
value
(
cpObj
->
pid
).
ys_fee
+
ys_fee
;
elemet
.
ys_fee
=
_proMap
.
value
(
cpObj
->
pid
).
ys_fee
+
ys_fee
;
elemet
.
ss_fee
=
_proMap
.
value
(
cpObj
->
pid
).
ss_fee
+
ss_fee
;
elemet
.
ss_fee
=
_proMap
.
value
(
cpObj
->
pid
).
ss_fee
+
ss_fee
;
elemet
.
note
=
_proMap
.
value
(
cpObj
->
pid
).
note
+
_Penny2Dollar
(
cpObj
->
productAmount
*
ratio
*
cpObj
->
cost
)
;
elemet
.
note
=
_proMap
.
value
(
cpObj
->
pid
).
note
+
cb_fee
;
_proMap
.
insert
(
cpObj
->
pid
,
elemet
);
_proMap
.
insert
(
cpObj
->
pid
,
elemet
);
}
else
}
else
...
@@ -505,7 +526,7 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject, const QS
...
@@ -505,7 +526,7 @@ QByteArray FmPlugin::_GetOrderEntryData(const OrderObject *orderObject, const QS
elemet
.
qty
=
cpObj
->
productAmount
*
ratio
;
elemet
.
qty
=
cpObj
->
productAmount
*
ratio
;
elemet
.
ys_fee
=
ys_fee
;
elemet
.
ys_fee
=
ys_fee
;
elemet
.
ss_fee
=
ss_fee
;
elemet
.
ss_fee
=
ss_fee
;
elemet
.
note
=
_Penny2Dollar
(
cpObj
->
productAmount
*
ratio
*
cpObj
->
cost
)
;
elemet
.
note
=
cb_fee
;
_proMap
.
insert
(
cpObj
->
pid
,
elemet
);
_proMap
.
insert
(
cpObj
->
pid
,
elemet
);
}
}
}
}
...
...
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