diff --git a/app/Utils/Traits/MakesInvoiceValues.php b/app/Utils/Traits/MakesInvoiceValues.php index 1cdb2f97b4a9..6f0b4ea02971 100644 --- a/app/Utils/Traits/MakesInvoiceValues.php +++ b/app/Utils/Traits/MakesInvoiceValues.php @@ -305,18 +305,18 @@ trait MakesInvoiceValues // 08-02-2022 - fix for regression below // $data[$key][$table_type.'.quantity'] = Number::formatValue($item->quantity, $this->client->currency()); - $data[$key][$table_type.'.quantity'] = Number::formatValueNoTrailingZeroes($item->quantity, $this->client->currency()); + $data[$key][$table_type.'.quantity'] = ($item->quantity == 0) ? '' : Number::formatValueNoTrailingZeroes($item->quantity, $this->client->currency()); - $data[$key][$table_type.'.unit_cost'] = Number::formatMoneyNoRounding($item->cost, $this->client); + $data[$key][$table_type.'.unit_cost'] = ($item->cost == 0) ? '' : Number::formatMoneyNoRounding($item->cost, $this->client); - $data[$key][$table_type.'.cost'] = Number::formatMoney($item->cost, $this->client); + $data[$key][$table_type.'.cost'] = ($item->cost == 0) ? '' : Number::formatMoney($item->cost, $this->client); - $data[$key][$table_type.'.line_total'] = Number::formatMoney($item->line_total, $this->client); + $data[$key][$table_type.'.line_total'] = ($item->line_total == 0) ? '' :Number::formatMoney($item->line_total, $this->client); if(property_exists($item, 'gross_line_total')) - $data[$key][$table_type.'.gross_line_total'] = Number::formatMoney($item->gross_line_total, $this->client); + $data[$key][$table_type.'.gross_line_total'] = ($item->gross_line_total == 0) ? '' :Number::formatMoney($item->gross_line_total, $this->client); else - $data[$key][$table_type.'.gross_line_total'] = 0; + $data[$key][$table_type.'.gross_line_total'] = ''; if (isset($item->discount) && $item->discount > 0) { if ($item->is_amount_discount) {