Created
April 18, 2014 16:32
-
-
Save jsqu99/11052950 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | |
"documentType$_identifier" => "Standard Order", | |
"active" => true, | |
"salesTransaction" => true, | |
"documentStatus" => "CO", | |
"documentAction" => "--", | |
"processNow" => false, | |
"processed" => true, | |
"documentType" => "466AF4B0136A4A3F9F84129711DA8BD3", | |
"documentType$_identifier" => "Standard Order", | |
"transactionDocument" => "466AF4B0136A4A3F9F84129711DA8BD3", | |
"transactionDocument$_identifier" => "Standard Order", | |
"description" => nil, | |
"delivered" => false, | |
"reinvoice" => false, | |
"print" => false, | |
"selected" => false, | |
"salesRepresentative" => nil, | |
"datePrinted" => nil, | |
"printDiscount" => false, | |
"formOfPayment" => "P", | |
"invoiceTerms" => "D", | |
"deliveryTerms" => "A", | |
"freightCostRule" => "I", | |
"freightAmount" => 0, | |
"deliveryMethod" => "P", | |
"shippingCompany" => nil, | |
"charge" => nil, | |
"chargeAmount" => 0, | |
"priority" => "5", | |
"salesCampaign" => nil, | |
"project" => nil, | |
"activity" => nil, | |
"posted" => "N", | |
"copyFrom" => false, | |
"dropShipPartner" => nil, | |
"dropShipLocation" => nil, | |
"dropShipContact" => nil, | |
"selfService" => false, | |
"trxOrganization" => nil, | |
"stDimension" => nil, | |
"ndDimension" => nil, | |
"deliveryNotes" => nil, | |
"incoterms" => nil, | |
"iNCOTERMSDescription" => nil, | |
"generateTemplate" => false, | |
"deliveryLocation" => nil, | |
"copyFromPO" => false, | |
"fINPaymentPriority" => nil, | |
"pickFromShipment" => false, | |
"receiveMaterials" => false, | |
"createInvoice" => false, | |
"returnReason" => nil, | |
"addOrphanLine" => false, | |
"asset" => nil, | |
"calculatePromotions" => false, | |
"costcenter" => nil, | |
"createOrder" => false, | |
"rejectReason" => nil, | |
"validUntil" => nil, | |
"quotation" => nil, | |
"reservationStatus" => nil, | |
"createPOLines" => false, | |
"cashVAT" => false | |
} | |
OpenbravoSyncher.put(OpenbravoSyncher::REST_APP_PATH + "Order", {:body => { :data => data }.to_json, :basic_auth => {:username => 'Openbravo', :password => 'openbravo'}}) | |
=> { | |
"response" => { | |
"status" => -1, | |
"error" => { | |
"message" => "Document posted/processed", | |
"messageType" => "Error", | |
"title" => "" | |
}, | |
"totalRows" => 0 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment