Browse Source

[Backend] Commandes : problème modification prix #553

prodstable
Guillaume Bourgeois 2 years ago
parent
commit
58770ab7be
3 changed files with 5 additions and 2 deletions
  1. +1
    -0
      backend/controllers/OrderController.php
  2. +2
    -2
      backend/views/distribution/index.php
  3. +2
    -0
      backend/web/js/vuejs/distribution-index.js

+ 1
- 0
backend/controllers/OrderController.php View File

if ($quantity) { if ($quantity) {
if ($productOrder) { if ($productOrder) {
$productOrder->quantity = $quantity; $productOrder->quantity = $quantity;
$productOrder->price = $dataProductOrder->price;
} else { } else {
$product = Product::findOne($key); $product = Product::findOne($key);



+ 2
- 2
backend/views/distribution/index.php View File

</div> </div>
</td> </td>
<td class="quantity-remaining infinite" v-if="product.quantity_remaining === null || order.productOrder[product.id].unit != product.unit">&infin;</td> <td class="quantity-remaining infinite" v-if="product.quantity_remaining === null || order.productOrder[product.id].unit != product.unit">&infin;</td>
<td class="quantity-remaining negative" v-else-if="product.quantity_remaining <= 0">{{ product.quantity_remaining }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}</td>
<td class="quantity-remaining has-quantity" v-else>{{ product.quantity_remaining }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}</td>
<td class="quantity-remaining negative" v-else-if="product.quantity_remaining <= 0">{{ product.quantity_remaining }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}</td>
<td class="quantity-remaining has-quantity" v-else>{{ product.quantity_remaining }} {{ order.productOrder[product.id].unit == 'piece' ? ' p.' : ' '+(order.productOrder[product.id].unit == 'g' || order.productOrder[product.id].unit == 'kg') ? 'kg' : 'litre(s)' }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

+ 2
- 0
backend/web/js/vuejs/distribution-index.js View File

data.append('comment', this.order.comment && this.order.comment.length ? this.order.comment : '') ; data.append('comment', this.order.comment && this.order.comment.length ? this.order.comment : '') ;
data.append('processCredit', processCredit) ; data.append('processCredit', processCredit) ;


console.log(this.order.productOrder);

axios.post(UrlManager.getBaseUrlAbsolute()+"order/ajax-update",data) axios.post(UrlManager.getBaseUrlAbsolute()+"order/ajax-update",data)
.then(function(response) { .then(function(response) {
app.$emit('ordercreatedupdated') ; app.$emit('ordercreatedupdated') ;

Loading…
Cancel
Save