Merge branch 'staging' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-07-26 18:40:11 +06:30
5 changed files with 24 additions and 10 deletions

View File

@@ -15,6 +15,7 @@ class Origami::HomeController < BaseOrigamiController
@rooms = Room.all.active.order('status desc')
@complete = Sale.where("sale_status != 'new'")
@orders = Order.all.order('date desc')
@shop = Shop.find_by_id(1)
@status_order = ""
@status_sale = ""
@sale_array = Array.new

View File

@@ -200,6 +200,13 @@ class CloseCashierPdf < Prawn::Document
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
text "#{tax.st_amount.round(2)}", :size => self.item_font_size, :align => :right
end
end
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Rounding Adjustment :", :size => self.item_font_size, :align => :right
end
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
text "#{shift_sale.total_rounding.round(2)}", :size => self.item_font_size, :align => :right
end
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do

View File

@@ -20,7 +20,7 @@
</li>
</ul>
<!-- Nav tabs - End -->
<input type="hidden" id="rounding_adj" value="<%= @shop.is_rounding_adj %>">
<div class="tab-content">
<!--- Panel 0 - Completed Orders -->
@@ -452,15 +452,20 @@ $("#first_bill").on('click', function(){
$('#pay').on('click',function() {
var sale_id = $('#sale_id').val();
var url = '/origami/sale/'+ sale_id + "/rounding_adj" ;
var rounding_adj = $('#rounding_adj').val();
$.ajax({
type: "POST",
url: '/origami/sale/'+ sale_id + "/rounding_adj",
success:function(result){
window.location.href = '/origami/sale/'+ sale_id + "/payment";
}
});
if(rounding_adj == "true"){
var url = '/origami/sale/'+ sale_id + "/rounding_adj" ;
$.ajax({
type: "POST",
url: '/origami/sale/'+ sale_id + "/rounding_adj",
success:function(result){
window.location.href = '/origami/sale/'+ sale_id + "/payment";
}
});
}else{
window.location.href = '/origami/sale/'+ sale_id + "/payment";
}
});