<?php /* * ---------------------------------------------------------------------- * REPORT - SALES BY ORDER: CONTROL * ---------------------------------------------------------------------- */ include "get.php"; include "update.php"; $_get = new REPORT_GET(); $_update = new REPORT_UPDATE(); if (isset($_GET['date_start'])) { $date_start = $_GET['date_start'] . ' 00:00:00'; } else { $date_start = '0000-00-00 00:00:00'; } if (isset($_GET['date_end'])) { $date_end = $_GET['date_end'] . ' 23:59:59'; } else { $date_end = '9999-01-01 23:59:59'; } if ($date_start != null) { $root_sales_detail = $_get->find_total_sales($date_start, $date_end); $root_sales_detail_usd = $_get->find_total_sales_usd($date_start, $date_end); $sales_orders = $_get->find_sales($date_start, $date_end); } else { $root_sales_detail = $_get->find_total_sales(); $sales_orders = $_get->find_sales(); } if ($root_sales_detail->currency == 'USD$') { $root_sales_detail->subtotal = $root_sales_detail->subtotal * $root_sales_detail->currency_rate;
<?php /* * ---------------------------------------------------------------------- * REPORT - INVENTORY: CONTROL * ---------------------------------------------------------------------- */ include "get.php"; include "update.php"; $_get = new REPORT_GET(); $_update = new REPORT_UPDATE(); if (isset($_REQUEST['root'])) { $root = $_get->get_cat_id(filter_var($_REQUEST['root'], FILTER_SANITIZE_NUMBER_INT)); $root_name = $root->category_name; $root = $root->category_id; } else { $root = 'top'; $root_name = "All Categories"; } if (isset($_GET['date_start'])) { $date_start = $_GET['date_start']; } else { $date_start = '0000-00-00 00:00:00'; } if (isset($_GET['date_end'])) { $date_end = $_GET['date_end']; } else { $date_end = '9999-01-01 23:59:59'; } $iteration = $_get->iterate_category($root, 'all'); $root_sales_detail = $_get->find_sales($root);
<?php /* * ---------------------------------------------------------------------- * REPORT - SALES BY CATEGORIES: CONTROL * ---------------------------------------------------------------------- */ include "get.php"; include "update.php"; $_get = new REPORT_GET(); $_update = new REPORT_UPDATE(); if (isset($_GET['date_start'])) { $date_start = $_GET['date_start'] . ' 00:00:00'; } else { $date_start = '0000-00-00 00:00:00'; } if (isset($_GET['date_end'])) { $date_end = $_GET['date_end'] . ' 23:59:59'; } else { $date_end = '9999-01-01 23:59:59'; } $iteration = $_get->iterate_category('top', 'all'); $root_sales_detail = $_get->find_sales_root('top'); $root_sales_detail_usd = $_get->find_sales_root_usd('top'); $root_sales_detail_usd->subtotal = $root_sales_detail_usd->subtotal * $root_sales_detail_usd->currency_rate; $root_sales_detail_usd->discount = $root_sales_detail_usd->discount * $root_sales_detail_usd->currency_rate; $root_sales_detail->subtotal = $root_sales_detail->subtotal + $root_sales_detail_usd->subtotal; $root_sales_detail->discount = $root_sales_detail->discount + $root_sales_detail_usd->discount; //$root_sales_detail->subtotal = $root_sales_detail->subtotal; //$root_sales_detail->discount = $root_sales_detail->discount; //$root_sales_detail->subtotal = $root_sales_detail_usd->subtotal;