$svc = 0; if (!$ratedetail['service']) { $svc = $svc + $ratedetail['discountvalue'] * SVCPCT / 100; } $tax = 0; if (!$ratedetail['tax']) { $tax = $tax + $ratedetail['discountvalue'] * TAXPCT / 100; } $newamt = $ratedetail['discountvalue'] + $svc + $tax; $totamt = $totamt + $newamt; $totsvc = $totsvc + $svc; $tottax = $tottax + $tax; } $newCheckinDate = $checkindate; for ($dc = 0; $dc < $no_nights; $dc++) { modify_transaction(0, $bill_id, 1, $reserved_date, $newCheckinDate, $userid, $roomamt, $totsvc, $tottax, $roomamt, $totsvc, $tottax, 1, $rtid, '', $totamt, $curr); $newCheckinDate = date("Y-m-d", strtotime('+1 day', strtotime($newCheckinDate))); } } } } } } if (!$bill_id) { echo "<div align=\"center\"><h1>" . $_L['RSV_bill_err'] . "</h1></div>"; } else { echo "<div align=\"center\"><h1>" . $_L['RSV_bill_sccss'] . "</h1></div>"; } } else { echo "<div align=\"center\"><h1>" . $_L['RSV_billater_err'] . "</h1></div>"; }
$arrayXO = array(); $arrayXO = process_EXO_datablob($_POST['EXOdatablob']); $arrayMIS = process_EXO_datablob($_POST['MISdatablob']); if (isset($arrayXO['module']) && !empty($arrayXO['module'])) { if ($arrayXO['module'] == EBRIDGE_HOTEL) { $catMIS = HOTEL; } elseif ($arrayXO['module'] == EBRIDGE_TOUR) { $catMIS = TOUR; } elseif ($arrayXO['module'] == EBRIDGE_GOLF) { $catMIS = GOLF; } elseif ($arrayXO['module'] == EBRIDGE_VEHICLE) { $catMIS = TRANSPORT; } } $itemidMIS = get_first_itemID_by_itype($catMIS); modify_transaction(0, $arrayMIS['bill_id'], $itemidMIS, '', $arrayXO['datebooked'], $_SESSION['userid'], $arrayXO['amount'], 0, 0, $arrayXO['amount'], 0, 0, $arrayXO['count'], '', '', $arrayXO['amount'], $arrayXO['currency'], $arrayXO['XOID']); } } // This is a new checkin, so set the reservation and the reservation_room details to Checked In. if ($act && $res_id && !$id && $details_id) { // Only upate the status when last one is checked in. if ($rem_cnt == 0) { update_reservation_status($res_id, RES_CHECKIN); } get_booking_byresid($res_id, $details_id, $bookings); $book_id = $bookings['book_id']; update_resDetails_status($details_id, RES_CHECKIN); } if (!$guestid && isset($_POST['guestid'])) { $guestid = $_POST['guestid']; }
$itm = $_POST['itemid_' . $modid]; $addby = $_POST['add_by_' . $modid]; $dat = $_POST['add_date_' . $modid]; $trdate = $_POST['trans_date_' . $modid]; $std_amt = $_POST['std_amt_' . $modid]; $std_tx = $_POST['std_tax_' . $modid]; $std_sv = $_POST['std_svc_' . $modid]; $amt = $_POST['amount_' . $modid]; $tx = $_POST['tax_' . $modid]; $sv = $_POST['svc_' . $modid]; $qty = $_POST['qty_' . $modid]; $rid = $_POST['ratesid_' . $modid]; $currency = get_Currency_byTransactionID($modid); $transDetail = $_POST['transDetail_' . $modid]; $XOID = $_POST['XOID_' . $modid]; modify_transaction($modid, $id, $itm, $dat, $trdate, $addby, $std_amt, $std_sv, $std_tx, $amt, $tx, $sv, $qty, $rid, $transDetail, '', $currency, $XOID); } // add a new payment if ($id && $fop && $rcpt_amt) { if ($fop == FOP_CASH_DEP || $fop == FOP_CC_DEP) { $tgtCurrency = $_POST['DepCurrency']; $srcCurrency = $_POST['DepCurrency']; $exrate = 1; if ($fop == FOP_CASH_DEP) { $fop = FOP_CASH; $cardname = "Deposit " . $cardname; } if ($fop == FOP_CC_DEP) { $fop = FOP_CC; $cardname = "Deposit " . $cardname; }
/** * Add room charges to the bill for the date, calculate from the rate id supplied * or the default room rate. * * @ingroup INVOICE_MANAGEMENT * @param $billid [in] Invoice /Bill id * @param $roomid [in] Room id for the charge to be used. * @param $rateid [in] Rate to use in calculation of discount * @param $start [in] Start date in dd/mm/yyyy format * @param $end [in] End date in dd/mm/yyyy format * @param $userid [in] id of user adding the charges. * */ function add_roomcharges($billid, $roomid, $rateid, $start, $end, $userid) { $quantity = 1; //print "Start ".$start." End ".$end."<br/>"; $start = str_replace("/", "-", $start); list($dd, $mm, $yy) = sscanf($start, "%d-%d-%d"); $sdate = mktime(0, 0, 0, $mm, $dd, $yy); $end = str_replace("/", "-", $end); list($dd, $mm, $yy) = sscanf($end, "%d-%d-%d"); $edate = mktime(0, 0, 0, $mm, $dd, $yy); $dt = $sdate; $today = date("d/m/Y"); if (!$rateid) { // Retrieve booking rate id $rateid = get_bookingrate(get_bill_bookid($billid)); // print "Try using booking rate ".$rateid."<br/>"; } while ($dt < $edate) { $tottax = 0; $totamt = 0; $totsvc = 0; $amount = 0; $tax = 0; $svc = 0; $itemid = 0; $lrate = $rateid; $trans_date = date("d/m/Y", $dt); // print "Trans date ".$trans_date."<br/>"; $ratedetails = array(); get_rateitems($rateid, $ratedetails); $curr = get_Currency_byRateID($rateid); //print_r($ratedetails); $roomamt = 0; foreach ($ratedetails as $ratedetail) { $roomamt = $roomamt + $ratedetail['discountvalue']; $svc = 0; if (!$ratedetail['service']) { $svc = $svc + $ratedetail['discountvalue'] * SVCPCT / 100; } $tax = 0; if (!$ratedetail['tax']) { $tax = $tax + $ratedetail['discountvalue'] * TAXPCT / 100; } $newamt = $ratedetail['discountvalue'] + $svc + $tax; $totamt = $totamt + $newamt; $totsvc = $totsvc + $svc; $tottax = $tottax + $tax; } //$gross = get_ratecharges($itemid, $quantity, $roomid, $trans_date, $lrate, $std_amount, $std_tax, $std_svc, $amount, $tax, $svc); modify_transaction(0, $billid, 1, $today, $trans_date, $userid, $roomamt, $totsvc, $tottax, $roomamt, $totsvc, $tottax, $quantity, $rateid, "", $totamt, $curr); $dt = $dt + 24 * 60 * 60; } }