Topic: Cannot add received items to invoice
I have an invoice with some GL items. This is a wrong entry and I want to delete these GL items from the invoice and add the received item to the invoice.
I cannot add the received item to the invoice.
With debugging on it gives an error (some in dutch language):
Onbehandelde uitzondering [0]: Unsupported operand types: string - string. in bestand: /var/www/home.vogelnestje.nl/secure1/frontaccountingTst/purchasing/supplier_invoice.php op regel288
On this line the variable called
$_POST['prev_quantity_inv'.$n]
As the item has no inventory (it is a general cost for the compay), the above variable is empty and the error is raised.
I solved this by adding a check on the empty variable by changing the line to:
if ($SysPrefs->check_qty_charged_vs_del_qty == true && ($_POST['qty_recd'.$n] != $_POST['prev_quantity_inv'.$n]) && !empty($_POST['prev_quantity_inv'.$n]) )
Now I can change the invoice as expected.
I tested this on 2.14, from the GIT (https://sourceforge.net/p/frontaccounting/git/ci/master/tree/)
Is there a moderator who can add this to the source of FA?
Or am I allowed to do this myself?