Przeglądaj źródła

[Administration] Distributions > quantités restantes : problème valeur miches À pain de loup #1255

feature/souke
Guillaume Bourgeois 1 rok temu
rodzic
commit
e8778d9a2d
3 zmienionych plików z 12 dodań i 6 usunięć
  1. +3
    -0
      backend/controllers/DistributionController.php
  2. +5
    -2
      backend/web/js/vuejs/distribution-index.js
  3. +4
    -4
      common/logic/Producer/Producer/Repository/ProducerRepository.php

+ 3
- 0
backend/controllers/DistributionController.php Wyświetl plik

@@ -310,6 +310,7 @@ class DistributionController extends BackendController
$productOrderArray[$productOrder->id_product] = [
'quantity' => $productOrder->quantity * Product::$unitsArray[$productOrder->unit]['coefficient'],
'unit' => $productOrder->unit,
'unit_coefficient' => Product::$unitsArray[$productOrder->unit]['coefficient'],
'price' => number_format($productOrder->price, 5),
'invoice_price' => number_format($productOrder->invoice_price, 5),
'price_with_tax' => Price::getPriceWithTax($productOrder->price, $productOrder->taxRate->value),
@@ -321,6 +322,7 @@ class DistributionController extends BackendController
$productOrderArray[$product['id']] = [
'quantity' => 0,
'unit' => $product['unit'],
'unit_coefficient' => Product::$unitsArray[$product['unit']]['coefficient'],
'price' => number_format($product['price'], 5),
'price_with_tax' => Price::getPriceWithTax($product['price'], $product['taxRate']['value']),
];
@@ -415,6 +417,7 @@ class DistributionController extends BackendController
$productOrderArray[$product['id']] = [
'quantity' => 0,
'unit' => $product['unit'],
'unit_coefficient' => Product::$unitsArray[$product['unit']]['coefficient'],
'price' => number_format($product['price'], 5),
'price_with_tax' => Price::getPriceWithTax($product['price'], $product['taxRate']['value']),
];

+ 5
- 2
backend/web/js/vuejs/distribution-index.js Wyświetl plik

@@ -1135,14 +1135,17 @@ Vue.component('order-form', {
var order = null;
var app = this;
var productQuantityOrder = 0;
var unitCoefficient = 1;

for(key in app.orders) {
order = app.orders[key];
productQuantityOrder += order.productOrder[product.id].quantity;
unitCoefficient = order.productOrder[product.id].unit_coefficient;
productQuantityOrder += order.productOrder[product.id].quantity / unitCoefficient;
}

if(app.create == 1) {
productQuantityOrder += app.order.productOrder[product.id].quantity;
unitCoefficient = app.order.productOrder[product.id].unit_coefficient;
productQuantityOrder += app.order.productOrder[product.id].quantity / unitCoefficient;
}

return product.productDistribution[0].quantity_max - productQuantityOrder;

+ 4
- 4
common/logic/Producer/Producer/Repository/ProducerRepository.php Wyświetl plik

@@ -232,7 +232,7 @@ class ProducerRepository extends AbstractRepository

public function getOnlinePaymentMinimumAmount(): float
{
$onlinePaymentMinimumAmount = $this->getConfig('option_online_payment_minimum_amount');
$onlinePaymentMinimumAmount = $this->producerSolver->getConfig('option_online_payment_minimum_amount');
if (!$onlinePaymentMinimumAmount) {
$onlinePaymentMinimumAmount = Producer::ONLINE_PAYMENT_MINIMUM_AMOUNT_DEFAULT;
}
@@ -249,8 +249,8 @@ class ProducerRepository extends AbstractRepository
public function isDocumentDisplayOrders(DocumentInterface $document): bool
{
return ($this->documentSolver->getClass($document) == 'Invoice') ?
$this->getConfig('document_display_orders_invoice') :
$this->getConfig('document_display_orders_delivery_note');
$this->producerSolver->getConfig('document_display_orders_invoice') :
$this->producerSolver->getConfig('document_display_orders_delivery_note');
}

/**
@@ -260,7 +260,7 @@ class ProducerRepository extends AbstractRepository
{
return strlen($pointSale->credit_functioning) > 0 ?
$pointSale->credit_functioning :
$this->getConfig('credit_functioning');
$this->producerSolver->getConfig('credit_functioning');
}

public function findProducersActive()

Ładowanie…
Anuluj
Zapisz