fix date in sale tran

This commit is contained in:
NyanLinHtut
2019-10-03 09:48:01 +06:30
parent 3505547052
commit 971b1da98c
3 changed files with 42 additions and 43 deletions

View File

@@ -60,17 +60,17 @@
</th>
<%end%>
<%end%>
<% end %>
<% end %>
</tr>
</thead>
<tbody>
<tr>
<td><%= @sale.receipt_date.strftime("%d-%M-%Y") %></td>
<td><%= @sale.receipt_date.strftime("%d-%m-%Y") %></td>
<td><%= @sale.receipt_no %></td>
<td><%= @sale.cashier_name rescue '-' %></td>
<td><%= @sale.sale_status %> </td>
<td colspan="2"> <%= @sale.requested_at.strftime("%m-%d-%Y %H:%M %p") %> </td>
</tr>
<td colspan="2"> <%= @sale.requested_at.strftime("%d-%m-%Y %H:%M %p") %> </td>
</tr>
<tr style="border-top:2px solid #000">
<th><%= t :sale %> <%= t("views.right_panel.detail.item_txt") %> <%= t("views.right_panel.detail.name_txt2") %></th>
<th><%= t("views.right_panel.detail.qty") %></th>
@@ -78,20 +78,20 @@
<th><%= t("views.right_panel.detail.total_price") %></th>
<th><%= t("views.right_panel.detail.created_at") %></th>
<th><%= t("views.right_panel.detail.remark") %></th>
</tr>
</tr>
<% @sale.sale_items.each do |s| %>
<tr>
<td><%=s.product_name rescue ' '%></td>
<td><%=s.qty rescue ' '%></td>
<td><%= number_with_precision(s.unit_price, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%= number_with_precision(s.price, :precision => 2, :delimiter => ',') rescue ' '%></td>
<td><%=l s.created_at.utc.getlocal , :format => :short rescue ' ' %></td>
<td><%=s.remark rescue ' '%></td>
</tr>
<% end %>
<% end %>
<tr style="border-top:2px solid #000">
<td colspan=2 style="text-align:center"></td>
<td><%= t("views.right_panel.detail.total") %></td>
<td><%= t("views.right_panel.detail.total") %></td>
<td colspan="3"><%= number_with_precision(@sale.total_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<tr>
@@ -102,10 +102,10 @@
<% @sale.sale_taxes.each do |r|%>
<tr>
<td colspan=2 style="text-align:center"></td>
<td><%= r.tax_name %> </td>
<td><%= r.tax_name %> </td>
<td colspan="3"><%= number_with_precision(r.tax_payable_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<% end %>
<% end %>
<tr>
<td colspan=2 style="text-align:center"></td>
<td><%= t("views.right_panel.detail.grand_total") %></td>
@@ -122,8 +122,8 @@
<td colspan=2 style="text-align:center"></td>
<td> <%= r.payment_method.capitalize rescue ' '%> Payment</td>
<td colspan="3"><%= number_with_precision(r.payment_amount, :precision => 2, :delimiter => ',') rescue ' '%></td>
</tr>
<% end %>
</tr>
<% end %>
<tr>
<td colspan=2 style="text-align:center"></td>
<td><%= t("views.right_panel.detail.change") %></td>
@@ -208,7 +208,7 @@
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th></th>
</tr>
<% if @response["status"] == true %>
<% @response["data"].each do |transaction| %>
<tr>
@@ -216,7 +216,7 @@
<td><%= transaction["redeem"]%></td>
<td><%= transaction["rebate"] %></td>
<td><%= transaction["balance"] %></td>
<td><%= transaction["account_status"] %></td>
<td><%= transaction["account_status"] %></td>
<td><%= transaction["status"] %></td>
<td><%= transaction["receipt_no"] %></td>
<td></td>
@@ -241,13 +241,13 @@
<th><%= t("views.right_panel.detail.remark") %></th>
</tr>
</thead>
<tbody>
<tbody>
<% @sale_audits.each do |audit| %>
<tr>
<td><%= audit.action%></td>
<td><%= audit.action_at.strftime("%m-%d-%Y %H:%M %p")%></td>
<td><%= audit.approved_by%></td>
<td><%= audit.remark%></td>
<td><%= audit.remark%></td>
</tr>
<% end %>
</tbody>
@@ -297,7 +297,7 @@
<div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
<button class='btn btn-md waves-effect payment-btn-box payment_btn bg-green' data-type='Credit' data-value='Credit'>Credit</button>
</div>
<% @payment_methods.each_with_index do |pay, pay_index| %>
<%if (pay_index+1)%3 == 0 %>
<div class="row clearfix"></div>
@@ -308,8 +308,8 @@
<%end %>
</div>
<!-- </select> -->
<!-- </select> -->
</div>
<div class="modal-footer p-r-30 pb-3">
<button type="button" class="btn btn-md btn-link btn-danger waves-effect" data-dismiss="modal">CLOSE</button>
@@ -367,17 +367,17 @@
}
}
// click select option icon for add
$('.payment_btn').on('click', function(event){
// click select option icon for add
$('.payment_btn').on('click', function(event){
active = $(this).hasClass('selected-payment');
value = $(this).data('value');
type = $(this).data('type');
group = $(this).data('group');
payments = $(".payment_btn");
if (active) {
if (active) {
$(this).removeClass('selected-payment');
}else{
}else{
$(this).addClass('selected-payment');
}
}); //End selecct attribute buttom
@@ -415,7 +415,7 @@
}
});
}
});
});
}else{
swal("Opps","You are not authorized for void","warning")
}
@@ -438,14 +438,14 @@
if(!location.pathname.includes("credit_payment")){
calculate_member_discount(sale_id,"Cash",tax_type);
}
}
}
}
$( "#loading_wrapper" ).hide();
receipt_no = "<%= @sale.receipt_no %>";
if((receipt_no!=undefined) && (receipt_no!=""))
createReceiptNoInFirstBillData(receipt_no,type);
window.location = '/origami/sale/'+sale_id+'/transaction/payment';
});
@@ -454,4 +454,3 @@
window.location = '/origami/sale/'+sale_id+'/transaction/payment';
});
</script>