louie_branch #72

Merged
MarkHipe merged 13 commits from louie_branch into main 2024-04-30 14:07:17 +08:00
1 changed files with 4 additions and 3 deletions
Showing only changes of commit 2ad0c9e955 - Show all commits

View File

@ -756,13 +756,14 @@ $allSignups = array_merge($all_customers, $all_vendors);
$orderCount = 0; // Initialize order count
$dailyRevenue = 0;
foreach ($all_orders as $x => $val) {
foreach (array_reverse($all_orders) as $x => $val) {
$paymentStatus = strtolower($val['payment']['status']);
$returnStatus = strtolower($val['return_order']['status']);
$orderStatus = strtolower($val['status']);
$formattedOrderDate = date('m-d-Y', strtotime($val['order_date']));
if ($formattedOrderDate == $currentDate) {
$orderCount++;
if($paymentStatus == "paid"){
if($paymentStatus == "paid" && (!$returnStatus || $orderStatus != "returned" )){
$dailyRevenue += $val['total_amount'];
} // Increment order count for each order on the current date
}