louie_branch #72
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue