当前位置: 首页>>代码示例>>PHP>>正文


PHP Booking::getTotalBookingAmount方法代码示例

本文整理汇总了PHP中Booking::getTotalBookingAmount方法的典型用法代码示例。如果您正苦于以下问题:PHP Booking::getTotalBookingAmount方法的具体用法?PHP Booking::getTotalBookingAmount怎么用?PHP Booking::getTotalBookingAmount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Booking的用法示例。


在下文中一共展示了Booking::getTotalBookingAmount方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: totalCreditFromAllBookings

 public static function totalCreditFromAllBookings()
 {
     $bookings = Booking::where('user_id', Auth::id())->get();
     $total = 0;
     foreach ($bookings as $booking) {
         $total += Booking::getTotalBookingAmount($booking);
     }
     return $total;
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:9,代码来源:Agent.php

示例2: amendInvoice

 public static function amendInvoice($booking)
 {
     $total = Booking::getTotalBookingAmount($booking);
     $invoice = Invoice::where('booking_id', $booking->id)->first();
     if ($invoice) {
         $invoice->count = ++$invoice->count;
         $invoice->amount = $total;
         $invoice->save();
         return true;
     } else {
         $invoiceData = array('amount' => $total, 'booking_id' => $booking->id);
         Invoice::create($invoiceData);
         return false;
     }
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:15,代码来源:Invoice.php

示例3: storeAllData


//.........这里部分代码省略.........
                     $created_voucher = Voucher::create($voucher);
                     for ($c = 0; $c < count($voucher) - 6; $c++) {
                         $voucher[$c]['voucher_id'] = $created_voucher->id;
                         $RoomBooking = RoomBooking::create($voucher[$c]);
                     }
                     // voucher
                     $pdf = PDF::loadView('emails/voucher', array('voucher' => $created_voucher));
                     $pdf->save('public/temp-files/voucher' . $created_voucher->id . '.pdf');
                     //                        $hotel_users = DB::table('users')->leftJoin('hotel_user', 'users.id', '=', 'hotel_user.user_id')
                     //                            ->where('hotel_user.hotel_id', $created_voucher->hotel_id)
                     //                            ->get();
                     //
                     //                        Mail::send('emails/voucher-mail', array(
                     //                            'voucher' => Voucher::find($created_voucher->id)
                     //                        ), function ($message) use ($booking, $hotel_users,$created_voucher) {
                     //                            $message->attach('public/temp-files/voucher'.$created_voucher->id.'.pdf')
                     //                                ->subject('Booking Voucher : ' . $booking->reference_number)
                     //                                ->from('reservations@srilankahotels.travel', 'SriLankaHotels.Travel')
                     //                                ->bcc('admin@srilankahotels.travel', 'SriLankaHotels.Travel');
                     //                            if (!empty($hotel_users))
                     //                                foreach ($hotel_users as $hotel_user) {
                     //                                    $message->to($hotel_user->email, $hotel_user->first_name);
                     //                                }
                     //                        });
                 }
             }
             //Booking details
             //                $pdf = PDF::loadView('emails/booking', array('booking' => $booking));
             //                $pdf->save('public/temp-files/booking'.$booking->id.'.pdf');
             //
             $ehi_users = User::getEhiUsers();
             //
             $emails = array('tharinda@exotic-intl.com', 'lahiru@exotic-intl.com', 'umesh@exotic-intl.com');
             //
             //                Mail::send('emails/booking-mail', array(
             //                    'booking' => Booking::getBookingData($booking->id)
             //                ), function ($message) use ($booking, $emails, $ehi_users) {
             //                    $message->attach('public/temp-files/booking'.$booking->id.'.pdf')
             //                        ->subject('New Booking: ' . $booking->reference_number)
             //                        ->from('noreply@srilankahotels.com', 'SriLankaHotels.Travel')
             //                        ->bcc('admin@srilankahotels.travel', 'Admin');
             //                    foreach ($emails as $emailaddress) {
             //                        $message->to($emailaddress, 'Admin');
             //                    }
             //
             //                    if (!empty($ehi_users)) {
             //                        foreach ($ehi_users as $ehi_user) {
             //                            $message->to($ehi_user->email, $ehi_user->first_name);
             //                        }
             //                    }
             //                });
             Invoice::create(array('booking_id' => $booking->id, 'amount' => Booking::getTotalBookingAmount($booking), 'count' => 1));
             //Invoice
             $pdf = PDF::loadView('emails/invoice', array('booking' => $booking));
             $pdf->save('public/temp-files/invoice' . $booking->id . '.pdf');
             $pdf = PDF::loadView('emails/service-voucher', array('booking' => $booking));
             $pdf->save('public/temp-files/service-voucher.pdf');
             //                if ($user = $booking->user) {
             //                    Mail::send('emails/invoice-mail', array(
             //                        'booking' => Booking::getBookingData($booking->id)
             //                    ), function ($message) use ($user, $booking, $emails) {
             //                        $message->subject('Booking Invoice : ' . $booking->reference_number)
             //                            ->attach('public/temp-files/invoice'.$booking->id.'.pdf');
             //                        $message->to($user->email, $user->first_name . ' ' . $user->last_name);
             //                        $message->to('accounts@srilankahotels.travel', 'Accounts');
             //                        if (!empty($ehi_users)) {
             //                            foreach ($ehi_users as $ehi_user) {
             //                                $message->to($ehi_user->email, $ehi_user->first_name);
             //                            }
             //                        }
             //
             //                    });
             //
             //                } else {
             //
             //                    Mail::send('emails/invoice-mail', array(
             //                        'booking' => Booking::getBookingData($booking->id)
             //                    ), function ($message) use ($booking, $emails) {
             //                        $message->to($booking->email, $booking->name)
             //                            ->subject('Booking Created : ' . $booking->reference_number)
             //                            ->attach('public/temp-files/invoice'.$booking->id.'.pdf');
             //                        $message->to('accounts@srilankahotels.travel', 'Accounts');
             //                        if (!empty($ehi_users)) {
             //                            foreach ($ehi_users as $ehi_user) {
             //                                $message->to($ehi_user->email, $ehi_user->first_name);
             //                            }
             //                        }
             //                    });
             //                }
             if (!Auth::check()) {
                 Session::flash('global', 'Emails have been sent to the Respective parties');
                 return View::make('pages.message');
             }
         }
         return $booking;
     } else {
         return Redirect::back();
     }
     return Redirect::route('bookings.index');
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:101,代码来源:BookingsController.php

