checkout crm

This commit is contained in:
Aung Myo
2017-06-06 14:44:25 +06:30
parent b847cde62c
commit e76296bb77
3 changed files with 111 additions and 45 deletions

View File

@@ -1,6 +1,6 @@
class Origami::RequestBillsController < BaseOrigamiController
def create
def show
@sale = Sale.new
@@ -27,11 +27,6 @@ class Origami::RequestBillsController < BaseOrigamiController
end
def show
sale_id = params[:sale_id]
if Sale.exists?(sale_id)
@sale_data = Sale.find_by_sale_id(sale_id)
end
end
end

View File

@@ -1,41 +1,110 @@
<p id="notice"><%= notice %></p>
<div class="row">
<div class="col-lg-12">
<ol class="breadcrumb">
<li><a href="<%= dashboard_path %>">Home</a></li>
<li class="active">
<a href="<%= crm_customers_path %>">Customer</a>
</li>
<a href="<%= new_crm_customer_path%>" class="btn btn-primary pull-right">
<i class="fa fa-plus-circle fa-lg"></i> Add Customer
</a>
</ol>
</div>
</div>
<br/>
<h1>Crm Customers</h1>
<div class="row">
<div class="col-lg-7">
<div class="main-box-body clearfix">
<div class="table-responsive">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Company</th>
<th>Contact no</th>
<th>Email</th>
</tr>
</thead>
<table>
<thead>
<tr>
<th>Name</th>
<th>Company</th>
<th>Contact no</th>
<th>Email</th>
<th>Date of birth</th>
<th>Membership</th>
<th>Membership type</th>
<th>Membership authentication code</th>
<th colspan="3"></th>
</tr>
</thead>
<tbody>
<% @crm_customers.each do |crm_customer| %>
<tr>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
<tbody>
<% @crm_customers.each do |crm_customer| %>
<tr>
<td><%= crm_customer.name %></td>
<td><%= crm_customer.company %></td>
<td><%= crm_customer.contact_no %></td>
<td><%= crm_customer.email %></td>
<td><%= crm_customer.date_of_birth %></td>
<td><%= crm_customer.membership_id %></td>
<td><%= crm_customer.membership_type %></td>
<td><%= crm_customer.membership_authentication_code %></td>
<td><%= link_to 'Show', crm_customer_path(crm_customer) %></td>
<td><%= link_to 'Edit', edit_crm_customer_path(crm_customer) %></td>
<td><%= link_to 'Destroy', crm_customer_path(crm_customer), method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %>
</tbody>
</table>
</div>
<br>
<div class="col-lg-5">
<%= simple_form_for crm_customers_path, :html => { :class => 'form-horizontal' } do |f| %>
<div class="form-group">
<%= f.input :name, :class => "form-control col-md-6" %>
</div>
<div class="form-group">
<%= f.input :company, :class => "form-control col-md-6" %>
</div>
<div class="form-group">
<%= f.input :contact_no, :class => "form-control col-md-6" %>
</div>
<div class="form-group">
<%= f.input :email, :class => "form-control col-md-6" %>
</div>
<%= link_to 'New Crm Customer', new_crm_customer_path %>
<div class="form-group">
<label for="date_of_birth" class="col-md-6 control-label">Date Of Birth</label>
<%= f.text_field :date_of_birth,:class=>"form-control datepicker",:readonly =>true, :value => @date_of_birth%>
</div>
<div class="form-group">
<%= f.select :membership_id, options_for_select(@membership.collect { |member|
[member["name"], member["id"]] }, 1), {}, { id: 'countries_select' } %>
<select class="selectpicker form-control col-md-6" name="membership_id">
<option>Select Member Group</option>
<% @membership.each do |member| %>
<option value="<%= member["id"] %>">
<%= member["name"] %></option>
<%end %>
</select>
</div>
<div class="form-group">
<%= f.input :membership_type, :class => "form-control col-md-6" %>
</div>
<div class="form-group">
<%= f.input :membership_authentication_code, :class => "form-control col-md-6" %>
</div>
<div class="form-group">
<%= f.button :submit, "Submit", :class => 'btn btn-primary' , :id => 'submit_account' %>
</div>
<%end%>
</div>
</div>
<script type="text/javascript">
$(function () {
if (jQuery().datepicker) {
$('.datepicker').datepicker({
format : 'dd-mm-yyyy',
autoclose: true
});
$('.datepicker').attr('ReadOnly','true');
$('.datepicker').css('cursor','pointer');
}
});
</script>

View File

@@ -214,7 +214,7 @@ function callOrderDetails(sale_order_id){
sale_order = sale_order_id.split("_")[0]
if (sale_order == 'sale') {
sale_id = sale_order_id.split("_")[1]
order_id = sale_order_id.split("_")[1]
url = "origami/"+sale_order_id.split("_")[1]
data_val = { sale_id: sale_order_id.split("_")[1]}
@@ -224,8 +224,10 @@ function callOrderDetails(sale_order_id){
data_val = { order_id: sale_order_id.split("_")[1]}
}
table_or_order_id = order_id
pay_sale_id = sale_id
alert(table_or_order_id)
var tbody = ""
$("#append-table").html("")
if (old_order_id != order_id){
@@ -316,7 +318,7 @@ $( document ).ready(function() {
$( document ).ready(function() {
$('#pay').click(function() {
window.location.href = '/origami/sale/'+ pay_sale_id + "/payment"
window.location.href = '/origami/sale/'+pay_sale_id +"/payment"
return false;
});
});