Skip to content

Commit

Permalink
Fixed doc error with adding line items (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
lsolesen committed Jul 24, 2017
1 parent 9824bdc commit 56bf05f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion README.md
Expand Up @@ -120,13 +120,17 @@ try {
use Billy\Invoices\InvoicesRepository;

try {
$invoice_line_items = array();

$invoice_line = new InvoiceLine();
$invoice_line->setProductID($product->getID())
->setQuantity(4)
->set('priority', $priority)
->setDescription('My description')
->setUnitPrice(20.25);

$invoice_line_items[] = $invoice_line->toArray();

$new_invoice = new Billy_Invoice();
$new_invoice->setType('invoice')
->setOrderNumber($order_number)
Expand All @@ -135,7 +139,7 @@ try {
->setEntryDate($entry_date)
->setPaymentTermsDays(8)
->setCurrencyID('DKK')
->set('lines', $invoice_line->toArray(););
->set('lines', $invoice_line_items);

$created_invoice = $repository->create($new_invoice);
$billy_invoice_id = $created_invoice->getID();
Expand Down

0 comments on commit 56bf05f

Please sign in to comment.