diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index b2c963c..e9b6dc1 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -89,7 +89,7 @@ class Kernel extends ConsoleKernel Mail::to($users)->send(new AlertBr($couponSeuil, $couponDiffusion, $couponValidity)); } } - })->weekdays()->at('7:00'); + })->everyMinute(); // ---- Sauvegarde des stats tous les jours a 23:45 $schedule->call(function () { diff --git a/app/Coupon.php b/app/Coupon.php index 326f29c..653e8c8 100644 --- a/app/Coupon.php +++ b/app/Coupon.php @@ -114,6 +114,7 @@ class Coupon extends Model 'coupon_validity_text', 'coupon_site_contact', 'coupon_legal_mentions', - 'coupon_seuil_alert' + 'coupon_seuil_alert', + 'coupon_treatment_center' ]; } diff --git a/app/Traits/GenerateBR.php b/app/Traits/GenerateBR.php index c253c20..aed8b3d 100644 --- a/app/Traits/GenerateBR.php +++ b/app/Traits/GenerateBR.php @@ -248,9 +248,12 @@ trait GenerateBR { // ---- Création code barre if($coupon->coupon_norme == 1 && strlen($contact->contact_cp)==4){ $textReduc = "Traitement ScanCoupon/HighCo Data Benelux"; - }else{ + }elseif($coupon->coupon_treatment_center == 0){ $textReduc = "• Traitement ScanCoupon •"; - } + } else { + $textReduc = "• Traitement Sogec •"; + } + $ImageFond = imagecreate(270, 20); $white = imagecolorallocate($ImageFond, 255, 255, 255); $black = imagecolorallocate($ImageFond, 0, 0, 0); diff --git a/database/migrations/2019_02_27_133440_add_treatmentcenter_to_coupons.php b/database/migrations/2019_02_27_133440_add_treatmentcenter_to_coupons.php new file mode 100644 index 0000000..b14841f --- /dev/null +++ b/database/migrations/2019_02_27_133440_add_treatmentcenter_to_coupons.php @@ -0,0 +1,32 @@ +integer('coupon_treatment_center')->default(1); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('coupon', function (Blueprint $table) { + $table->dropColumn('coupon_treatment_center'); + }); + } +} diff --git a/resources/views/coupon/create.blade.php b/resources/views/coupon/create.blade.php index b94b669..910ddbe 100644 --- a/resources/views/coupon/create.blade.php +++ b/resources/views/coupon/create.blade.php @@ -122,6 +122,12 @@ +