In this view all existing orders are loaded, as there are many of them, it is recommended that they are listed and paged. It is also recommended that you add filters with angular to be able to search for orders with specific data. the variable with contains all these orders is filtered this already has a special function for filtering that will then be more detailed.
filterByStatus(status): This function causes orders (filtered) to be filtered by grouped states
pending:Orders with status 0.
completed: Orders with status 1 y 11.
inProgress: Orders with status 7, 8 y 9
canceled: Orders with status 2, 5, 6, 10 y 12.
applyFilters(): This function makes filtered this filtering depending on the search model and its different attributes used to filter by several parameters.
search.id: Field to filter order by id
search.state: Field to filter order by status
search.business: Field to filter depending on what business the order is.
search.cphone: Field to filter by a customer's phone number
search.email: Field to filter by the customer's email
search.date.from: Lower bound to filter orders by date, that is, from which date
search.date.to: Upper bound to filter by date, that is, until date.
search.city: Field used to filter orders by city
calcTotal(): Calculate the total of all filtered orders taking into account everything.
openDetails(order): this function is used to open the
order_detailsmodal with all
- The tab for filter by status. the action works with click which run the function
filterByStatus(status)and the selected tab style works with curTab.
- The filters section includes all the possible filters in search model and adding a action for every change in each field with the function
- In this select are listed the business of the orders made, to list is used the following sentece data-
ng-repeat="state in status"and the value select for
- In this select are listed the cities of the orders made, to list is used the following sentence
data-ng-repeat="city in cities"and the value selected for
- In this select are listed the possible statuses for the current tab, to list is used the following sentence
data-ng-repeat="state in status"and the value selected for
- Section in which the orders with ng-repeat are listed using the argument
"order in filtered"(All orders works with pagination). Clicking in one order will active the funcition
- This one is an utility to show the total of an order with the function
- This show the total of all orders filters in the tab by using filterTotal
- Seccion used for pagination
Updated over 3 years ago