Open GoogleCodeExporter opened 9 years ago
There is also reference to this in Issue #1 with a potentially useful
explanation on why it doesn't work as it should:
What steps will reproduce the problem?
1. Use FreshBooks_Invoice::get() to get an existing invoice.
2. Call FreshBooks_Invoice::update() to update the invoice.
3. Examine the value for the $invoiceId field of the invoice.
What is the expected output?
The $invoiceId field of the invoice object should still contain the invoice ID.
What do you see instead?
The invoice ID is empty. This is because in
FreshBooks_ElementAction::update(), _internalPrepareCreate() is called
instead of _internalPrepareUpdate(), and _internalCreate() is called
instead of _internalUpdate() .
What version of the product are you using?
FreshBooks PHP 1.2
Original comment by jspit...@gmail.com
on 28 Dec 2013 at 3:46
Managed to fix this for the purpose of what I was trying to do with it (mark an
invoice as paid.)
Here's an example of how to do it:
$payment = new Freshbooks_Payment();
$payment->invoiceId = '00000324300';
// To mark payment as 'PAID', this amount must be the full amount outstanding on the invoice
$payment->amount = '2.44';
$payment->type = 'Bank Transfer';
$payment->create()
or die("Unable to mark Invoice as paid: " . $payment->lastError);
Hope that helps.
Original comment by jspit...@gmail.com
on 28 Dec 2013 at 8:31
Original issue reported on code.google.com by
jspit...@gmail.com
on 28 Dec 2013 at 3:44