mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 11:24:28 -04:00
Fix for quotes
This commit is contained in:
parent
b296c55911
commit
d4915074b6
@ -111,10 +111,27 @@ class QuoteController extends BaseController
|
||||
|
||||
private static function getViewModel()
|
||||
{
|
||||
// Tax rate $options
|
||||
$account = Auth::user()->account;
|
||||
$rates = TaxRate::scope()->orderBy('name')->get();
|
||||
$options = [];
|
||||
$defaultTax = false;
|
||||
|
||||
foreach ($rates as $rate) {
|
||||
$options[$rate->rate . ' ' . $rate->name] = $rate->name . ' ' . ($rate->rate+0) . '%';
|
||||
|
||||
// load default invoice tax
|
||||
if ($rate->id == $account->default_tax_rate_id) {
|
||||
$defaultTax = $rate;
|
||||
}
|
||||
}
|
||||
|
||||
return [
|
||||
'entityType' => ENTITY_QUOTE,
|
||||
'account' => Auth::user()->account,
|
||||
'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')),
|
||||
'taxRateOptions' => $options,
|
||||
'defaultTax' => $defaultTax,
|
||||
'countries' => Cache::get('countries'),
|
||||
'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(),
|
||||
'taxRates' => TaxRate::scope()->orderBy('name')->get(),
|
||||
|
@ -815,7 +815,7 @@
|
||||
@endif
|
||||
|
||||
if(model.invoice().expenses() && !model.invoice().public_id()){
|
||||
model.expense_currency_id({{ $expenseCurrencyId }});
|
||||
model.expense_currency_id({{ isset($expenseCurrencyId) ? $expenseCurrencyId : 0 }});
|
||||
|
||||
// move the blank invoice line item to the end
|
||||
var blank = model.invoice().invoice_items.pop();
|
||||
|
Loading…
x
Reference in New Issue
Block a user