In this view, you can see details of a specific order in which you can use all the information of this accessing your order model. This view also lists the states that can exist in an order, in the status variable, which will then be used to change the status of an order.
getOrderState(status): Returns the state of the order in text depending on the language. status must be an Integer.
changeStatus(order, status): change the status of an order to any desired state. order is a JSON with the order and status the state to which you want to change, an integer.
changeDriver(order, driver): this function allows assigning or changing a driver in an order. order is a json that contains the order, driver, the id of the driver, this must be an integer.
calcSubtotal(order): calculates the total sum of the products and their ingredients
calcTax(order): calculate the tax payable in an order
calcServiceFee(order): Calculate the service fee based on the subtotal of the order and its percentage value.
calcriverTip(order): Calculate the driver's tip based on the subtotal of the order based on the percentage assigned. This only returns value for delivery type orers.
calcTotalOrder(order): calculates the total order including discounts if they exist, tips and other fees.
1 Contains the model order.status with the action ng-change using the function
changeStatus(order, order.status). To list the options that can be selected ng-repeat is used with the argument
“state in status” where the value of an option selected is
2 Contains the model
order.driver_id with the action change using the function
changeDriver(order, order.driver_id). To list the options that can be selected ng-repeat is used with the argument
“user in filteredDrivers” where the value of an option selected is
3 The customer information and models used are
4 The business and some order information and models used are
5 Here the order porducts are listed with
ng-repeat="product in order.products"
product.quantity inside the ng-repeat
product.name inside the ng-repeat
calcTotalProduct(product) inside the ng-repeat
Updated almost 5 years ago