update addorder

This commit is contained in:
Aung Myo
2018-05-23 17:50:13 +06:30
parent 6236e06558
commit 0ec4b6cb12
2 changed files with 5 additions and 1 deletions

View File

@@ -1012,12 +1012,14 @@ $(function() {
//calculate subtotal
function calculate_sub_total(){
var total_price = 0;
var total_qty = 0;
var taxable_amount = 0;
var item_row = $('.summary-items tbody tr');
$(item_row).each(function(i){
var unit_price = parseFloat($(item_row[i]).attr('data-price'));
var qty = parseFloat($(item_row[i]).children('#item_qty').text());
total_qty += qty;
total_price += qty*unit_price;
});
var fixed_total_price = parseFloat(total_price).toFixed(2);
@@ -1026,6 +1028,9 @@ $(function() {
$('#sub_total').empty();
$('#sub_total').append(fixed_total_price);
$('#total_qty').empty();
$('#total_qty').append(fixed_total_price);
if (item_row.length > 0) {
$('.create').removeAttr("disabled", false);
}else{

View File

@@ -91,7 +91,6 @@ class Origami::ProductCommissionsController < BaseOrigamiController
# @commission = Commission.where('product_code = ? AND is_active = ?', @menu_item.item_code, true).take
Commission.all.active.each do |com|
puts com.product_code != "[]"
if com.product_code != "[]"
if com.product_code.to_s.include? @menu_item.item_code
@commission = Commission.find(com.id)