BrendanMyers88 / EverFresh

EverFresh
https://www.myeverfresh.com
0 stars 0 forks source link

Send CSV to QB upon checkout #4

Closed ckcollab closed 5 years ago

ckcollab commented 6 years ago

eg creation:

from quickbooks.objects import (Invoice, 
                                SalesItemLineDetail, 
                                SalesItemLine)

customer_ref = Ref()
customer_ref.value = 123
customer_ref.name = 'Ivan Petrov'
customer_ref.type = 'Customer'
# or customer_ref = Customer.get(123, qb=client).to_ref()

line_detail = SalesItemLineDetail()
line_detail.UnitPrice = 100  # in dollars
line_detail.Qty = 1  # quantity can be decimal

line = SalesItemLine()
line.Amount = 100  # in dollars
line.SalesItemLineDetail = line_detail

invoice = Invoice()
invoice.CustomerRef = customer_ref
invoice.Line = [line]

client = QuickBooks(...)

invoice.save(qb=client)