added commision page on reports

This commit is contained in:
franknstayn
2020-02-10 01:16:26 +08:00
parent 5e663d5891
commit 92e7aae7bb
7 changed files with 195 additions and 51 deletions

View File

@@ -406,5 +406,22 @@ class AdminModel extends Model
->update($data);
return $i;
}
function selectCommission(){
$i = DB::select("SELECT t.StoreName, pd.InvoiceNumber, pd.CartKey, pd.Total, pd.SubTotal, pd.Tax, pd.Currency,
(pd.Total * 0.029) AS proc_fee,
(pd.SubTotal - 0.29) AS trans_rate, ROUND(((
SELECT trans_rate) - (
SELECT proc_fee)), 2) AS commission_rate, ROUND(((
SELECT commission_rate) * 0.25), 2) AS twenty_five_percent, ROUND(((
SELECT commission_rate) * 0.05), 2) AS five_percent
FROM orders AS o
INNER JOIN payment_details AS pd ON pd.CartKey = o.CartKey
INNER JOIN teamstores AS t ON o.StoreId = t.Id
GROUP BY pd.CartKey
ORDER BY o.DateCreated");
return $i;
}
}