New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add discount value in quickbooks #216
Comments
you could add a line item with a negative amount ? |
Like this:
XML
|
Thanks minimul for your reply,i have a question here, as discount_account_id is optional as written by ruckus here |
Perhaps it is optional for percent-based discounts but not for value based. Try an account reference for discount_account_id. Should be an income account. |
Thanks, currently i am working on sandbox, what can i add here as accountid |
Try 86 |
i tried it but no luck, it gives this message |
Try it with an active Customer ID
|
I have tried with an active customer id but without discount line item it worked, but when i add discount line item having discount_account_id with active customer id, it gives me below message: Invalid Reference Id: Here is my invoice object while debugging: {"line_items":[{"amount":"5.99","description":"Plush Baby Doll","detail_type":"SalesItemLineDetail","sales_line_item_detail":{"unit_price":"5.99","quantity":1,"item_ref":{"value":"36"}}},{"amount":1,"detail_type":"DiscountLineDetail","discount_line_detail":{"discount_account_ref":{"value":95}}}],"customer_ref":{"value":95},"txn_date":"2015-02-04","doc_number":""} |
Try discount_account_id = 86 or go to the API explorer at https://developer.intuit.com and do a
to find a valid income account. |
Thanks minimul for guidance, i found an active account by query and assigned to it and it worked |
Hi, i am new to quickbooks. |
Yes and Yes. |
discount_account_id is optional. Here is my code with discount value and its working fine. discount_line_item = Quickbooks::Model::InvoiceLineItem.new |
Hi, i am new to quickbooks-ruby
just going through the code by how we can add percent discount using the below code:
discount_line_item = Quickbooks::Model::InvoiceLineItem.new
discount_line_item.amount = 149
discount_line_item.discount_item! do |detail|
detail.discount_percent = 10
detail.percent_based = true
detail.discount_account_id = 99
end
invoice.line_items << discount_line_item
but how can we add discount value in the transaction other than percent discount?
The text was updated successfully, but these errors were encountered: