]> _ Git - pmi.git/commitdiff
done #6105 @0:30
authorsoufiane <soufiane@cubedesigners.com>
Wed, 5 Jul 2023 15:33:17 +0000 (17:33 +0200)
committersoufiane <soufiane@cubedesigners.com>
Wed, 5 Jul 2023 15:33:17 +0000 (17:33 +0200)
app/Http/Controllers/Admin/ProductBaseController.php
app/Models/Client.php
app/SubForms/Address.php

index e6d15fc6ebc099bfce0fc0358e83634ef9e77609..5820f8a11212b6c86f9265a92e2cdae52808dc8a 100644 (file)
@@ -126,7 +126,7 @@ class ProductBaseController extends CubistMagicController {
                 foreach ($specifications as $product => $specification) {
                     $data[$product]['json'] = json_encode($specification);
                 }
-
+                
                 $product = Product::find($id);
                 if($product) {
                     $changes = $this->storeAndReturnChanges($data);
index f5a186c890ed6e58a306ceff1dcf7f564dd31dbc..577d9c098995703efe4e77cbea245c19b9d5c48c 100644 (file)
@@ -71,7 +71,7 @@ class Client extends CubistMagicAbstractModel
             'label' => 'Adresse',
             'type' => 'BunchOfFieldsMultiple',
             'bunch' => 'App\SubForms\Address',
-            'column' => true,
+            'column' => false,
             'tab' => 'Informations client',
             'edit_label' => 'Éditer « %city »'
         ]);
@@ -96,9 +96,8 @@ class Client extends CubistMagicAbstractModel
         $this->addField([
            'name' => 'remember_token',
             'label' => 'remember_token',
-           'type' => 'Text',
-           'column' => true,
-            'tab' => 'Informations client'
+           'type' => 'Hidden',
+           'column' => false,
         ]);
     }
 
@@ -131,6 +130,12 @@ class Client extends CubistMagicAbstractModel
 
         $discount_array = array_combine($discount_array_save_keys,$discount_array);
 
+        dump($categoryProduct);
+
+        if(!in_array($categoryProduct, $discount_array)) {
+            $categoryProduct = 'A';
+        }
+
         if($categoryProduct && $categoryClient) {
             return $discount_array[$categoryProduct][$categoryClient];
         }
index 21f70f26b898a065ef6cc13f46c59f75ce9594fc..fedef77185df329472558a99db7a9a6cb9c5a1d8 100644 (file)
@@ -22,9 +22,9 @@ class Address extends SubForm {
         ]);
 
         $this->addField([
-            'name' => 'address',
-            'label' => "Adresse",
-            'type' => 'Textarea'
+            'name' => 'firstname',
+            'label' => "Prénom",
+            'type' => 'Text'
         ]);
 
         $this->addField([
@@ -34,9 +34,9 @@ class Address extends SubForm {
         ]);
 
         $this->addField([
-            'name' => 'firstname',
-            'label' => "Prénom",
-            'type' => 'Text'
+            'name' => 'address',
+            'label' => "Adresse",
+            'type' => 'Textarea'
         ]);
 
         $this->addField([