add coupons diffusé && mindatediffusion
This commit is contained in:
parent
e5220a1af9
commit
ff5d7d126d
7 changed files with 62 additions and 22 deletions
|
|
@ -100,6 +100,7 @@ class Coupon extends Model
|
|||
'coupon_enablelimitperiod',
|
||||
'coupon_limitperiod',
|
||||
'coupon_validity',
|
||||
'coupon_mindatediffusion',
|
||||
'coupon_maxdatediffusion',
|
||||
'coupon_maxdatevalidity',
|
||||
'coupon_thumbnail1',
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ class CampagneController extends Controller
|
|||
|
||||
// ---- Calcul de la date de fin de diffusion
|
||||
$dateFinDiffusion = "n/c";
|
||||
if($coupon->coupon_updatedate != null ){
|
||||
if($coupon->coupon_maxdatediffusion != null ){
|
||||
$dateFinDiffusion = date("d/m/Y", strtotime($coupon->coupon_maxdatediffusion));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,13 @@ trait CouponTrait {
|
|||
if($coupon->coupon_published == 0) {
|
||||
$coupons->forget($key);
|
||||
}
|
||||
|
||||
// ---- Contrôle la date de début de diffusion
|
||||
if($coupon->coupon_mindatediffusion != null){
|
||||
if(strtotime(date('Y-m-d')) < strtotime($coupon->coupon_mindatediffusion)){
|
||||
$coupons->forget($key);
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Contrôle la date de validité
|
||||
if($coupon->coupon_maxdatediffusion != null){
|
||||
|
|
@ -56,9 +63,15 @@ trait CouponTrait {
|
|||
$panierContents->forget($key);
|
||||
}
|
||||
|
||||
// ---- Contrôle la date de début de diffusion
|
||||
if($coupon->coupon_mindatediffusion != null){
|
||||
if(strtotime(date('Y-m-d')) < strtotime($coupon->coupon_mindatediffusion)){
|
||||
$panierContents->forget($key);
|
||||
}
|
||||
}
|
||||
// ---- Contrôle la date de validité
|
||||
if($coupon->coupon_maxdatevalidity != null){
|
||||
if(strtotime(date('Y-m-d')) > strtotime($coupon->coupon_maxdatevalidity)){
|
||||
if($coupon->coupon_maxdatediffusion != null){
|
||||
if(strtotime(date('Y-m-d')) > strtotime($coupon->coupon_maxdatediffusion)){
|
||||
$panierContents->forget($key);
|
||||
}
|
||||
}
|
||||
|
|
@ -90,9 +103,16 @@ trait CouponTrait {
|
|||
$panierContents->forget($key);
|
||||
}
|
||||
|
||||
// ---- Contrôle la date de début de diffusion
|
||||
if($coupon->coupon_mindatediffusion != null){
|
||||
if(strtotime(date('Y-m-d')) < strtotime($coupon->coupon_mindatediffusion)){
|
||||
$panierContents->forget($key);
|
||||
}
|
||||
}
|
||||
|
||||
// ---- Contrôle la date de validité
|
||||
if($coupon->coupon_maxdatevalidity != null){
|
||||
if(strtotime(date('Y-m-d')) > strtotime($coupon->coupon_maxdatevalidity)){
|
||||
if($coupon->coupon_maxdatediffusion != null){
|
||||
if(strtotime(date('Y-m-d')) > strtotime($coupon->coupon_maxdatediffusion)){
|
||||
$panierContents->forget($key);
|
||||
}
|
||||
}
|
||||
|
|
@ -128,6 +148,12 @@ trait CouponTrait {
|
|||
$availableToPrint = false;
|
||||
}
|
||||
|
||||
// ---- Contrôle la date de début de diffusion
|
||||
if($coupon->coupon_mindatediffusion != null){
|
||||
if(strtotime(date('Y-m-d')) < strtotime($coupon->coupon_mindatediffusion)){
|
||||
$availableToPrint = false;
|
||||
}
|
||||
}
|
||||
// ---- Contrôle la date de validité
|
||||
if($coupon->coupon_maxdatediffusion != null){
|
||||
if(strtotime(date('Y-m-d')) > strtotime($coupon->coupon_maxdatediffusion)){
|
||||
|
|
|
|||
|
|
@ -73,19 +73,24 @@
|
|||
<h4>Validité</h4>
|
||||
<div class="form-split">
|
||||
<div class="form-field">
|
||||
{!! Form::label('coupon_validity', 'Durée de validité à l\'impression *') !!}
|
||||
<span>
|
||||
{!! Form::number('coupon_validity', 30, ['class'=>'small', 'required']) !!} jours
|
||||
</span>
|
||||
{!! Form::label('coupon_mindatediffusion', 'Date de début de diffusion') !!}
|
||||
{!! Form::date('coupon_mindatediffusion') !!}
|
||||
</div>
|
||||
<div class="form-field">
|
||||
{!! Form::label('coupon_maxdatediffusion', 'Date de fin de diffusion') !!}
|
||||
{!! Form::date('coupon_maxdatediffusion') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-split">
|
||||
|
||||
<div class="form-field">
|
||||
{!! Form::label('coupon_maxdatediffusion', 'Date de fin de diffusion *') !!}
|
||||
{!! Form::date('coupon_maxdatediffusion') !!}
|
||||
</div>
|
||||
{!! Form::label('coupon_validity', 'Durée de validité à l\'impression') !!}
|
||||
<span>
|
||||
{!! Form::number('coupon_validity', 30, ['class'=>'small', 'required']) !!} jours
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
{!! Form::label('coupon_maxdatevalidity', 'Date de fin de validité *') !!}
|
||||
{!! Form::label('coupon_maxdatevalidity', 'Date de fin de validité') !!}
|
||||
{!! Form::date('coupon_maxdatevalidity') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -73,19 +73,23 @@
|
|||
<h4>Validité</h4>
|
||||
<div class="form-split">
|
||||
<div class="form-field">
|
||||
{!! Form::label('coupon_validity', 'Durée de validité à l\'impression *') !!}
|
||||
<span>
|
||||
{!! Form::number('coupon_validity', null, ['class'=>'small', 'required']) !!} jours
|
||||
</span>
|
||||
{!! Form::label('coupon_mindatediffusion', 'Date de début de diffusion') !!}
|
||||
{!! Form::date('coupon_mindatediffusion') !!}
|
||||
</div>
|
||||
<div class="form-field">
|
||||
{!! Form::label('coupon_maxdatediffusion', 'Date de fin de diffusion') !!}
|
||||
{!! Form::date('coupon_maxdatediffusion') !!}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-split">
|
||||
<div class="form-field">
|
||||
{!! Form::label('coupon_maxdatediffusion', 'Date de fin de diffusion *') !!}
|
||||
{!! Form::date('coupon_maxdatediffusion') !!}
|
||||
{!! Form::label('coupon_validity', 'Durée de validité à l\'impression') !!}
|
||||
<span>
|
||||
{!! Form::number('coupon_validity', null, ['class'=>'small', 'required']) !!} jours
|
||||
</span>
|
||||
</div>
|
||||
<div class="form-field">
|
||||
{!! Form::label('coupon_maxdatevalidity', 'Date de fin de validité *') !!}
|
||||
{!! Form::label('coupon_maxdatevalidity', 'Date de fin de validité') !!}
|
||||
{!! Form::date('coupon_maxdatevalidity') !!}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
<th>{{__('Valeur')}}</th>
|
||||
<th>{{__('Quantité') }}</th>
|
||||
<th>{{__('Qte restante') }}</th>
|
||||
<th>{{__('Qte Diffusé') }}</th>
|
||||
<th class="center">{{__('Status')}}</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
|
@ -26,6 +27,7 @@
|
|||
<td>{{ $c->coupon_value }} €</td>
|
||||
<td>{{ $c->coupon_quantity }}</td>
|
||||
<td>{{ $c->coupon_left }}</td>
|
||||
<td>{{ $c->coupon_quantity - $c->coupon_left }}</td>
|
||||
@if ( $c->coupon_published === 1)
|
||||
<td class="pub center"><i data-couponid="{{ $c->coupon_id }}" class="fas fa-check-circle green unpublish"></i></td>
|
||||
@else
|
||||
|
|
|
|||
|
|
@ -34,8 +34,9 @@
|
|||
<th>Code</th>
|
||||
<th>Libellé</th>
|
||||
<th>Valeur</th>
|
||||
<th>Quantité Totale</th>
|
||||
<th>Quantité Restante</th>
|
||||
<th>Qté Totale</th>
|
||||
<th>Qté Restante</th>
|
||||
<th>Qté Diffusé</th>
|
||||
<th>Fin de diffusion</th>
|
||||
<th>Statut</th>
|
||||
</thead>
|
||||
|
|
@ -46,6 +47,7 @@
|
|||
<td>{{ str_replace('.', ',', number_format($coupon->coupon_value, 2))}} €</td>
|
||||
<td>{{$coupon->quantity}}</td>
|
||||
<td>{{$coupon->remain}}</td>
|
||||
<td>{{$coupon->quantity - $coupon->remain}}</td>
|
||||
<td>{{ date('d/m/Y', strtotime($coupon->coupon_maxdatediffusion)) }}</td>
|
||||
<td>
|
||||
@if ( $coupon->isPrintable == 1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue