}, | }, | ||||
modalAddReductionCredit:function () { | modalAddReductionCredit:function () { | ||||
$(this.$parent.$refs['addReductionCreditFormTitle']).val(this.orderProduct.title); | $(this.$parent.$refs['addReductionCreditFormTitle']).val(this.orderProduct.title); | ||||
$(this.$parent.$refs['addReductionCreditFormValue']).val(this.orderProduct.price); | |||||
$(this.$parent.$refs['addReductionCreditFormValue']).val(this.orderProduct.priceWithTaxAndReduction); | |||||
$(this.$parent.$refs['addReductionCreditFormBehaviorTaxRate']).val('tax-included').trigger('change'); | $(this.$parent.$refs['addReductionCreditFormBehaviorTaxRate']).val('tax-included').trigger('change'); | ||||
$('#modal-add-reduction-credit').modal('show'); | $('#modal-add-reduction-credit').modal('show'); | ||||
} | } |
cash: Espèce | cash: Espèce | ||||
transfer: Virement | transfer: Virement | ||||
credit: Compte prépayé | credit: Compte prépayé | ||||
transfer-gift: Transfert de bon cadeau | |||||
minimumAmountCb: "Paiement par carte bancaire : montant minimum" | minimumAmountCb: "Paiement par carte bancaire : montant minimum" | ||||
emailFrom: "Email (From) : email" | emailFrom: "Email (From) : email" | ||||
emailFromName: "Email (From) : nom" | emailFromName: "Email (From) : nom" |
public function getMarginPercent(OrderProductInterface $orderProduct) | public function getMarginPercent(OrderProductInterface $orderProduct) | ||||
{ | { | ||||
if ($this->getBuyingPrice($orderProduct)) { | |||||
if ($this->getBuyingPrice($orderProduct) && $this->getPriceWithReduction($orderProduct)) { | |||||
return $this->round(($this->getMargin($orderProduct) / $this->getPriceWithReduction($orderProduct)) * 100); | return $this->round(($this->getMargin($orderProduct) / $this->getPriceWithReduction($orderProduct)) * 100); | ||||
} else { | } else { | ||||
return 0; | return 0; |
const MEAN_PAYMENT_CREDIT = 'credit'; | const MEAN_PAYMENT_CREDIT = 'credit'; | ||||
const MEAN_PAYMENT_TRANSFER = 'transfer'; | const MEAN_PAYMENT_TRANSFER = 'transfer'; | ||||
const MEAN_PAYMENT_CASH = 'cash'; | const MEAN_PAYMENT_CASH = 'cash'; | ||||
const MEAN_PAYMENT_GIFT = 'transfer-gift'; | |||||
public function __construct(EntityManagerInterface $em, ParameterBagInterface $parameterBag, SessionInterface $session, TranslatorInterface $translator, ConfigManager $configManager, CacheManager $liipCacheHelper) | public function __construct(EntityManagerInterface $em, ParameterBagInterface $parameterBag, SessionInterface $session, TranslatorInterface $translator, ConfigManager $configManager, CacheManager $liipCacheHelper) | ||||
{ | { |