update reprint

This commit is contained in:
Aung Myo
2017-06-21 18:19:44 +06:30
parent d2549df2e9
commit d9d07a1cdc
6 changed files with 22 additions and 11 deletions

View File

@@ -37,7 +37,7 @@ class Origami::RequestBillsController < BaseOrigamiController
printer = Printer::ReceiptPrinter.new(print_settings)
printer.print_receipt_bill(print_settings,@sale_items,@sale_data,customer.name, food_total, beverage_total,member_info)
redirect_to origami_path(@sale_data.sale_id)
# redirect_to origami_path(@sale_data.sale_id)
end
end

View File

@@ -250,14 +250,16 @@ class ReceiptBillPdf < Prawn::Document
end
move_down 5
end
stroke_horizontal_rule
end
# show member information
def member_info(member_info,customer_name,rebate_amount,sale_data)
if rebate_amount != nil
if rebate_amount["status"] == true
stroke_horizontal_rule
rebate_amount["data"].each do |res|
if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Rebate"

View File

@@ -28,7 +28,7 @@
<button type="submit" class="btn btn-primary btn-md">Search</button>
<!-- <a href="modal-window" data-toggle= "modal" data-target="#modal-window" class="btn btn-primary btn-md" id="card_read" >Read Card</a> -->
<button type="button" class="btn btn-info btn-md" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- <button type="button" class="btn btn-info btn-md" data-toggle="modal" data-target="#myModal">Open Modal</button> -->
</div>
<% end %>
</td>

View File

@@ -12,20 +12,23 @@
<!-- Column One -->
<div class="col-lg-11 col-md-11 col-sm-11">
<div class="tab-content" style="max-height:670px; overflow:auto">
<div class="tab-content" style="max-height:670px; overflow-y:scroll">
<!--- Panel 1 - Table Orders -->
<div class="active" id="tables" role="tabpanel">
<div class="tab-pane" id="rooms" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 2.2rem;">
<div class="active" role="tabpanel">
<div class="tab-pane" role="tabpanel">
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<% @i =0 %>
<% @dining_queues.each do |queue| %>
<div class="card select-queue <%= !queue.status.nil? ? "assign" : ""%>" data-id="<%= queue.id %>">
<div class="card-block">
<p class="hidden queue-id"><%= queue.id %></p>
<p class="hidden queue-status"><%= queue.status %></p>
<span class="card-title"><%= @i += 1 %> . Queue No </span>
<h1 style="text-align: center"><%= queue.queue_no %></h1>
<span class="card-title">
<%= @i += 1 %> . Queue No </span>
<p style="font-size: 30px ;text-align: center;">
<strong><%= queue.queue_no %></strong>
</p>
</div>
</div>

View File

@@ -175,7 +175,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
<button type="button" id="re-print" class="btn btn-primary btn-block">VOID</button>
<button type="button" id="void" class="btn btn-primary btn-block">VOID</button>
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
</div>
</div>
@@ -206,4 +206,10 @@ $('#pay').on('click',function() {
$('#back').on('click',function(){
window.location.href = '/origami/';
})
$('#re-print').click(function() {
var sale_id = $('#sale_id').val();
window.location.href = '/origami/'+ sale_id + "/reprint"
return false;
});
</script>

View File

@@ -89,7 +89,7 @@ Rails.application.routes.draw do
get "/:id/discount" => "discounts#index"
post "/:id/discount" => "discounts#create"
post "/:id/request_bills" => "request_bills#print"
post "/:id/request_bills" => "request_bills#print" ,:defaults => { :format => 'json' }
get '/:sale_id/reprint' => 'payments#reprint' ,:defaults => { :format => 'json' }
#--------- Payment ------------#
get 'sale/:sale_id/payment' => 'payments#show'