merge with crm

This commit is contained in:
Yan
2017-06-12 10:25:07 +06:30
10 changed files with 170 additions and 64 deletions

View File

@@ -43,6 +43,10 @@ $(document).ready(function(){
$("#customer").attr('disabled','disabled');
}
var customer_id=$(this).find(".customer-id").text();
show_customer_details(customer_id);
var cashier="";
var receipt_date="";
var sub_total=0;
@@ -165,6 +169,7 @@ $(document).ready(function(){
});
});
// Payment for Bill
$('#pay-bill').click(function() {
var sale_id=$(".selected-item").find(".orders-id").text();
@@ -180,10 +185,27 @@ $(document).ready(function(){
$('#customer').click(function() {
var sale_id=$(".selected-item").find(".orders-id").text();
window.location.href = '/crm/customers/'+ sale_id + "/assign_sale_id"
window.location.href = '/origami/'+ sale_id + "/add_customer"
return false;
});
function show_customer_details(customer_id){
$('.customer_detail').removeClass('hide');
//Start Ajax
$.ajax({
type: "GET",
url: "origami/"+customer_id+"/get_customer/",
data: {},
dataType: "json",
success: function(data) {
$("#customer_name").text(data.name);
$("#customer_name").text(data.name);
}
});
//End Ajax
}
/* For Receipt - Calculate discount or tax */
$('.cashier_number').on('click', function(event){
if(event.handled !== true) {