SQA feedback
This commit is contained in:
@@ -3,7 +3,7 @@ class Origami::ShiftsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@type = params[:type]
|
@cashier_type = params[:type]
|
||||||
@shift = ShiftSale.current_open_shift(current_user.id)
|
@shift = ShiftSale.current_open_shift(current_user.id)
|
||||||
#for bank integration
|
#for bank integration
|
||||||
bank_integration = Lookup.collection_of('bank_integration')
|
bank_integration = Lookup.collection_of('bank_integration')
|
||||||
|
|||||||
@@ -371,6 +371,8 @@ class Sale < ApplicationRecord
|
|||||||
end
|
end
|
||||||
#compute rounding adjustment
|
#compute rounding adjustment
|
||||||
# adjust_rounding
|
# adjust_rounding
|
||||||
|
sale.rounding_adjustment = compute_adjust_rounding(sale.grand_total)
|
||||||
|
|
||||||
sale.save!
|
sale.save!
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -552,6 +554,26 @@ class Sale < ApplicationRecord
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def compute_adjust_rounding(grand_total)
|
||||||
|
shop_details = Shop::ShopDetail
|
||||||
|
# rounding adjustment
|
||||||
|
if shop_details.is_rounding_adj
|
||||||
|
a = grand_total % 25 # Modulus
|
||||||
|
b = grand_total / 25 # Division
|
||||||
|
#not calculate rounding if modulus is 0 and division is even
|
||||||
|
#calculate rounding if modulus is zero or not zero and division are not even
|
||||||
|
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
|
new_total = Sale.get_rounding_adjustment(grand_total)
|
||||||
|
rounding_adjustment = new_total - grand_total
|
||||||
|
else
|
||||||
|
rounding_adjustment = 0.00
|
||||||
|
end
|
||||||
|
else
|
||||||
|
rounding_adjustment = 0.00
|
||||||
|
end
|
||||||
|
return rounding_adjustment
|
||||||
|
end
|
||||||
|
|
||||||
#Generate new Receipt No when it is not assigned
|
#Generate new Receipt No when it is not assigned
|
||||||
def generate_receipt_no
|
def generate_receipt_no
|
||||||
#shop_code and client_code
|
#shop_code and client_code
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
var type = '<%= @type %>';
|
var cashier_type = '<%= @cashier_type %>';
|
||||||
$('#close_cashier').on('click',function(){
|
$('#close_cashier').on('click',function(){
|
||||||
var amount = $('#closing_balance_amount').val();
|
var amount = $('#closing_balance_amount').val();
|
||||||
var shift_id = "<%= @shift.id rescue ""%>"
|
var shift_id = "<%= @shift.id rescue ""%>"
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click',function(){
|
||||||
if(type!='quick_service'){
|
if(cashier_type!='quick_service'){
|
||||||
window.location.href = '/origami';
|
window.location.href = '/origami';
|
||||||
}else{
|
}else{
|
||||||
window.location.href = '/origami/quick_service';
|
window.location.href = '/origami/quick_service';
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
closeOnCancel: false,
|
closeOnCancel: false,
|
||||||
allowOutsideClick: false
|
allowOutsideClick: false
|
||||||
}, function () {
|
}, function () {
|
||||||
window.location.href = '/origami/shift/'+type+'/close';
|
window.location.href = '/origami/shift/'+cashier_type+'/close';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
closeOnCancel: false,
|
closeOnCancel: false,
|
||||||
allowOutsideClick: false
|
allowOutsideClick: false
|
||||||
}, function () {
|
}, function () {
|
||||||
window.location.href = '/origami/shift/'+type+'/close';
|
window.location.href = '/origami/shift/'+cashier_type+'/close';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -184,7 +184,7 @@
|
|||||||
closeOnCancel: false,
|
closeOnCancel: false,
|
||||||
allowOutsideClick: false
|
allowOutsideClick: false
|
||||||
}, function () {
|
}, function () {
|
||||||
window.location.href = '/origami/shift/close';
|
window.location.href = '/origami/shift/'+cashier_type+'/close';
|
||||||
});
|
});
|
||||||
// reqCBBankAlipaySettlement();
|
// reqCBBankAlipaySettlement();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user