Bladeren bron

Merge branch 'develop' of https://forge.laclic.fr/Laclic/CaracoleBundle into develop

packProduct
Guillaume 2 jaren geleden
bovenliggende
commit
a426ce82f6
3 gewijzigde bestanden met toevoegingen van 57 en 41 verwijderingen
  1. +4
    -0
      Builder/User/UserMerchantBuilder.php
  2. +48
    -40
      Definition/Field/Credit/CreditHistoryFieldDefinition.php
  3. +5
    -1
      Resources/views/admin/order/field/delivery_type.html.twig

+ 4
- 0
Builder/User/UserMerchantBuilder.php Bestand weergeven

@@ -35,6 +35,10 @@ class UserMerchantBuilder

$this->entityManager->create($userMerchant);
$this->entityManager->flush();
}elseif(!$userMerchant->getActive()){
$userMerchant->setActive(true);
$this->entityManager->update($userMerchant);
$this->entityManager->flush();
}

return $userMerchant;

+ 48
- 40
Definition/Field/Credit/CreditHistoryFieldDefinition.php Bestand weergeven

@@ -19,58 +19,66 @@ class CreditHistoryFieldDefinition extends AbstractFieldDefinition
public function configureIndex(): array
{
return [
'id',
'type',
'amount',
'paidAt',
'meanPayment',
'reference',
'comment',
'id',
'type',
'amount',
'paidAt',
'meanPayment',
'reference',
'comment',
];
}

public function configureForm(): array
{
return [
'type',
'amount',
'paidAt',
'meanPayment',
'reference',
'comment',
'type',
'amount',
'paidAt',
'meanPayment',
'reference',
'comment',
];
}

public function configureFields(): array
{
return [
'id' => IdField::new('id')->hideOnForm(),
'type' => ChoiceField::new('type')
->setChoices(
$this->translatorAdmin->transChoices(
CreditHistorySolver::getTypeChoices(),
'CreditHistory',
'type'
)
),
'amount' => NumberField::new('amount')
->setTemplatePath('@LcCaracole/admin/credit/field/amount.html.twig')
->setCustomOption('appendHtml', '€'),
'paidAt' => DateField::new('paidAt')->setFormTypeOption('required', true)
->setTemplatePath('@LcCaracole/admin/credit/field/paidAt.html.twig'),
'meanPayment' => ChoiceField::new('meanPayment')
->setChoices(
$this->translatorAdmin->transChoices(
OrderPaymentSolver::getMeanPaymentChoices(),
'OrderPayment',
'meanPayment'
)
)->setFormTypeOption('required', true)
->setTemplatePath('@LcCaracole/admin/credit/field/meanPayment.html.twig'),
'reference' => TextField::new('reference')
->setTemplatePath('@LcCaracole/admin/credit/field/reference.html.twig'),
'comment' => TextField::new('comment')
->setTemplatePath('@LcCaracole/admin/credit/field/comment.html.twig'),
'id' => IdField::new('id')
->setSortable(true),
'type' => ChoiceField::new('type')
->setChoices(
$this->translatorAdmin->transChoices(
CreditHistorySolver::getTypeChoices(),
'CreditHistory',
'type'
)
)
->setSortable(true),
'amount' => NumberField::new('amount')
->setTemplatePath('@LcCaracole/admin/credit/field/amount.html.twig')
->setCustomOption('appendHtml', '€')
->setSortable(false),
'paidAt' => DateField::new('paidAt')
->setFormTypeOption('required', true)
->setTemplatePath('@LcCaracole/admin/credit/field/paidAt.html.twig')
->setSortable(false),
'meanPayment' => ChoiceField::new('meanPayment')
->setChoices(
$this->translatorAdmin->transChoices(
OrderPaymentSolver::getMeanPaymentChoices(),
'OrderPayment',
'meanPayment'
)
)->setFormTypeOption('required', true)
->setTemplatePath('@LcCaracole/admin/credit/field/meanPayment.html.twig')
->setSortable(true),
'reference' => TextField::new('reference')
->setTemplatePath('@LcCaracole/admin/credit/field/reference.html.twig')
->setSortable(false),
'comment' => TextField::new('comment')
->setTemplatePath('@LcCaracole/admin/credit/field/comment.html.twig')
->setSortable(false),

];
}

+ 5
- 1
Resources/views/admin/order/field/delivery_type.html.twig Bestand weergeven

@@ -1 +1,5 @@
{{ field.value|sov_trans_admin_choice('deliveryType', 'OrderShop') }}
{% if field.value is not null %}
{{ field.value|sov_trans_admin_choice('deliveryType', 'OrderShop') }}
{% else %}
Pas de livraison
{% endif %}

Laden…
Annuleren
Opslaan