mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:40:09 -05: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()
 | 
					    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 [
 | 
					        return [
 | 
				
			||||||
          'entityType' => ENTITY_QUOTE,
 | 
					          'entityType' => ENTITY_QUOTE,
 | 
				
			||||||
          'account' => Auth::user()->account,
 | 
					          'account' => Auth::user()->account,
 | 
				
			||||||
          'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')),
 | 
					          'products' => Product::scope()->orderBy('id')->get(array('product_key', 'notes', 'cost', 'qty')),
 | 
				
			||||||
 | 
					          'taxRateOptions' => $options,
 | 
				
			||||||
 | 
					          'defaultTax' => $defaultTax,
 | 
				
			||||||
          'countries' => Cache::get('countries'),
 | 
					          'countries' => Cache::get('countries'),
 | 
				
			||||||
          'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(),
 | 
					          'clients' => Client::scope()->with('contacts', 'country')->orderBy('name')->get(),
 | 
				
			||||||
          'taxRates' => TaxRate::scope()->orderBy('name')->get(),
 | 
					          'taxRates' => TaxRate::scope()->orderBy('name')->get(),
 | 
				
			||||||
 | 
				
			|||||||
@ -815,7 +815,7 @@
 | 
				
			|||||||
            @endif
 | 
					            @endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            if(model.invoice().expenses() && !model.invoice().public_id()){
 | 
					            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
 | 
					                // move the blank invoice line item to the end
 | 
				
			||||||
                var blank = model.invoice().invoice_items.pop();
 | 
					                var blank = model.invoice().invoice_items.pop();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user