Editor - Orders - Order list

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.

Utility Functions

  • filterByStatus(status): This function causes orders (filtered) to be filtered by grouped states
  1. pending: Orders with status 0.
  2. completed: Orders with status 1 y 11.
  3. inProgress: Orders with status 7, 8 y 9
  4. 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.
  1. search.id: Field to filter order by id
  2. search.state: Field to filter order by status
  3. search.business: Field to filter depending on what business the order is.
  4. search.cphone: Field to filter by a customer's phone number
  5. search.email: Field to filter by the customer's email
  6. search.date.from: Lower bound to filter orders by date, that is, from which date
  7. search.date.to: Upper bound to filter by date, that is, until date.
  8. 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_details modal with all

Example of base theme

  1. 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.
  2. The filters section includes all the possible filters in search model and adding a action for every change in each field with the function applyFilters().
  3. 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 search.state is state.id
  4. 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 search.city is city.id
  5. 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 search.state is state.id
  6. 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 openDetails(order) with ng-click
  7. This one is an utility to show the total of an order with the function calcTotalOrder(order).
  8. This show the total of all orders filters in the tab by using filterTotal
  9. Seccion used for pagination