From fafd6df5e19493e67f4c603c675352a339a4b27d Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Wed, 22 Nov 2017 16:49:34 +0630 Subject: [PATCH] update addorder and show_account_info add shops --- app/assets/javascripts/addorder.js | 1 - app/pdf/receipt_bill_pdf.rb | 12 ++++++++---- app/views/settings/shops/_form.html.erb | 3 ++- app/views/settings/shops/index.html.erb | 3 ++- db/migrate/20170530072247_create_shops.rb | 1 + 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 3d61b547..b65561e9 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -575,7 +575,6 @@ $(function() { } } - 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',instances[field].name); diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index bcd3becf..ebdfa147 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -45,7 +45,7 @@ class ReceiptBillPdf < Prawn::Document delimiter = "" end - header( shop_details) + header(shop_details) stroke_horizontal_rule @@ -60,12 +60,14 @@ class ReceiptBillPdf < Prawn::Document 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) 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) footer(printed_status) @@ -389,6 +391,8 @@ class ReceiptBillPdf < Prawn::Document text "#{ customer_name }" , :size => self.item_font_size,:align => :right end end + + def discount_account(discount_price_by_accounts,precision,delimiter) move_down 5 stroke_horizontal_rule diff --git a/app/views/settings/shops/_form.html.erb b/app/views/settings/shops/_form.html.erb index 5f93ea50..5a353b9b 100755 --- a/app/views/settings/shops/_form.html.erb +++ b/app/views/settings/shops/_form.html.erb @@ -15,12 +15,13 @@ <%= f.input :license_data %> <%= f.input :base_currency %> <%= f.input :cloud_token %> - <%= f.input :cloud_url %> + <%= f.input :cloud_url %> <%= f.input :owner_token %> <%= f.input :id_prefix %> <%= f.input :is_rounding_adj %> <%= f.input :quick_sale_summary %> <%= f.input :calc_tax_order %> + <%= f.input :show_account_info %> diff --git a/app/views/settings/shops/index.html.erb b/app/views/settings/shops/index.html.erb index 61005a34..c323defa 100755 --- a/app/views/settings/shops/index.html.erb +++ b/app/views/settings/shops/index.html.erb @@ -23,6 +23,7 @@ Rouding Adj View Sale Summary Calculate Tax + Show Account Info Actions @@ -36,7 +37,7 @@ <%= shop.is_rounding_adj %> <%= shop.quick_sale_summary %> <%= shop.calc_tax_order %> - + <%= shop.show_account_info %> <%= 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' %> diff --git a/db/migrate/20170530072247_create_shops.rb b/db/migrate/20170530072247_create_shops.rb index 2d2f68ad..bd25c970 100755 --- a/db/migrate/20170530072247_create_shops.rb +++ b/db/migrate/20170530072247_create_shops.rb @@ -21,6 +21,7 @@ class CreateShops < ActiveRecord::Migration[5.1] t.boolean :is_rounding_adj, :default => false t.boolean :quick_sale_summary, :default => false t.boolean :calc_tax_order, :default => false + t.boolean :show_account_info, :default => true t.timestamps end end