mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-30 13:12:56 -04:00 
			
		
		
		
	Fixes for setting default invoice terms/footers (#3439)
This commit is contained in:
		
							parent
							
								
									5bca8f8ad8
								
							
						
					
					
						commit
						c57e6b0c6a
					
				| @ -209,7 +209,7 @@ class InvoiceController extends BaseController { | |||||||
| 
 | 
 | ||||||
| 		$client = Client::find($request->input('client_id')); | 		$client = Client::find($request->input('client_id')); | ||||||
| 
 | 
 | ||||||
| 		$invoice = $this->invoice_repo->save($request->all(), InvoiceFactory::create(auth()->user()->company(), auth()->user()->id)); | 		$invoice = $this->invoice_repo->save($request->all(), InvoiceFactory::create(auth()->user()->company()->id, auth()->user()->id)); | ||||||
| 
 | 
 | ||||||
| 		$invoice = StoreInvoice::dispatchNow($invoice, $request->all(), $invoice->company);//todo potentially this may return mixed ie PDF/$invoice... need to revisit when we implement UI
 | 		$invoice = StoreInvoice::dispatchNow($invoice, $request->all(), $invoice->company);//todo potentially this may return mixed ie PDF/$invoice... need to revisit when we implement UI
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -467,7 +467,7 @@ class Client extends BaseModel implements HasLocalePreference | |||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|     public function setInvoiceDefaults() :Invoice |     public function setInvoiceDefaults($invoice) :Invoice | ||||||
|     { |     { | ||||||
|         $invoice->terms = $this->getSetting('invoice_terms'); |         $invoice->terms = $this->getSetting('invoice_terms'); | ||||||
|         $invoice->footer = $this->getSetting('invoice_footer'); |         $invoice->footer = $this->getSetting('invoice_footer'); | ||||||
| @ -476,7 +476,7 @@ class Client extends BaseModel implements HasLocalePreference | |||||||
|         return $invoice; |         return $invoice; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public function setQuoteDefaults() :Quote |     public function setQuoteDefaults($quote) :Quote | ||||||
|     { |     { | ||||||
|         $quote->terms = $this->getSetting('quote_terms'); |         $quote->terms = $this->getSetting('quote_terms'); | ||||||
|         $quote->footer = $this->getSetting('quote_footer'); |         $quote->footer = $this->getSetting('quote_footer'); | ||||||
| @ -485,7 +485,7 @@ class Client extends BaseModel implements HasLocalePreference | |||||||
|         return $quote; |         return $quote; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public function setCreditDefaults() :Credit |     public function setCreditDefaults($credit) :Credit | ||||||
|     { |     { | ||||||
|         $credit->terms = $this->getSetting('credit_terms'); |         $credit->terms = $this->getSetting('credit_terms'); | ||||||
|         $credit->footer = $this->getSetting('credit_footer'); |         $credit->footer = $this->getSetting('credit_footer'); | ||||||
|  | |||||||
| @ -197,7 +197,7 @@ class BaseRepository | |||||||
|         //if new, set defaults!
 |         //if new, set defaults!
 | ||||||
|         if(!$model->id) { |         if(!$model->id) { | ||||||
|             $methodName = "set" . $resource . "Defaults"; |             $methodName = "set" . $resource . "Defaults"; | ||||||
|             $model = $client->{$methodName}(); |             $model = $client->{$methodName}($model); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user