{"action":"created","issue":{"url":"https://api.github.com/repos/sidecars/python-quickbooks/issues/27","repository_url":"https://api.github.com/repos/sidecars/python-quickbooks","labels_url":"https://api.github.com/repos/sidecars/python-quickbooks/issues/27/labels{/name}","comments_url":"https://api.github.com/repos/sidecars/python-quickbooks/issues/27/comments","events_url":"https://api.github.com/repos/sidecars/python-quickbooks/issues/27/events","html_url":"https://github.com/sidecars/python-quickbooks/issues/27","id":159390839,"number":27,"title":"Documentation","user":{"login":"johncronin3","id":1261668,"avatar_url":"https://avatars.githubusercontent.com/u/1261668?v=3","gravatar_id":"","url":"https://api.github.com/users/johncronin3","html_url":"https://github.com/johncronin3","followers_url":"https://api.github.com/users/johncronin3/followers","following_url":"https://api.github.com/users/johncronin3/following{/other_user}","gists_url":"https://api.github.com/users/johncronin3/gists{/gist_id}","starred_url":"https://api.github.com/users/johncronin3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johncronin3/subscriptions","organizations_url":"https://api.github.com/users/johncronin3/orgs","repos_url":"https://api.github.com/users/johncronin3/repos","events_url":"https://api.github.com/users/johncronin3/events{/privacy}","received_events_url":"https://api.github.com/users/johncronin3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-09T11:59:41Z","updated_at":"2016-06-09T21:25:36Z","closed_at":null,"body":"Is there any better documentation on the usage of this library?  Tried to create an Invoice with Line Items and it was a struggle."},"comment":{"url":"https://api.github.com/repos/sidecars/python-quickbooks/issues/comments/225031675","html_url":"https://github.com/sidecars/python-quickbooks/issues/27#issuecomment-225031675","issue_url":"https://api.github.com/repos/sidecars/python-quickbooks/issues/27","id":225031675,"user":{"login":"ej2","id":460134,"avatar_url":"https://avatars.githubusercontent.com/u/460134?v=3","gravatar_id":"","url":"https://api.github.com/users/ej2","html_url":"https://github.com/ej2","followers_url":"https://api.github.com/users/ej2/followers","following_url":"https://api.github.com/users/ej2/following{/other_user}","gists_url":"https://api.github.com/users/ej2/gists{/gist_id}","starred_url":"https://api.github.com/users/ej2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ej2/subscriptions","organizations_url":"https://api.github.com/users/ej2/orgs","repos_url":"https://api.github.com/users/ej2/repos","events_url":"https://api.github.com/users/ej2/events{/privacy}","received_events_url":"https://api.github.com/users/ej2/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T21:25:36Z","updated_at":"2016-06-09T21:25:36Z","body":"```\r\nfrom quickbooks.objects.base import CustomerMemo, EmailAddress\r\nfrom quickbooks.objects.detailline import SaleItemLine, SalesItemLineDetail\r\nfrom quickbooks.objects.invoice import Invoice\r\nfrom quickbooks.objects.item import Item\r\nfrom quickbooks.objects.customer import Customer\r\n\r\n# Get customer from Quickbooks\r\ncustomer = Customer.get(1)\r\n\r\n# Get item from Quickbooks\r\nitem = Item.get(1)\r\n\r\n# Create Invoice\r\ninvoice = Invoice()\r\ninvoice.DueDate = qb_date_format(due_date)  # qb_date_format defined below\r\ninvoice.CustomerRef = customer.to_ref()\r\ninvoice.CustomerMemo = CustomerMemo()\r\ninvoice.CustomerMemo.value = \"memo\"\r\ninvoice.PrivateNote = \"private note\"\r\n\r\n# Optional Billing Email \r\ninvoice.BillEmail = EmailAddress()\r\ninvoice.BillEmail.Address = \"bill@mail.com\"\r\n\r\n# Create Invoice line item\r\nline = SaleItemLine()\r\nline.LineNum = 1\r\nline.Description = \"description\"\r\nline.Amount = 100\r\n\r\nline.SalesItemLineDetail = SalesItemLineDetail()\r\nline.SalesItemLineDetail.ItemRef = item.to_ref()\r\nline.SalesItemLineDetail.ServiceDate = qb_date_format(date.today())\r\n\r\n# Add line item to invoice\r\ninvoice.Line.append(line)\r\n\r\ninvoice.save()\r\n\r\n\r\n# Simple helper function to format dates the QuickBooks way \r\ndef qb_date_format(input_date):\r\n    return input_date.strftime(\"%Y-%m-%d\")\r\n```"}}
{"actor":{"display_login":"ej2"}}