Skip to content

Instantly share code, notes, and snippets.

openbravo@ip-172-31-32-214:/opt/OpenbravoERP/src-gen/org/openbravo/model$ find . -type f -name *.java | xargs grep public.*String.*ENTITY_N
./sales/ConditionGoods.java: public static final String ENTITY_NAME = "ConditionGoods";
./sales/CommissionDetail.java: public static final String ENTITY_NAME = "SalesCommissionDetail";
./sales/CommissionAmount.java: public static final String ENTITY_NAME = "SalesCommissionAmount";
./sales/CommissionLine.java: public static final String ENTITY_NAME = "SalesCommissionLine";
./sales/Commission.java: public static final String ENTITY_NAME = "SalesCommission";
./sales/CommissionRun.java: public static final String ENTITY_NAME = "SalesCommissionRun";
./sales/SalesRegion.java: public static final String ENTITY_NAME = "SalesRegion";
./financialmgmt/tax/TaxRate.java: public static final String ENTITY_NAME = "FinancialMgmtTaxRate";
./financialmgmt/tax/Withholding.java: public static final String ENTITY_NAME = "FinancialMgmtWithholding";
justin44 has 123 in one warehouse and 0 in another
after creating an order (qty = 11), before hitting 'book'
justin44 = OpenbravoSyncher.get("/openbravo/org.openbravo.service.json.jsonrest/MaterialMgmtStorageDetail?_where=product%3D'72CFA7AF3A20471EAD463C41332EAA00'", {:basic_auth => {:username => 'Openbravo', :password => 'openbravo'}})
"quantityOnHand" => 123,
"onHandOrderQuanity" => nil,
"lastInventoryCountDate" => "2014-02-06",
"quantityInDraftTransactions" => 0,
module Spree
class CurrencyController < Spree::StoreController
def set
@currency = supported_currencies.find { |currency| currency.iso_code == params[:currency] }
# make sure that we update the current order, so the currency change is reflected
if current_order
current_order.update_attributes!(currency: @currency.iso_code)
end
module Spree::Core::Search
Base.class_eval do
def method_missing(name,*args,&block)
@properties[name]
end
end
class SpreeSunspot < defined?(Spree::Search::MultiDomain) ? Spree::Search::MultiDomain : Spree::Core::Search::Base
(function($) {
$.extend($.fn, {
makeCssInline: function() {
this.each(function(idx, el) {
var style = el.style;
var properties = [];
for(var property in style) {
if($(this).css(property)) {
properties.push(property + ':' + $(this).css(property));
}
data = {"_identifier" => spree_order.number,
"_entityName" => "Order",
"salesTransaction" => true,
"transactionDocument" => "466AF4B0136A4A3F9F84129711DA8BD3",
"transactionDocument$_identifier" => "Standard Order",
"orderDate" => spree_order.completed_at,
"currency$_identifier" => spree_order.currency,
"summedLineAmount" => spree_order.item_total.to_f,
"grandTotalAmount" => spree_order.total.to_f,
"documentType" => "466AF4B0136A4A3F9F84129711DA8BD3",
def process_monthly_crates(crate_date=DateTime.now)
# find the appropriate spree variant for this date / tshirt size. There could be more than one.
# let's create a hash of available variants and their available inventory
variants = {}
all_active_subscriptions = # find in batches
all_active_subscriptions.each do |sub|
~/src/legacy_lootcrate$: be rake -f perf.rake perf:require_bench RAILS_ENV=development
Booting: development
## Impact of `require <file>` on RAM
Showing all `require <file>` calls that consume 0.3 mb or more of RSS
Configure with `CUT_OFF=0` for all entries or `CUT_OFF=5` for few entries
Note: Files only count against RAM on their first load.
If multiple libraries require the same file, then
the 'cost' only shows up under the first library
subscription = Recurly::Subscription.create(
:plan_code => 'gold',
:currency => 'EUR',
:customer_notes => 'Thank you for your business!',
:account => {
:account_code => '1',
:email => 'verena@example.com',
:first_name => 'Verena',
:last_name => 'Example',
:billing_info => {
require 'active_support/core_ext/date/calculations'
require 'active_support/core_ext/numeric/time'
require 'base64'
#Unirest.timeout(240) # generous timeout
class ShipstationClient
class ResponseError < StandardError; end
class << self