示例4: number_format

                </tr>
            <?php 
        }
        ?>
        <?php 
    }
    ?>
    <?php 
}
?>

    <tr>
        <th>Total</th>

        <td align="right">USD. <?php 
echo number_format(Booking::getTotalBookingAmount($booking), 2);
?>
</td>

    </tr>

</table>

<h4>Bank Details</h4>

<p><b>Beneficiary Bank</b><br>
    A/C Name: Exotic Holidays International (PVT) LTD. <br>
    MCB BANK LTD-SRI LANKA <br>
    A/C No. : 004126000591 </p>
<b>Beneficiary's Bank Address</b><br>
No. 8, Leyden BastianRoad, Colombo 01, Sri Lanka <br>
开发者ID:tharindarodrigo,项目名称:agent,代码行数:31,代码来源:invoice.php

示例5: cancelVoucher

 public function cancelVoucher($voucherid)
 {
     $percentage_charged = 0;
     $voucher = Voucher::findOrFail($voucherid);
     $daysToBooking = Voucher::getDaysToBooking($voucher)->days;
     $cancellation_policies = CancellationPolicy::where('hotel_id', $voucher->hotel_id)->get();
     foreach ($cancellation_policies as $policy) {
         if ($daysToBooking >= $policy->from && $daysToBooking <= $policy->to) {
             $percentage_charged = $policy->percentage_charged;
             break;
         } else {
             if (empty($policy->to)) {
                 $percentage_charged = $policy->percentage_charged;
                 break;
             }
         }
     }
     $bookingAmount = Voucher::getVoucherAmount($voucher);
     $cancellation_amount = $bookingAmount * $percentage_charged * 0.01;
     $voucher->val = 0;
     $voucher->cancellation_amount = $cancellation_amount;
     $voucher->save();
     $agent_user = $voucher->booking->user;
     $pdf = PDF::loadView('emails/cancellation-voucher', array('voucher' => $voucher));
     $pdf->save(public_path() . '/temp-files/cancellation-voucher.pdf');
     $hotel = Hotel::findOrFail($voucher->hotel_id);
     $hotel_users = $hotel->user;
     Mail::send('emails/cancellation-voucher-mail', array('voucher' => $voucher), function ($message) use($voucher, $agent_user, $hotel_users) {
         $message->attach(public_path() . '/temp-files/cancellation-voucher.pdf')->subject('Cancellation Voucher :' . $voucher->reference_number)->from('reservations@srilankahotels.travel');
         if (!empty($hotel_users)) {
             foreach ($hotel_users as $hotel_user) {
                 $message->to($hotel_user->email, $hotel_user->first_name);
             }
         }
         if (!empty($agent_user)) {
             $message->to($agent_user->email, $agent_user->first_name);
         }
     });
     Booking::getTotalBookingAmount($voucher->booking);
     return Redirect::back();
 }
开发者ID:tharindarodrigo,项目名称:agent,代码行数:41,代码来源:VouchersController.php


注:本文中的Booking::getTotalBookingAmount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。