Chọn thời gian
Từ
Đến  
 
getDoanhThuNgay_Apollo($chinhanh_id,$from,$end); $lamtrongio = $arr_ts['TS_LAMTRONGIO']*60; while($rw = $conn->fetchRow($rs)){ $klt_id = $rw['KLT_ID']; $ph_id = $rw['PH_ID']; $giam_gia ="" ; $tien_giamgia = 0; if($rw['KLT_THOIDIEMTRAPHONG']!=NULL){ $arrfromjson = json_decode($rw['KLT_PRICE_INFO'],true); $arr_price_add = $arrfromjson['ARR_PRICE_ADD']; $arr_ts = $arrfromjson['ARR_TS']; $arr_price_early = $arrfromjson['ARR_PRICE_EARLY']; $arr_giatheonguoi = $arrfromjson['ARR_ADD_PERSON']; $cachtinhphuthuthemnguoi = $arrfromjson['ARR_OTHER']['cachtinh_pttn']; }else{ $arr_price_early = $model->getPhuThuVaoSom($klt_id); if(empty($arr_price_early)){ $arr_price_early = $mVaoSomPhong->getToArray($ph_id); } //Tra tre $arr_price_add = $model->getPhuThuTraTre($klt_id); if(empty($arr_price_add)){ $arr_price_add = $mTraTrePhong->getToArray($ph_id); } } if($rw['CACHTINH']=='TINHTIENCHECKOUT'){ $tienphong = $rw['KLT_TIENPHONG']; $tienphong_chuagiam+=$tienphong; if($rw['KLT_KHUYENMAI']>0 && $rw['KLT_KHUYENMAI']<=100){ $tienphong = $tienphong - $rw['KLT_TIENPHONG']*$rw['KLT_KHUYENMAI']/100; }elseif($rw['KLT_KHUYENMAI']>100){ $tienphong = $tienphong - $rw['KLT_KHUYENMAI']; } if($rw['KLT_KHUYENMAI']>100){ $giam_gia = WebHelper::format_vn_number($rw['KLT_KHUYENMAI']); $tien_giamgia = $rw['KLT_KHUYENMAI']; }elseif($rw['KLT_KHUYENMAI']>0){ $giam_gia = WebHelper::format_vn_number($rw['KLT_KHUYENMAI'])."%"; $tien_giamgia = $rw['KLT_TIENPHONG']*$rw['KLT_KHUYENMAI']/100; } }elseif($rw['CACHTINH']=='TINHPHUTHUTRE'){ $giam_gia = 0; if($rw['KLT_KPTTRATRE']==0){ $staying = strtotime($rw['KLT_THOIDIEMTRAPHONG'])-$t; $h = intval($staying/3600); if($staying%3600>$lamtrongio){ $h++; } if($h>0){ $price_add = $model->getPriceByHour($h,$arr_price_add); if(empty($price_add)){ $tienphong = $rw['GIANGAY']; }else{ if($price_add['GIATRI']>100){ $tienphong = $price_add['GIATRI']; }else{ $tienphong = $rw['GIANGAY']*$price_add['GIATRI']/100; } } }else{ $tienphong = 0; } }else{ $tienphong = 0; } $tienphong_chuagiam+=$tienphong; }elseif($rw['CACHTINH']=='TINHPHUTHUSOM'){ $giam_gia = 0; if($rw['KLT_KPTVAOSOM']==0){ $staying = $t - strtotime($rw['KLT_THOIDIEMNHANPHONG']); $h = intval($staying/3600); if($staying%3600>$lamtrongio){ $h++; } if($h>0){ $price_early = $model->getPriceByHour($h,$arr_price_early); if(empty($price_early)){ $tienphong = $rw['GIANGAY']; }else{ if($price_early['GIATRI']>100){ $tienphong = $price_early['GIATRI']; }else{ $tienphong = $rw['GIANGAY']*$price_early['GIATRI']/100; } } }else{ $tienphong = 0; } }else{ $tienphong = 0; } $tienphong_chuagiam+=$tienphong; }else{ $tienphong = $rw['GIANGAY']; $tienphong_chuagiam+=$tienphong; if($rw['KLT_KHUYENMAI']>100){ $tienphong = $tienphong - $rw['KLT_KHUYENMAI']; $giam_gia = WebHelper::format_vn_number($rw['KLT_KHUYENMAI']); $tien_giamgia = $rw['KLT_KHUYENMAI']; }elseif($rw['KLT_KHUYENMAI']>0){ $tienphong = $rw['GIANGAY']*(1 - $rw['KLT_KHUYENMAI']/100); $giam_gia = WebHelper::format_vn_number($rw['KLT_KHUYENMAI'])."%"; $tien_giamgia = $rw['GIANGAY']*$rw['KLT_KHUYENMAI']/100; } } $thukhac = $rw['KLT_THUKHAC']; $trukhac = $rw['KLT_TRUKHAC']; $tienphong += $rw['KLT_THUKHAC']; $tienphong -= $rw['KLT_TRUKHAC']; $tiengiamgia_congdon += $tien_giamgia; $thukhac_congdon += $thukhac; $trukhac_congdon += $trukhac; $tiendichvu_congdon += $rw['TIENDICHVU']; $tienvondichvu_congdon += $rw['TIENVON_DICHVU']; $doanh_thu_khachsan+= $tienphong + $rw['TIENDICHVU']; } $t+=86400; } // //Doanh thu cafe $quy_nganhang = 0; $quy_ck = 0; $arr_cn_cf = array(182,373); $doanhthu_cf = $mBC->getTongHopKinhDoanhDichVu($arr_cn_cf,$ngay_bd_cf,$ngay_kt_cf); // $doanhthu_khac = $mBC->getTongThuKhacCongTy($cty_id,$ngay_bd_cf,$ngay_kt_cf); $chiphi_ks = $mChi->getTongChiNgay(181,$ngay_bd_cf,$ngay_kt_cf,true); $chiphi_cf1 = $mChi->getTongChiNgay(182,$ngay_bd_cf,$ngay_kt_cf,true); $chiphi_cf2 = $mChi->getTongChiNgay(373,$ngay_bd_cf,$ngay_kt_cf,true); $chiphi_cf = $chiphi_cf1 + $chiphi_cf2; $chiphi_khac = 0;//$mChi->getTongChiNgay(182,$ngay_bd_ks,$ngay_kt_ks); // $congno = $model->congNoCongTy($cty_id); ?>
Nội dung Số tiền Diễn giải
Doanh Thu khách sạn Tiền phòng
Giảm giá phòng
Trừ khác
Tiền phòng đã giảm
Thu khác
Doanh thu dịch vụ
Doanh thu thuần
Giá vốn dịch vụ
Lại gộp
Tổng chi phí
Lãi ròng khách sạn
Doanh Thu cà phê Doanh thu chưa giảm
Giảm giá
Trừ khác
Thu khác
Doanh thu thuần
Giá vốn hàng bán
Lãi gộp
Chi phí
Lãi ròng cà phê
TỔNG HỢP TỔNG DOANH THU THUẦN
TỔNG THU KHÁC Đã tính vào doanh thu thuần
TỔNG GIÁ VỐN HÀNG BÁN
TỔNG LẠI GỘP
TỔNG CHI PHÍ
TÔNG LÃI RÒNG