Commits

Jesse Terry committed 8d5ae55

Inventory: Stock levels will now properly update if an invoice is deleted.

Comments (0)

Files changed (1)

application/modules_core/invoices/models/mdl_invoices.php

 
     public function delete($invoice_id) {
 
+        $this->db->query('DELETE FROM mcb_inventory_stock WHERE invoice_item_id IN (SELECT invoice_item_id FROM mcb_invoice_items WHERE invoice_id = ' . $invoice_id . ')');
+
         parent::delete(array('invoice_id'=>$invoice_id));
 
         $this->db->where('invoice_id', $invoice_id);