Getting custom price for customer in priority? - odata

How Can I send to priority: Item SKU, Customer Id, Quantity and get the custom item price?
Tried this API call /LOGPART('demo')?CUSTNAME=111&QNT=5

Related

How to count unique values in one column based on two separate columns in sheets

For each account, I want the total number of unique customers that purchased "Tech1." My data is on one tab and the unique account list is on another.
I can get the number of rows that match the account and contain "Tech1" with this: =countifs($A$2:$A$30,$E2, $C$2:$C$30,"*Tech1*") But I can't figure out how to count each customer that contains the target product only once.
try
=COUNTUNIQUE(IFERROR(FILTER(B:B, A:A="xxx", REGEXMATCH(C:C, "Tech1"))))

How to filter for a object wiith a "value" and "name" in QBO api?

It seems like its the api won't permit a query filter of the form:
select * from purchaseorder where APAccountRef.value='33'
In the case of purchase orders it seems to mean that I need to bring down every purchase order to my server and scan for the account I need which is highly suboptimal. Is there some other syntax for querying against the many attributes which have been encoded like
"APAccountRef": {
"value": "33",
"name": "Accounts Payable (A/P)"
}
with just a name and value attribute?
If you refer to the documentation:
https://developer.intuit.com/docs/api/accounting/purchaseorder
It gives you a list of all fields, and a list of fields that are filterable. Your query is using a field that does not exist as part of Purchase Orders:
AccountRef.value='39'
The correct field is:
APAccountRef:
required
ReferenceType, filterable
Specifies to which AP account the bill is credited.
So your query should be:
SELECT * FROM purchaseorder WHERE APAccountRef = '39'
Try this in python-
"select * from purchaseorder where APAccountRef in ('33')"

1.How to Store multiple assests for participant in hyperledger composer

Hi iam new to Blockchain .. please help with this.
1.I have customer participant should able to store multiple assests.
2. How to query all products of a customer
namespace demo
participant Customer identified by customerId {
o String customerId
o String firstName
o String lastName
o String email
o String phone
o Address address optional
--> Product[] product optional // here i need to store multiple products that belongs to this customer
}
asset Product identified by productId{
o String productId
o productType producttype
o String productName
o String model
--> Customer owner optional
}
1-i think in your business case there is no meaning to add owner to each product because you already have array of assets(Products) which belongs to each Customer.
1.1-to save multiple assets in your product array this will be done in Transaction Processing Function in logic.js file
in the documentation link below you will find very useful information about how to implement it:
https://hyperledger.github.io/composer/latest/reference/js_scripts
1.2-as solution for query you are going to query this participant registry by the customerId and in the results you will find your array of products. as the following.
in the queries.qry file
query CurrentCustomer {
description: "Returns Certain Customer Details in This Registry"
statement:
SELECT demo.Customer
WHERE (customerId == _$customerId)
}
for better understanding about queries you can check the documentation link below:
https://hyperledger.github.io/composer/latest/tutorials/queries
2-the question here are you going to add new products to this array each time the customer will buy Product ?
so imagine your customer have bought 10,000 products and with multiple Customer with this rate your application performance will not be the best because retrieving this much of data and mutate it then update your participant(Customer).
you can instead build relation between customer and invoice and each invoice contains enum of Product will be represented as concept which will contains all product properties and in this case each invoice will have owner so you can query all invoices for certain customer.

The totals of the cart item amounts do not match order amounts. error with paypal express gem in rails

I have used gem 'paypal-express' for connecting paypal from rails 4 application.
I have added to
item = {
name: self.title,
description: self.title,
quantity: self.quantity,
item_number: self.item_number,
amount: self.amount
}
as a payment request.. For multiple number of items it is always showing the following error..
The totals of the cart item amounts do not match order amounts
I have rounded off the value to 2 decimal places.. But it still shows error ...
Is there any way to fix it?
Thanks

Find most recent donation excluding funds beginning with X

I'm trying to grab the gift date of the most recent donation (in $USD) to my organization that has a fund ID not beginning in X (those are Canadian donations). Here's the code (in the controller) that I've used to pull out the gift date of the most recent overall donation, but it's a Canadian gift (fund_id = XP05). How do I get the most recent donation with a fund ID not beginning with an X?
#income_batch = Gift.between(Date.today - 2.weeks, Date.today, :field => :gift_date).order('gift_date DESC').first.gift_date
Assuming fund_id is a string field within your gifts table, you can use not like:
Gift.where("fund_id not like 'X%").between....
You should also avoid using an _id postfix on fields unless they're foreign keys, as Rails convention dictates that _id is specific for this purpose.
If fund_id is a foreign key, and you have a belongs_to :fund inside your Gift model, you can use joins and not like:
Gift.joins(:fund).where("funds.name not like 'X%").between....
This assumes that the field within the funds table is called name.

Resources