| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <div class='pdf-body'>
- <header class='document-header'>
- <h1 class='text-center'>
- <% pointsale = sale.get_pointsale %>
- <% if pointsale.img_pointsale? %>
- <%= wicked_pdf_image_tag_for_public(pointsale.img_pointsale_url, :style => "margin-top:10px") %>
- <% elsif @pos_config.ticket_img? %>
- <%= wicked_pdf_image_tag_for_public(@pos_config.ticket_img_url, :style => "margin-top:10px") %>
- <% end %>
- </h1>
- <p>
- <% if sale.get_pointsale.notes.blank? %>
- <%= simple_format(@pos_config.ticket_description, class: 'text-center') %>
- <% else %>
- <%= simple_format(sale.get_pointsale.notes, class: 'text-center') %>
- <% end %>
- </p>
- </header>
- <div class="resume">
- <%= l(sale.created_at, :format => '%d/%m/%y %I:%M %p') %> | <%= sale.sale_code %> | <%= sale.seller.name %>
- </div>
- <div style="margin-top:5px">
- <strong>APARTADO</strong><br>
- Cliente: <strong> <%= sale.customer.nick_name %> </strong>
- </div>
- <div class="products">
- <table cellspacing="0">
- <thead>
- <tr>
- <th style="text-align:left;font-weight:normal">Cantidad</th>
- <th style="text-align:center;font-weight:normal">Precio</th>
- <th style="text-align:center;font-weight:normal">Desc.</th>
- <th style="text-align:right;font-weight:normal">Importe</th>
- </tr>
- </thead>
- <tbody style="border-top:1px solid black">
- <% sale.sales_details.each_with_index do |detail, key| %>
- <tr>
- <td colspan="3">
- <%= truncate(detail.product.name, :length => 30, :separator => ' ', :omission => '') %> <%= truncate(detail.product.display_attributes_receipt, :length => 20, :separator => ' ', :omission => '') %>
- </td>
- </tr>
- <tr>
- <td> <%= detail.quantity.round %> </td>
- <td style="text-align:center"> <%= number_to_currency(detail.unit_price, precision: 2) %> </td>
- <td style="text-align:center"> <%= number_to_currency(detail.discount, precision: 2) %> </td>
- <td style="text-align:right">
- <%= number_to_currency(((detail.unit_price * detail.quantity) - detail.discount), precision: 2) %>
- </td>
- </tr>
- <% end %>
- </tbody>
- </table>
- </div>
- <div style="margin-top:0px;text-align:right">
- <% margin = 55 %>
- <table style="float:right;width:50%">
- <thead>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td width="30%">Subtotal</td>
- <td width="15%" class="text-right">$</td>
- <td width="40%"><%= number_to_currency(sale.amount, precision: 2, :unit => "") %></td>
- </tr>
- <% if sale.discount > 0 %>
- <% margin = margin += 20 %>
- <tr>
- <td width="30%">Descuento</td>
- <td width="15%" class="text-right">$</td>
- <td width="40%"><%= number_to_currency(sale.discount, precision: 2, :unit => "") %></td>
- </tr>
- <% end %>
- <% if sale.tax > 0 %>
- <% margin = margin += 20 %>
- <tr>
- <td width="30%">IVA</td>
- <td width="15%" class="text-right">$</td>
- <td width="40%"><%= number_to_currency(sale.tax, precision: 2, :unit => "") %></td>
- </tr>
- <% end %>
- <tr>
- <td width="30%"><strong>Total</strong></td>
- <td width="15%" class="text-right"><strong>$</strong></td>
- <td width="40%"><strong><%= number_to_currency(sale.total, precision: 2, :unit => "") %></strong></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div style="margin-top:<%=margin%>px;border-top: 1px dotted black">
- <div style="float:left;width:50%;margin-top:7px">
- <span>Vencimiento</span></br>
- <span><%= l(sale.expiration_date, :format => '%d/%m/%y') %></span>
- </div>
- <table style="float:right;width:50%" class="text-right">
- <thead>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td width="30%">Anticipo</td>
- <td width="15%" class="text-right">$</td>
- <td width="40%" class="text-right"><%= number_to_currency(debt, precision: 2, :unit => "") %></td>
- </tr>
- <tr>
- <td width="30%"><strong>Resta</strong></td>
- <td width="15%" class="text-right"><strong>$</strong></td>
- <td width="40%" class="text-right"><strong><%= number_to_currency(sale.reserve_debt, precision: 2, :unit => "") %></strong></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div style="margin-top:70px; border-top:1px dotted black" class="totals text-right">
- <table cellspacing="0">
- <thead>
- <tr>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <% marginFooter = 20 %>
- <% sale.cash_registers_moves.each do |move| %>
- <tr class="text-center" style="text-decoration:underline;">
- <td><%= move.payment_method.method %> </td>
- <td></td>
- <td></td>
- </tr>
- <% if move.payment_method.isCash? %>
- <% marginFooter += 80 %>
- <tr class="text-left">
- <td> </td>
- <td> Recibido: </td>
- <td> <%= number_to_currency(move.received, precision: 2) %></td>
- </tr>
- <tr class="text-left">
- <td> </td>
- <td><strong> Pagó: </strong></td>
- <td><strong> <%= number_to_currency(move.quantity, precision: 2) %></strong></td>
- </tr>
- <tr class="text-left">
- <td> </td>
- <td> Cambio: </td>
- <td> <%= number_to_currency(move.change, precision: 2) %></td>
- </tr>
- <% else %>
- <% marginFooter += 60 %>
- <tr class="text-left">
- <td> </td>
- <td><strong> Pagó: </strong></td>
- <td><strong> <%= number_to_currency(move.quantity, precision: 2) %></strong></td>
- </tr>
- <tr class="text-left">
- <td> </td>
- <td> tarjeta nº: </td>
- <td> <%= move.cardnumber %></td>
- </tr>
- <% end %>
- <% end %>
- </tbody>
- </table>
- </div>
- <div style="margin-top:<%=marginFooter%>px">
- <% if sale.get_pointsale.ticket_footer.blank? %>
- <%= simple_format(@pos_config.ticket_footer) %>
- <% else %>
- <%= simple_format(sale.get_pointsale.ticket_footer) %>
- <% end %>
- </div>
- </div>
|