Booking, QI Content, Trees, Media
This commit is contained in:
parent
1f340e96fa
commit
7fbac395a9
260 changed files with 27160 additions and 3773 deletions
|
|
@ -107,6 +107,7 @@ class TravelUserBookingFewoRepository extends BaseRepository {
|
|||
|
||||
$model = TravelUserBookingFewo::findOrFail($id);
|
||||
$model->fill($data)->save();
|
||||
|
||||
$res = $this->calculatePriceNew($model);
|
||||
|
||||
$model->daily_prices = $res['season'];
|
||||
|
|
@ -189,7 +190,6 @@ class TravelUserBookingFewoRepository extends BaseRepository {
|
|||
return back()->withInput(Input::all())->withErrors($validator);
|
||||
}
|
||||
|
||||
$set_price = true;
|
||||
$data['is_calendar_fewo_direct'] = isset($data['is_calendar_fewo_direct']) ? true : false;
|
||||
$data['is_calendar_hrs'] = isset($data['is_calendar_hrs']) ? true : false;
|
||||
$data['is_calendar_stern_tours'] = isset($data['is_calendar_stern_tours']) ? true : false;
|
||||
|
|
@ -197,22 +197,25 @@ class TravelUserBookingFewoRepository extends BaseRepository {
|
|||
|
||||
if($id == "new") {
|
||||
$model = TravelUserBookingFewo::create($data);
|
||||
|
||||
}else{
|
||||
$model = TravelUserBookingFewo::findOrFail($id);
|
||||
if($data['from_date'] == $model->from_date && $data['to_date'] == $model->to_date){
|
||||
$set_price = false;
|
||||
}
|
||||
$model->fill($data)->save();
|
||||
}
|
||||
|
||||
$model->last_change_at = now();
|
||||
$model->save();
|
||||
|
||||
$res = $this->calculatePriceNew($model);
|
||||
$model->daily_prices = $res['season'];
|
||||
if($set_price){
|
||||
|
||||
if(isset($data['calculate_price_new'])){
|
||||
$model->price_travel = $res['price_travel'];
|
||||
$model->price_service = $res['price_service'];
|
||||
$model->price_deposit = $res['price_deposit'];
|
||||
$model->price_total = $res['price_total'] + $model->getPriceBalanceRaw();
|
||||
$model->calculate_price();
|
||||
$model->save();
|
||||
|
||||
if($fewo_reservation = $model->fewo_reservation){
|
||||
$model->fewo_reservation->from_date = $model->getFromDateRaw();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue