Commit 7e7227c04e934c91e3d3e5b342ad9aa575e7634b
1 parent
79485323
Exists in
master
and in
28 other branches
[bsc-contract] Fixing sql query and interface
* Postgres doesn't accept emtpy string or null value in the in clause so i'm changing the empty value for -1, as there is no negative id. * Adjusting sizes of inputs (ActionItem2079)
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
plugins/bsc/controllers/bsc_plugin_myprofile_controller.rb
... | ... | @@ -196,9 +196,9 @@ class BscPluginMyprofileController < MyProfileController |
196 | 196 | def search_sale_product |
197 | 197 | query = params[:sales].map {|key, value| value}[0][:product_id] |
198 | 198 | enterprises = (params[:enterprises] || []).split(',') |
199 | - enterprises = enterprises.blank? ? '' : enterprises | |
199 | + enterprises = enterprises.blank? ? -1 : enterprises | |
200 | 200 | added_products = (params[:added_products] || []).split(',') |
201 | - added_products = added_products.blank? ? '' : added_products | |
201 | + added_products = added_products.blank? ? -1 : added_products | |
202 | 202 | render :text => Product.find(:all, :conditions => ["LOWER(name) LIKE ? AND enterprise_id IN (?) AND id NOT IN (?)", "%#{query}%", enterprises, added_products]). |
203 | 203 | map {|product| { :id => product.id, |
204 | 204 | :name => short_text(product_display_name(product), 60), | ... | ... |
plugins/bsc/public/contracts.js
... | ... | @@ -47,7 +47,7 @@ var BSCContracts = {}; |
47 | 47 | input.keydown(function(event){ if(event.keyCode == '13') return false }) |
48 | 48 | .tokenInput(searchUrl, opts); |
49 | 49 | $('#bsc-plugin-contract-total-row').before(tr); |
50 | - $('<input id="bsc-plugin-sale-'+id+'-quantity" class="bsc-plugin-sales-quantity '+required+' digits" name="sales['+id+'][quantity]" align="center" size="7" value="'+quantity+'"/>').appendTo(tds[1]); | |
50 | + $('<input id="bsc-plugin-sale-'+id+'-quantity" class="bsc-plugin-sales-quantity '+required+' digits" name="sales['+id+'][quantity]" align="center" size="8" value="'+quantity+'"/>').appendTo(tds[1]); | |
51 | 51 | $('<input id="bsc-plugin-sale-'+id+'-price" class="bsc-plugin-sales-price '+required+' number" name="sales['+id+'][price]" value="'+price+'"/>').appendTo(tds[2]); |
52 | 52 | }; |
53 | 53 | ... | ... |