public function setFields()
{
-
$tabOrder = 'Commande';
$this->addField(['name' => 'company',
'column' => true,
]);
+ $this->addField(['name' => 'id',
+ 'label' => 'Commande #',
+ 'type' => 'Text',
+ 'attributes' => [
+ 'readonly'=>'readonly',
+ 'disabled'=>'disabled',
+ ],
+ ]);
+
+ foreach ($this->fields as $fields) {
+ if ($fields['name'] === 'products') {
+ $fields = ['name' => 'products',
+ 'label' => 'Produits',
+ 'type' => 'Table',
+ 'columns' => ['id' => '#', 'ref' => 'Référence options', 'reference' => 'Référence produit', 'name' => 'Nom de produit', 'quantity' => 'Quantité'],
+ 'tab' => $tabOrder];
+
+ $this->addField($fields);
+ }
+
+ if ($fields['name'] === 'total') {
+ $fields['tab'] = $tabOrder;
+
+ $this->addField($fields);
+ }
+
+ }
+
$this->addField(['name' => 'status',
'label' => 'Status',
'type' => 'SelectFromArray',
'column' => true,
'tab' => $tabOrder]);
-
foreach ($this->fields as $fields) {
- if ($fields['name'] === 'products') {
- $fields = ['name' => 'products',
- 'label' => 'Produits',
- 'type' => 'Table',
- 'columns' => ['id' => '#', 'ref' => 'Référence options', 'reference' => 'Référence produit', 'name' => 'Nom de produit', 'quantity' => 'Quantité'],
- 'tab' => $tabOrder];
- }
- if ($fields['name'] === 'total') {
- $fields['tab'] = $tabOrder;
- }
-
if ($fields['name'] === 'user_id') {
$fields['label'] = 'Utilisateur';
$fields['tab'] = 'Infos client';
$this->addField($fields);
}
-
-
parent::setFields();
}