Commit 9e73fe42 by jianshuqin

修改功能:月售销利润的销售额退款自2021年10月之后除Aliexpress平台之外都使用财务汇率

parent adbddb20
......@@ -1189,27 +1189,75 @@ AND s2.datacenter_col like '%{input.FeeName}' group by s2.platform,s1.website ";
var end = start.AddMonths(1).Date;
if (isSummary)//根据平台分组明细汇总
{
sql.Append(@"select platform_type AS Platform,SUM(amount_refund_rmb) AS RefundRmb,
SUM(amount_refund_usd) AS RefundUsd,Count(*) AS Totals
from dc_base_crm_refund
where refund_time >= @start and refund_time < @end and shipping_status in ('TotalShipping','PartShipping') AND is_deleted = 0 AND is_freeze = 0 AND company_id = 1
group by platform_type ");
sql.Append(@"SELECT
t1.platform_type AS Platform
,SUM( IFNULL(ROUND( (t1.amount_refund * t2.exchange_rate),3 ),t1.amount_refund_rmb) ) AS RefundRmb
,SUM( t1.amount_refund_usd ) AS RefundUsd
,Count(*) AS Totals
FROM dc_base_crm_refund t1
LEFT JOIN dc_exchange_rate_finance t2
ON t1.order_currency = t2.`code`
AND DATE_FORMAT( t1.refund_time, '%Y-%m' ) = t2.`month`
-- 2021年10月之后除Aliexpress平台之外都使用财务汇率
AND t2.`month` >= '2021-10'
AND t1.platform_type <> 'Aliexpress'
WHERE 1 = 1
AND t1.refund_time >= @start
AND t1.refund_time < @end
AND t1.shipping_status IN ( 'TotalShipping', 'PartShipping' )
AND t1.is_deleted = 0
AND t1.is_freeze = 0
AND t1.company_id = 1
GROUP BY
t1.platform_type ");
parameters.Add("start", start);
parameters.Add("end", end);
return sql.ToString();
}
if (isSum)
{
sql.Append($@"
select sum(t1.amount_refund_rmb) AS RefundRmb,sum(t1.amount_refund_usd) AS RefundUsd from dc_base_crm_refund t1
where t1.refund_time >= @start and t1.refund_time < @end and shipping_status in ('TotalShipping','PartShipping') AND is_deleted = 0 AND is_freeze = 0 AND company_id = 1");
sql.Append($@"SELECT
SUM( IFNULL(ROUND( (t1.amount_refund * t2.exchange_rate),3),t1.amount_refund_rmb) ) AS RefundRmb
,SUM( t1.amount_refund_usd ) AS RefundUsd
FROM dc_base_crm_refund t1
LEFT JOIN dc_exchange_rate_finance t2
ON t1.order_currency = t2.`code`
AND DATE_FORMAT( t1.refund_time, '%Y-%m' ) = t2.`month`
-- 2021年10月之后除Aliexpress平台之外都使用财务汇率
AND t2.`month` >= '2021-10'
AND t1.platform_type <> 'Aliexpress'
WHERE 1 = 1
AND t1.refund_time >= @start
AND t1.refund_time < @end
AND t1.shipping_status IN ( 'TotalShipping', 'PartShipping' )
AND t1.is_deleted = 0
AND t1.is_freeze = 0
AND t1.company_id = 1 ");
}
else
{
sql.Append($@"
select t1.platform_type AS PlatformType, t1.bailun_account AS BailunAccount, t1.website AS WebSite,
t1.origin_order_id AS OriginOrderId, t1.amount_refund_rmb AS RefundRmb, t1.amount_refund_usd AS RefundUsd, t1.refund_time AS RefundTime from dc_base_crm_refund t1
where t1.refund_time >= @start and t1.refund_time < @end and shipping_status in ('TotalShipping','PartShipping') AND is_deleted = 0 AND is_freeze = 0 AND company_id = 1");
sql.Append($@"SELECT
t1.platform_type AS PlatformType
,t1.bailun_account AS BailunAccount
,t1.website AS WebSite
,t1.origin_order_id AS OriginOrderId
,IFNULL(ROUND( (t1.amount_refund * t2.exchange_rate),3),t1.amount_refund_rmb) AS RefundRmb
,t1.amount_refund_usd AS RefundUsd
,t1.refund_time AS RefundTime
FROM dc_base_crm_refund t1
LEFT JOIN dc_exchange_rate_finance t2
ON t1.order_currency = t2.`code`
AND DATE_FORMAT( t1.refund_time, '%Y-%m' ) = t2.`month`
-- 2021年10月之后除Aliexpress平台之外都使用财务汇率
AND t2.`month` >= '2021-10'
AND t1.platform_type <> 'Aliexpress'
WHERE 1 = 1
AND t1.refund_time >= @start
AND t1.refund_time < @end
AND t1.shipping_status IN ( 'TotalShipping', 'PartShipping' )
AND t1.is_deleted = 0
AND t1.is_freeze = 0
AND t1.company_id = 1 ");
}
parameters.Add("start", start);
parameters.Add("end", end);
......
......@@ -2,7 +2,7 @@
<el-header>
<el-form ref="form" label-width="auto" size="medium">
<el-row v-bind:gutter="20">
<el-col v-if="setting.listFilterControl && setting.listFilterControl.length" v-bind:span="item.colSpan || 24" v-for="(item,index) in setting.listFilterControl" v-bind:key="index">
<el-col v-if="setting.listFilterControl && setting.listFilterControl.length" v-bind:span="item.colSpan || 24" v-bind:class="{'auto-width': item.colSpan == null || item.colSpan == 'auto'}" v-for="(item,index) in setting.listFilterControl" v-bind:key="index">
<el-form-item v-bind:label="item.name" v-if="item.type">
<el-form-control v-bind:item="item" v-model="item.value"></el-form-control>
</el-form-item>
......
......@@ -11,6 +11,10 @@
margin: 0px;
}
.el-query-table .auto-width {
width: auto;
}
.el-query-table .el-header,
.el-query-table .el-main,
.el-query-table .el-footer {
......
......@@ -271,7 +271,8 @@
}
//清空排序
that.$refs.table.clearSort();
Vue.set(that, 'filterParams', { currentPage: 1, pageSize: 10, ListOrder: null });
Vue.set(that.filterParams, 'pageSize', 10);
Vue.set(that.filterParams, 'ListOrder', null);
that.onSearch(true);
},
//导出
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment