Skip to content

Commit

Permalink
Fixed saving an invoice to change product stock balance only if the i…
Browse files Browse the repository at this point in the history
…nvoice was previously deleted. Fixes #272.
  • Loading branch information
emaijala committed Nov 23, 2017
1 parent ed2e13e commit 0b714fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion form_funcs.php
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function saveFormData($table, &$primaryKey, &$formElements, &$values, &$warnings
'SELECT deleted FROM {prefix}invoice WHERE id=?',
[$primaryKey]
);
if ($checkValues) {
if ($checkValues[0]['deleted']) {
$rows = db_param_query(
'SELECT product_id, pcs FROM {prefix}invoice_row WHERE invoice_id=? AND deleted=0',
[$primaryKey]
Expand Down

0 comments on commit 0b714fb

Please sign in to comment.