*/ error_reporting(E_ALL & ~E_NOTICE); include_once dirname(__FILE__) . "/../login_check.inc.php"; include_once dirname(__FILE__) . "/../queryfunctions.php"; include_once dirname(__FILE__) . "/../functions.php"; include_once dirname(__FILE__) . "/../dailyfunc.php"; include_once dirname(__FILE__) . "/../lang/lang_en.php"; $lang = get_language(); load_language($lang); $logofile = Get_LogoFile(); access("billing"); $bill = array(); $book = array(); $guest = array(); $inv = $_GET['inv']; get_bill($inv, $bill); if ($bill['book_id']) { get_booking($bill['book_id'], $book); } else { if ($bill['reservation_id']) { get_reservation($bill['reservation_id'], $book); } } if ($book['guestid']) { get_guest($book['guestid'], $guest); } // Default page size A4 - 210mm x 297mm // Header is set to 60mm // Footer is set to 27mm // body of invoice is set to 210mm // Rough rules of thumb
include_once '_approot.php'; include_once APPROOT . '/lib/header.php'; session_check(null); $method = $_REQUEST['method']; switch ($method) { case 'initBillManageData': init_bill_manage_data(); break; case 'getBillList': get_bill_list(); break; case 'getBillRelatedList': get_bill_related_list(); break; case 'getBill': get_bill(); break; case 'updateBill': update_bill(); break; case 'deleteBill': delete_bill(); break; default: break; } /** * 初始化记账管理基本数据 */ function init_bill_manage_data() {
} } /*if($details_id){ modify_reservation_details($details_id,$res_id,$roomid,$roomtypeid,$ratesid,0,RES_CHECKIN); }*/ echo "<div align=\" center\"><h1>" . $_L['REG_success1'] . "</h1></div>"; if (!$bill_id) { $bill_id = create_booking_bill($book_id, $res_id, $guestid, $userid); if (!$bill_id) { echo "<div align=\" center\"><h1>" . $_L['REG_error2'] . "</h1></div>"; } else { echo "<div align=\" center\"><h1>" . $_L['REG_success2'] . "</h1></div>"; } } else { $bill = array(); get_bill($bill_id, $bill); modify_bill($bill_id, $bill['billno'], $book_id, $res_id, $bill['date_billed'], $bill['date_checked'], $bill['created_by'], $guestid, $bill['status'], $bill['flags']); } if ($action == ($_L['REG_checkinbox'] || $_L['BTN_update']) && $roomid) { if (!update_room_status($roomid, BOOKED)) { echo "<div><h1>" . $_L['REG_error3'] . "</h1></div>"; } else { echo "<div align=\"center\"><h1>" . $_L['REG_success3'] . "</h1></div>"; } } if ($action == $_L['REG_checkoutbox'] && $roomid) { if (!update_room_status($roomid, LOCKED)) { echo "<div><h1>" . $_L['REG_error3'] . "</h1></div>"; } else { echo "<div align=\"center\"><h1>" . $_L['REG_success4'] . "</h1></div>"; }
// retrieve the bill and set the reservation id if (!$id && sizeof($bill) == 0) { $id = $book['bill_id']; get_bill($id, $bill); $rid = $bill['reservation_id']; } } // if the reservation id is found, load the reservation if ($rid) { get_reservation($rid, $res); // if the bill is not loaded, load the invoice id from the reservation // load the bill, then attempt to load the booking detail that goes // with it. if (!$id && sizeof($bill) == 0) { $id = $res['bill_id']; get_bill($id, $bill); $bid = $bill['book_id']; get_booking($bid, $book); } } $guestid = $bill['guestid']; if (!$guestid && $book['guestid']) { $guestid = $book['guestid']; } if (!$guestid && $res['guestid']) { $guestid = $res['guestid']; } if ($book['checkindate']) { $checkin = $book['checkindate']; } if ($book['checkoutdate']) {
/** * Check if the bill has a debit balance * @param $billid [in] Id of the bill * @return 1 if true 0 if false (0 balance or credit) */ function is_bill_inDebit($billid) { $bill = array(); if (get_bill($billid, $bill)) { if (isset($bill['btotal'])) { $total = 0; foreach ($bill['btotal'] as $cur => $value) { $total += $value; if (isset($bill['rtotal'][$cur])) { $total -= $bill['rtotal'][$cur]; } } } if ($total < 0) { $total = 0; } return $total; } return 0; }