| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <!-- BEGIN CONTAINER -->
- <div class="page-container">
- <!-- BEGIN CONTENT -->
- <div class="page-content-wrapper">
- <!-- BEGIN CONTENT BODY -->
- <!-- BEGIN PAGE HEAD-->
- <div class="page-head">
- <div class="container-fluid">
- <!-- BEGIN PAGE TITLE -->
- <div class="page-title">
- <h1>Reporte de utilidades por periodo </h1>
- </div>
- <!-- END PAGE TITLE -->
- </div>
- </div>
- <!-- END PAGE HEAD-->
- <!-- BEGIN PAGE CONTENT BODY -->
- <div class="page-content">
- <div class="container-fluid">
- <!-- BEGIN PAGE BREADCRUMBS -->
- <ul class="page-breadcrumb breadcrumb">
- <%= render_breadcrumbs :tag => :li, :separator => ' <i class="fa fa-circle"></i> ' %>
- </ul>
- <!-- END PAGE BREADCRUMBS -->
- <div class="search-page search-content-3">
- <div class="row">
- <div class="col-md-12">
- <%= form_tag(utilities_report_path, method: :get, remote: true) do |f| %>
- <div class="search-filter bordered">
- <!-- <h4 class=" uppercase form-section"> Búsqueda de producto </h4> <hr> -->
- <div class="form-group">
- <div class="row">
- <div class="col-md-3 col-sm-4">
- <div class="search-label uppercase">Punto de venta</div>
- <div class="col-md-12">
- <%= select_tag "pointsale", options_from_collection_for_select(Pointsale.vigentes, :id, :name), include_blank: "Todos", class: "form-control input-medium" %>
- </div>
- </div>
- <div class="col-md-3 col-sm-4">
- <div class="search-label uppercase"> Del </div>
- <div class="col-md-6">
- <div class="input-group input-medium date date-picker" data-date-format="dd/mm/yyyy">
- <%= text_field_tag "start_date", l(Date.today.beginning_of_month, format: '%d/%m/%Y'), class: "form-control" %>
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- <div class="col-md-3 col-sm-4">
- <div class="search-label uppercase"> Al </div>
- <div class="col-md-6">
- <div class="input-group input-medium date date-picker" data-date-format="dd/mm/yyyy">
- <%= text_field_tag "end_date", l(Date.today.end_of_month, format: '%d/%m/%Y'), class: "form-control" %>
- <span class="input-group-addon">
- <span class="glyphicon glyphicon-calendar"></span>
- </span>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="form-group">
- <div class="row">
- <div class="col-md-3 col-sm-4">
- <!-- categoria -->
- <div class="search-label uppercase">Línea</div>
- <div class="col-md-12">
- <div class="select2-bootstrap-prepend">
- <%= select_tag "category", options_from_collection_for_select(Category.activos_padre, :id, :category), include_blank: "Todas", class: "form-control select2-allow-clear-todas", onchange: 'getSubCategories($(this).val());'%>
- </div>
- </div>
- </div>
- <div class="col-md-3 col-sm-4">
- <!-- sub- categoria -->
- <div class="search-label uppercase">Sublínea</div>
- <div class="col-md-12">
- <div class="select2-bootstrap-prepend">
- <%= collection_select("", :subcategory, ({}), :id, :category, options = { include_blank: "Todas" }, html_options = { class: 'form-control select2-allow-clear-todas input-medium' }) %>
- </div>
- </div>
- </div>
- <div class="col-md-3 col-sm-4" style="margin-top: 20px">
- <%= submit_tag 'Filtrar', { class: "btn green bold btn-block", style: 'margin:0px' } %>
- </div>
- </div>
- </div>
- </div>
- <% end %>
- </div>
- </div>
- </div>
- <!-- BEGIN PAGE CONTENT INNER -->
- <div class="page-content-inner">
- <div class="portlet light">
- <div class="portlet-title">
- <div class="caption">
- <span class="caption-subject font-blue-dark bold uppercase">Ventas e ingresos</span>
- </div>
- </div>
- <div class="portlet-body form" id="sales_content">
- <div class="product_track_search">
- <div class="row">
- <div class="col-md-12">
- <div class="note note-success hidden" id="note_info">
- <h4 class="block">Detalle de utilidades del periodo: <strong><span id="start_date_display"></span></strong> al <strong><span id="end_date_display"></span></strong></h4>
- </div>
- <div class="col-xs-offset-1 col-xs-5">
- <div class="text-center well" id="container_total_prods" style="margin-bottom: 0px">
- <div class="font-grey-mint font-sm">NÚMERO DE VENTAS</div>
- <div class="uppercase font-hg font-blue-sharp" id="sales_quantity">0</div>
- </div>
- </div>
- <div class="col-xs-offset-1 col-xs-5">
- <div class="text-center well" id="container_total_prods" style="margin-bottom: 0px">
- <div class="font-grey-mint font-sm">PRODUCTOS VENDIDOS</div>
- <div class="uppercase font-hg font-blue-sharp" id="prods_total">0</div>
- </div>
- </div>
- </div>
- </div>
- <div class="row" style="margin-top: 20px">
- <div class="col-md-12">
- <div class="col-xs-offset-1 col-xs-5">
- <div class="text-center well" id="container_total_prods" style="margin-bottom: 0px">
- <div class="font-grey-mint font-sm">TOTAL UTILIDAD</div>
- <div class="uppercase font-hg font-green" id="total_utility">0</div>
- </div>
- </div>
- </div>
- </div>
- <br>
- <div class="row">
- <div class="col-md-12">
- <h4 class="form-section">Desglose de ventas</h4>
- <table class="table table-striped table-bordered table-hover tableadvanced" id="utility_report_table">
- <thead>
- <tr>
- <th>Fecha</th>
- <th>Folio</th>
- <th>Punto<br>de<br>venta</th>
- <th>Productos</th>
- <th>Tipo</th>
- <th>Status</th>
- <th>Subtotal</th>
- <th>IVA</th>
- <th>Descto.</th>
- <th>Total</th>
- <th>Costo<br>total</th>
- <th>Utilidad</th>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- END PAGE CONTENT INNER -->
- </div>
- </div>
- <!-- END PAGE CONTENT BODY -->
- <!-- END CONTENT BODY -->
- </div>
- <!-- END CONTENT -->
- </div>
- <script>
- function getSubCategories(value) {
- $('#_subcategory').html('');
- $('#_subcategory').select2("destroy").select2({
- placeholder: 'Seleccione',
- "language": {
- "noResults": function(){
- return "No se encontraron coincidencias";
- }
- }
- });
- $('#_subcategory').select2('val', null);
- if(value) {
- $.ajax({
- type: "get",
- url: '/getcategories/' + value,
- dataType: 'json',
- success: function(data) {
- if(data.length > 0) {
- $('#_subcategory').append('<option></option>')
- for(i in data) {
- $('#_subcategory').append("<option value='" + data[i].id + "'>" + data[i].category + "</option>")
- }
- $('#_subcategory').select2({
- allowClear: true,
- placeholder: 'Todas',
- "language": {
- "noResults": function(){
- return "No se encontraron coincidencias";
- }
- }
- });
- }
- }
- });
- }
- }
- </script>
|