-
This commit is contained in:
@@ -1097,16 +1097,28 @@ $(function() {
|
||||
var total_price = 0;
|
||||
var total_qty = 0;
|
||||
var taxable_amount = 0;
|
||||
var exclusive_total =0;
|
||||
var inclusive_total =0;
|
||||
var inclusive_tax =$('#inclusive_tax').val();
|
||||
var exclusive_tax =$('#exclusive_tax').val();
|
||||
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;
|
||||
});
|
||||
if (inclusive_tax >0){
|
||||
inclusive_total = total_price / inclusive_tax;
|
||||
}
|
||||
if (exclusive_tax >0){
|
||||
exclusive_total = total_price * exclusive_tax;
|
||||
}
|
||||
total_price = total_price + exclusive_total + inclusive_total;
|
||||
var fixed_total_price = parseFloat(total_price).toFixed(2);
|
||||
var fixed_taxable_amount = parseFloat(taxable_amount).toFixed(2);
|
||||
$('#total_tax').empty();
|
||||
$('#total_tax').append(exclusive_total + inclusive_total);
|
||||
|
||||
$('#sub_total').empty();
|
||||
$('#sub_total').append(fixed_total_price);
|
||||
|
||||
@@ -69,11 +69,11 @@ $(document).ready(function(){
|
||||
type: "POST",
|
||||
url: "/origami/" + unique_id,
|
||||
data: { 'booking_id' : unique_id },
|
||||
success:function(result){
|
||||
success:function(result){
|
||||
for (i = 0; i < result.length; i++) {
|
||||
var data = JSON.stringify(result[i]);
|
||||
var parse_data = JSON.parse(data);
|
||||
var show_date = "";
|
||||
var show_date = "";
|
||||
|
||||
// Receipt Header
|
||||
receipt_no = result[i].receipt_no;
|
||||
@@ -81,14 +81,14 @@ $(document).ready(function(){
|
||||
if(result[i].receipt_date != null){
|
||||
receipt_date = new Date(result[i].receipt_date);
|
||||
show_date = receipt_date.getDate() + "-" + receipt_date.getMonth() + "-" + receipt_date.getFullYear() + ' ' + receipt_date.getHours()+ ':' + receipt_date.getMinutes()
|
||||
}
|
||||
}
|
||||
|
||||
//Receipt Charges
|
||||
sub_total += parseFloat(parse_data.price);
|
||||
|
||||
discount_amount = parse_data.discount_amount == null? '0.0' : parse_data.discount_amount;
|
||||
tax_amount = parse_data.tax_amount;
|
||||
grand_total_amount = parse_data.grand_total_amount;
|
||||
grand_total_amount = parse_data.grand_total_amount;
|
||||
|
||||
// Ordered Items
|
||||
var order_items_rows = "<tr>" +
|
||||
@@ -135,7 +135,7 @@ $(document).ready(function(){
|
||||
// Discount for Payment
|
||||
$('#discount').click(function() {
|
||||
var order_id=$(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
|
||||
|
||||
if(order_id!=""){
|
||||
window.location.href = '/origami/' + order_id + '/discount'
|
||||
}
|
||||
@@ -164,7 +164,7 @@ $(document).ready(function(){
|
||||
}
|
||||
|
||||
// For Percentage Discount
|
||||
if(discount_type == 1){
|
||||
if(discount_type == 1){
|
||||
discount_amount=(sub_total*discount_value)/100;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ $(document).ready(function(){
|
||||
|
||||
$('#customer').click(function() {
|
||||
var sale = $(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
if (sale.substring(0, 3)=="SAL") {
|
||||
if (sale.includes("SAL")) {
|
||||
var sale_id = sale
|
||||
}else{
|
||||
var sale_id = $(".selected-item").find(".order-cid").text();
|
||||
@@ -205,7 +205,7 @@ $(document).ready(function(){
|
||||
|
||||
$('#re-print').click(function() {
|
||||
var sale_id = $(".selected-item").find(".orders-id").text().substr(0,16);
|
||||
|
||||
|
||||
window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user