update addorder and show_account_info add shops

This commit is contained in:
Aung Myo
2017-11-22 16:49:34 +06:30
parent d3ceba0a7a
commit fafd6df5e1
5 changed files with 13 additions and 7 deletions

View File

@@ -575,7 +575,6 @@ $(function() {
} }
} }
if (JSON.stringify(attribute_arr) === JSON.stringify(instances[field].values) || result) { if (JSON.stringify(attribute_arr) === JSON.stringify(instances[field].values) || result) {
$('.add_to_order').attr('data-instance-code',instances[field].code); $('.add_to_order').attr('data-instance-code',instances[field].code);
$('.add_to_order').attr('data-instance',instances[field].name); $('.add_to_order').attr('data-instance',instances[field].name);

View File

@@ -45,7 +45,7 @@ class ReceiptBillPdf < Prawn::Document
delimiter = "" delimiter = ""
end end
header( shop_details) header(shop_details)
stroke_horizontal_rule stroke_horizontal_rule
@@ -60,11 +60,13 @@ class ReceiptBillPdf < Prawn::Document
customer(customer_name) customer(customer_name)
if discount_price_by_accounts.length > 0 if discount_price_by_accounts.length > 0 && shop_details.show_account_info
discount_account(discount_price_by_accounts,printer_settings.precision,delimiter) discount_account(discount_price_by_accounts,printer_settings.precision,delimiter)
end end
items_account(item_price_by_accounts,printer_settings.precision,delimiter) if shop_details.show_account_info
items_account(item_price_by_accounts,printer_settings.precision,delimiter)
end
sign(sale_data) sign(sale_data)
@@ -389,6 +391,8 @@ class ReceiptBillPdf < Prawn::Document
text "#{ customer_name }" , :size => self.item_font_size,:align => :right text "#{ customer_name }" , :size => self.item_font_size,:align => :right
end end
end end
def discount_account(discount_price_by_accounts,precision,delimiter) def discount_account(discount_price_by_accounts,precision,delimiter)
move_down 5 move_down 5
stroke_horizontal_rule stroke_horizontal_rule

View File

@@ -15,12 +15,13 @@
<%= f.input :license_data %> <%= f.input :license_data %>
<%= f.input :base_currency %> <%= f.input :base_currency %>
<%= f.input :cloud_token %> <%= f.input :cloud_token %>
<%= f.input :cloud_url %> <%= f.input :cloud_url %>
<%= f.input :owner_token %> <%= f.input :owner_token %>
<%= f.input :id_prefix %> <%= f.input :id_prefix %>
<%= f.input :is_rounding_adj %> <%= f.input :is_rounding_adj %>
<%= f.input :quick_sale_summary %> <%= f.input :quick_sale_summary %>
<%= f.input :calc_tax_order %> <%= f.input :calc_tax_order %>
<%= f.input :show_account_info %>
</div> </div>

View File

@@ -23,6 +23,7 @@
<th>Rouding Adj</th> <th>Rouding Adj</th>
<th>View Sale Summary</th> <th>View Sale Summary</th>
<th>Calculate Tax</th> <th>Calculate Tax</th>
<th>Show Account Info</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
</thead> </thead>
@@ -36,7 +37,7 @@
<td><%= shop.is_rounding_adj %></td> <td><%= shop.is_rounding_adj %></td>
<td><%= shop.quick_sale_summary %></td> <td><%= shop.quick_sale_summary %></td>
<td><%= shop.calc_tax_order %></td> <td><%= shop.calc_tax_order %></td>
<td><%= shop.show_account_info %></td>
<td> <td>
<%= link_to t("views.btn.show"), settings_shop_path(shop),:class => 'btn btn-info btn-sm waves-effect' %> <%= link_to t("views.btn.show"), settings_shop_path(shop),:class => 'btn btn-info btn-sm waves-effect' %>
<%= link_to t("views.btn.edit"), edit_settings_shop_path(shop),:class => 'btn btn-primary btn-sm waves-effect' %> <%= link_to t("views.btn.edit"), edit_settings_shop_path(shop),:class => 'btn btn-primary btn-sm waves-effect' %>

View File

@@ -21,6 +21,7 @@ class CreateShops < ActiveRecord::Migration[5.1]
t.boolean :is_rounding_adj, :default => false t.boolean :is_rounding_adj, :default => false
t.boolean :quick_sale_summary, :default => false t.boolean :quick_sale_summary, :default => false
t.boolean :calc_tax_order, :default => false t.boolean :calc_tax_order, :default => false
t.boolean :show_account_info, :default => true
t.timestamps t.timestamps
end end
end end