CRM-17491 update price set field if quantity changes
authorBrian Shaughnessy <brian@lcdservices.biz>
Tue, 3 Nov 2015 00:48:05 +0000 (19:48 -0500)
committerBrian Shaughnessy <brian@lcdservices.biz>
Tue, 3 Nov 2015 00:48:05 +0000 (19:48 -0500)
CRM/Event/BAO/Participant.php

index 6e54464185dab6db9d9fb375e5f7ed098afa58e0..ea73cc3850cd9e55a5d9801ecb3478341d9fae87 100644 (file)
@@ -1871,7 +1871,8 @@ WHERE cpf.price_set_id = %1 AND cpfv.label LIKE %2";
           unset($insertLines[$previousLineItem['price_field_value_id']]);
           // for updating the line items i.e. use-case - once deselect-option selecting again
           if (($previousLineItem['line_total'] != $submittedLineItems[$previousLineItem['price_field_value_id']]['line_total']) ||
-            ($submittedLineItems[$previousLineItem['price_field_value_id']]['line_total'] == 0 && $submittedLineItems[$previousLineItem['price_field_value_id']]['qty'] == 1)
+            ($submittedLineItems[$previousLineItem['price_field_value_id']]['line_total'] == 0 && $submittedLineItems[$previousLineItem['price_field_value_id']]['qty'] == 1) ||
+            ($previousLineItem['qty'] != $submittedLineItems[$previousLineItem['price_field_value_id']]['qty'])
           ) {
             $updateLines[$previousLineItem['price_field_value_id']] = $submittedLineItems[$previousLineItem['price_field_value_id']];
             $updateLines[$previousLineItem['price_field_value_id']]['id'] = $id;