@section('detail-info') @php $datenow = date("Y-m-d H:i:s"); use App\Lib\MyHelper; $grantedFeature = session('granted_features'); @endphp
  • Status @if( empty($deals['step_complete']) ) Not Complete @else Started @endif
  • Creator {{$deals['created_by_user']['name']??''}}
  • Level {{$deals['created_by_user']['level']??''}}
  • Deals Type @if (!empty($deals['is_online']) && !empty($deals['is_offline'])) {{'Online, Offline'}} @elseif (!empty($deals['is_online'])) {{'Online'}} @elseif (!empty($deals['is_offline'])) {{'Offline'}} @endif
Brand
: @if (!empty($deals['id_brand'])) {{ $deals['brand']['name_brand'] }} @else @php foreach ($deals['brands'] as $key => $value) { if ($key == 0) { $comma = ''; }else{ $comma = ', '; } echo $comma.$value['name_brand']; } @endphp @endif
Brand Rule
: {{ $deals['brand_rule'] && $deals['brand_rule'] == 'and' ? 'All selected brands' : 'One of the selected brands' }}
Charged Central
: {{$deals['charged_central']}} %
Charged Outlet
: {{$deals['charged_outlet']}} %
Created
: {{date("d M Y", strtotime($deals['created_at']))}} {{date("H:i", strtotime($deals['created_at']))}}
{{--
Product Type
: {{ $deals['product_type']??'' }}
Total Voucher
: {{ !empty($deals['deals_total_voucher']) ? number_format($deals['deals_total_voucher']).' Vouchers' : (isset($deals['deals_total_voucher']) ? 'unlimited' : '') }}
Used Voucher
: {{ number_format($deals['deals_total_used']??0).' Vouchers' }}
--}}
User Limit
: {{ $deals['user_limit']??false ? number_format($deals['user_limit']).' Times usage' : 'Unlimited' }}
Voucher Expiry
: {{ ($deals['deals_voucher_duration']??false) ? 'By Duration ( '.number_format($deals['deals_voucher_duration']).' Days )' : (($deals['deals_voucher_expired']??false) ? 'By Date ( '.date("d M Y", strtotime($deals['deals_voucher_expired'])).' '.date("H:i", strtotime($deals['deals_voucher_expired'])).' )' : '-') }}
Voucher Start
: {{ $deals['deals_voucher_start']??false ? date("d M Y", strtotime($deals['deals_voucher_start'])) : '-' }}
Image
:
{{--
Warning Image
:
@if(empty($deals['deals_warning_image'])) Use Global @else @endif
--}} @if(MyHelper::hasAccess([112], $grantedFeature)) @endif
@if (!empty($deals['is_offline']))
Voucher Offline Rules
@if ( !empty($deals['deals_promo_id_type']) )
@if ($deals['deals_promo_id_type'] == 'promoid') {{ 'Promo Id' }} @else {{ 'Nominal' }} @endif
: @if (isset($deals['deals_promo_id'])) @if (is_integer($deals['deals_promo_id'])) {{ number_format($deals['deals_promo_id']) }} @else {{ $deals['deals_promo_id'] }} @endif {{-- expr --}} @endif
@else No Deals Rules @endif
@endif @if (!empty($deals['is_online']))
Voucher Online Rules : {{ $deals['promo_type']??'' }}
@if ( !empty($deals['product_rule']) && ((isset($deals['deals_promotion_product_discount_rules']['is_all_product']) && $deals['deals_promotion_product_discount_rules']['is_all_product'] == 0) || !empty($deals['deals_promotion_tier_discount_rules']) || !empty($deals['deals_promotion_buyxgety_rules']) || (isset($deals['deals_promotion_discount_bill_rules']['is_all_product']) && $deals['deals_promotion_discount_bill_rules']['is_all_product'] == 0) ) )
Product Rule
: {{ $deals['product_rule'] && $deals['product_rule'] == 'and' ? 'All items must be present' : 'One of the items must exist' }}
@endif @include('promocampaign::template.promo-global-requirement-detail', ['promo_source' => 'deals_promotion']) @if ( !empty($deals['deals_promotion_product_discount_rules']) || !empty($deals['deals_promotion_tier_discount_rules']) || !empty($deals['deals_promotion_buyxgety_rules']) || !empty($deals['deals_promotion_discount_bill_rules']) || !empty($deals['deals_promotion_discount_delivery_rules']) ) @php $promo_product = $deals['deals_promotion_product_discount'] ?: $deals['deals_promotion_tier_discount_product'] ?: $deals['deals_promotion_buyxgety_product_requirement'] ?: $deals['deals_promotion_discount_bill_products'] ?: []; $promo_product_simple = []; foreach ($promo_product as $value) { $variant = []; foreach ($value['product_variant_pivot'] as $val) { $variant[] = $val['product_variant']['product_variant_name']; } $variant = implode(', ',$variant); $promo_product_simple[] = [ 'brand' => $value['brand']['name_brand']??$deals['brand']['name_brand']??'', 'product_code' => $value['product']['product_code'], 'product_name' => $value['product']['product_name'], 'variant' => $variant ]; } @endphp {{-- Product Discount --}} @if (isset($deals['deals_promotion_product_discount_rules']) && $deals['deals_promotion_product_discount_rules'] != null)
Product Requirement
: @if ($deals['deals_promotion_product_discount_rules'] != null) @if ($deals['deals_promotion_product_discount_rules']['is_all_product'] == '1') All Product @elseif ($deals['deals_promotion_product_discount_rules']['is_all_product'] == '0') Selected Product @else No Product Requirement @endif @elseif ($deals['deals_promotion_tier_discount_rules'] != null) {{$deals['deals_promotion_tier_discount_product']['product']['product_name']}} @elseif ($deals['deals_promotion_buyxgety_rules'] != null) {{$deals['deals_promotion_buyxgety_product_requirement']['product']['product_name']??''}} @endif
@if ($deals['deals_promotion_product_discount_rules'] != null)
Discount
: @if ($deals['deals_promotion_product_discount_rules']['discount_type'] == 'Percent') {{$deals['deals_promotion_product_discount_rules']['discount_value']}} % {{ !empty($deals['deals_promotion_product_discount_rules']['max_percent_discount']) ? '(Max : IDR '.number_format($deals['deals_promotion_product_discount_rules']['max_percent_discount']).') ' : '' }} @elseif ($deals['deals_promotion_product_discount_rules']['discount_type'] == 'Nominal') {{ 'IDR '.number_format($deals['deals_promotion_product_discount_rules']['discount_value']) }} @else No discount @endif
Min Basket Size
: {{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
Max Product
: {{ ($deals['deals_promotion_product_discount_rules']['max_product'] == 0) ? 'no limit' : number_format($deals['deals_promotion_product_discount_rules']['max_product']).' item' }}
@endif
@if ($deals['deals_promotion_product_discount_rules'] != null) @if(isset($deals['deals_promotion_product_discount_rules']['is_all_product']) && $deals['deals_promotion_product_discount_rules']['is_all_product'] == '0') @foreach($promo_product_simple as $res) @endforeach
Brand Code Name Variant
{{ $res['brand'] }} {{ $res['product_code'] }} {{ $res['product_name']??'' }} {{ $res['variant'] }}
@endif @endif
{{-- Tier Discount --}} @elseif (isset($deals['deals_promotion_tier_discount_rules']) && $deals['deals_promotion_tier_discount_rules'] != null)
Min Basket Size
: {{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
Product Requirement
: @if ( ($deals['deals_promotion_tier_discount_rules'][0]['is_all_product'] ?? false) == '1' ) All Product @elseif ( ($deals['deals_promotion_tier_discount_rules'][0]['is_all_product'] ?? false) == '0' ) Selected Product @endif {{-- @if ( isset($deals['deals_promotion_tier_discount_product']) ) @if (!empty($deals['deals_promotion_tier_discount_product']['product_group'])) {{ ($deals['deals_promotion_tier_discount_product']['product_group']['product_group_code']??'').' - '.($deals['deals_promotion_tier_discount_product']['product_group']['product_group_name']??'') }} @else {{ ($deals['deals_promotion_tier_discount_product']['product']['product_code']??'').' - '.($deals['deals_promotion_tier_discount_product']['product']['product_name']??'') }} @endif @endif --}}
@if(!empty($deals['deals_promotion_tier_discount_product'])) @foreach($promo_product_simple as $res) @endforeach
Brand Code Name Variant
{{ $res['brand'] }} {{ $res['product_code'] }} {{ $res['product_name']??'' }} {{ $res['variant'] }}
@endif
Promo Rule
:
@foreach($deals['deals_promotion_tier_discount_rules'] as $res) @endforeach
Min Qty Max Qty {{ ($deals['deals_promotion_tier_discount_rules'][0]['discount_type']??'').' Discount' }}
{{ number_format($res['min_qty']) }} {{ number_format($res['max_qty']) }} {{ ($deals['deals_promotion_tier_discount_rules'][0]['discount_type'] == 'Percent') ? ( $res['discount_value'].' % (Max : IDR '.number_format($res['max_percent_discount']).')' ) : ('IDR '.number_format($res['discount_value'])) }}
{{-- Buy X Get Y Discount --}} @elseif (isset($deals['deals_promotion_buyxgety_rules']) && $deals['deals_promotion_buyxgety_rules'] != null)
Min Basket Size
: {{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
Product Requirement
: @if ( ($deals['deals_promotion_buyxgety_rules'][0]['is_all_product'] ?? false) == '1' ) All Product @elseif ( ($deals['deals_promotion_buyxgety_rules'][0]['is_all_product'] ?? false) == '0' ) Selected Product @endif {{-- @if ( isset($deals['deals_promotion_buyxgety_product_requirement']) ) @if (!empty($deals['deals_promotion_buyxgety_product_requirement']['product_group'])) {{ ($deals['deals_promotion_buyxgety_product_requirement']['product_group']['product_group_code']??'').' - '.($deals['deals_promotion_buyxgety_product_requirement']['product_group']['product_group_name']??'') }} @else {{ ($deals['deals_promotion_buyxgety_product_requirement']['product']['product_code']??'').' - '.$deals['deals_promotion_buyxgety_product_requirement']['product']['product_name']??'' }} @endif @endif --}}
@if(!empty($deals['deals_promotion_buyxgety_product_requirement'])) @foreach($promo_product_simple as $res) @endforeach
Brand Code Name Variant
{{ $res['brand'] }} {{ $res['product_code'] }} {{ $res['product_name']??'' }} {{ $res['variant'] }}
@endif
Promo Rule
:
@foreach($deals['deals_promotion_buyxgety_rules'] as $res) @php $variant = []; foreach ($res['product_variant_pivot'] as $val) { $variant[] = $val['product_variant']['product_variant_name']; } foreach ($res['deals_buyxgety_product_modifiers'] as $mod) { $variant[] = $mod['modifier']['text_detail_trx']; } $variant = implode(', ',$variant); @endphp @endforeach
Min Qty Max Qty Product Benefit Product Benefit Variant Benefit Qty Benefit Discount
{{ $res['min_qty_requirement'] }} {{ $res['max_qty_requirement'] }} {{ $res['product']['product_code'].' - '.$res['product']['product_name'] }} {{ $variant }} {{ $res['benefit_qty'] }} @if( ($res['discount_type']??false) == 'nominal' ) {{'IDR '.number_format($res['discount_value'])}} @elseif( ($res['discount_type']??false) == 'percent' ) @if( ($res['discount_value']??false) == 100 ) Free @else {{ ($res['discount_value']??false).'% (Max : IDR '.number_format($res['max_percent_discount']).')' }} @endif @endif {{ ( ($res['discount_percent']??'') == 100) ? 'Free' : ( ($res['discount_percent']??false) ? $res['discount_percent'].' % (Max : IDR '.number_format($res['max_percent_discount']).')' : (($res['discount_nominal']??false) ? 'IDR '.number_format($res['discount_nominal']) : '' ) ) }}
{{-- Bill Discount --}} @elseif (!empty($deals['deals_promotion_discount_bill_rules']))
Discount
: @if ($deals['deals_promotion_discount_bill_rules']['discount_type'] == 'Percent') {{ $deals['deals_promotion_discount_bill_rules']['discount_value'] }} % @if (!empty($deals['deals_promotion_discount_bill_rules']['max_percent_discount'])) (max: IDR {{ number_format($deals['deals_promotion_discount_bill_rules']['max_percent_discount']) }}) @endif @elseif ($deals['deals_promotion_discount_bill_rules']['discount_type'] == 'Nominal') {{ 'IDR '.number_format($deals['deals_promotion_discount_bill_rules']['discount_value']) }} @else No discount @endif
Min Basket Size
: {{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
@if ($deals['deals_promotion_discount_bill_rules'] != null) @if(isset($deals['deals_promotion_discount_bill_rules']['is_all_product']) && $deals['deals_promotion_discount_bill_rules']['is_all_product'] == '0') @foreach($promo_product_simple as $res) @endforeach
Brand Code Name Variant
{{ $res['brand'] }} {{ $res['product_code'] }} {{ $res['product_name']??'' }} {{ $res['variant'] }}
@endif @endif
{{-- Delivery Discount --}} @elseif (!empty($deals['deals_promotion_discount_delivery_rules']))
Discount
: @if ($deals['deals_promotion_discount_delivery_rules']['discount_type'] == 'Percent') {{ $deals['deals_promotion_discount_delivery_rules']['discount_value'] }} % @if (!empty($deals['deals_promotion_discount_delivery_rules']['max_percent_discount'])) (max: IDR {{ number_format($deals['deals_promotion_discount_delivery_rules']['max_percent_discount']) }}) @endif @elseif ($deals['deals_promotion_discount_delivery_rules']['discount_type'] == 'Nominal') {{ 'IDR '.number_format($deals['deals_promotion_discount_delivery_rules']['discount_value']) }} @else No discount @endif
Min Basket Size
: {{ ($deals['min_basket_size'] == 0) ? 'no min basket size' : 'IDR '.number_format($deals['min_basket_size']) }}
@elseif (isset($deals['deals_discount_global_rule']) && $deals['deals_discount_global_rule'] != null) @if ($deals['deals_discount_global_rule'] != null)
Discount
: @if ($deals['deals_discount_global_rule']['discount_type'] == 'Percent') {{ $deals['deals_discount_global_rule']['discount_value'] }} % @elseif ($deals['deals_discount_global_rule']['discount_type'] == 'Nominal') {{ 'IDR '.number_format($deals['deals_discount_global_rule']['discount_value']) }} @else No discount @endif
@endif @endif @if(MyHelper::hasAccess([112], $grantedFeature)) @endif @else No Deals Rules @endif
@endif
@endsection @section('detail-style') @endsection @section('detail-script') @endsection