PluginProbe
Easy Invoice – Invoice Generator, PDF Quotes & Payments / 2.4.2
Easy Invoice – Invoice Generator, PDF Quotes & Payments v2.4.2
2.4.3 2.4.4 2.4.2 2.4.0 2.4.1 2.3.8 2.3.7 2.3.6 2.3.5 2.3.4 2.3.3 2.3.2 2.3.1 2.2.0 2.1.21 2.1.20 2.1.19 2.1.18 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 All 60 releases
← All changes | includes/Repositories/InvoiceItemRepository.php +2 -2 2.1.0 → 2.4.2 View file →
@@ -161,9 +161,9 @@
161 161 $items = $this->findByInvoice($invoice_id);
162 162 $total = 0;
163 163
164 164 foreach ($items as $item) {
165 - $quantity = isset($item['quantity']) ? floatval($item['quantity']) : 1;
165 + $quantity = isset($item['quantity']) ? floatval($item['quantity']) : 0;
166 166 $price = isset($item['price']) ? floatval($item['price']) : 0;
167 167 $total += $quantity * $price;
168 168 }
169 169
@@ -191,9 +191,9 @@
191 191 protected function sanitizeItemData($data) {
192 192 return [
193 193 'name' => isset($data['name']) ? sanitize_text_field($data['name']) : '',
194 194 'description' => isset($data['description']) ? sanitize_textarea_field($data['description']) : '',
195 - 'quantity' => isset($data['quantity']) ? floatval($data['quantity']) : 1,
195 + 'quantity' => isset($data['quantity']) ? floatval($data['quantity']) : 0,
196 196 'price' => isset($data['price']) ? floatval($data['price']) : 0,
197 197 'tax_rate' => isset($data['tax_rate']) ? floatval($data['tax_rate']) : 0,
198 198 'taxable' => isset($data['taxable']) ? (string) $data['taxable'] : '0',
199 199 'discount' => isset($data['discount']) ? floatval($data['discount']) : 0,