\n$schedule_name";
include "hotlunch_reports.menu.php";
echo("
\n");
if (array_key_exists('naction',$_GET)) $naction = $_GET['naction'];
if (array_key_exists('naction',$_POST)) $naction = $_POST['naction'];
$school_num = $school_record['record_num'];
include "form.messages.php";
switch (strtolower($naction)) {
default:
?>
" . db_num_rows($orders) . "");
?>
|
|
|
$order_total) $amount_paid = $order_total;
// Calculate new order total
$order_subtotal = floatval($order_subtotal);
$order_total = floatval($order_total);
$amount_paid = floatval($amount_paid);
if ($disc > 0 && $order_subtotal > $disc) $order_total = $order_subtotal - $disc;
$order_subtotal = number_format($order_subtotal,2);
$order_total = number_format($order_total,2);
$amount_paid = number_format($amount_paid,2);
// Log the change in order total
$change_amount = $order_total - $total;
if ($change_amount != 0 && strlen($logmsg)) {
$totals = calcOrderTotal($order_num,$schedule_num,'Y');
$user_num = db_getVal("SELECT user_num FROM people WHERE school_num = $base_school_num AND record_num = $pnum");
$entered_time = time();
$trx_time = date("Y-m-d H:i:s",$entered_time);
if (strlen($logmsg)) {
$lognote = db_escape_string("#$order_num: $currencySymbol" . number_format($change_amount,2));
$query = "INSERT INTO user_account " .
"(school_num,user_num,schedule_num,transaction_datetime,transaction_type,note,transaction_amount,transaction_fee,payment_method,payment_reference,order_payments,deleted,entered_time,transaction_status) " .
"VALUES ($school_num,$user_num,$schedule_num,'$trx_time','TRX Note','$logmsg - $lognote',0,0,NULL,'',NULL,'N',$entered_time,'Closed')";
db_query($query);
$rnum = db_insert_id();
$additional_note = "#$order_num - " . getLanguageText('TEXT-PREVIOUS-ORDER-TOTAL') . ": $currencySymbol" . $total . ' => ' . getLanguageText('TEXT-NEW-ORDER-TOTAL') . ": $currencySymbol" . $totals['order_total'];
db_query("UPDATE user_account SET additional_note = '" . db_escape_string($additional_note) . "' WHERE record_num = $rnum");
}
$ototal = $totals['order_total'];
db_query("UPDATE hotlunch_order_header SET order_total = $ototal WHERE school_num = $school_num AND record_num = $order_num");
$status = getLanguageText('TEXT-UPDATED');
}
else {
$status = " - ";
}
// Get person's name
$name = $row['first_name'] . ' ' . $row['last_name'];
$class = 'data-odd';
if ($count % 2) $class = 'data-even';
$count++;
?>
|
|