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); | ||||
</div> | </div> | ||||
</td> | </td> | ||||
<td class="quantity-remaining infinite" v-if="product.quantity_remaining === null || order.productOrder[product.id].unit != product.unit">∞</td> | <td class="quantity-remaining infinite" v-if="product.quantity_remaining === null || order.productOrder[product.id].unit != product.unit">∞</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> |
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') ; |