mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 00:37:30 -04:00 
			
		
		
		
	Fixes for e-invoices
This commit is contained in:
		
							parent
							
								
									203279fb27
								
							
						
					
					
						commit
						aa5f00cd33
					
				| @ -93,7 +93,7 @@ class StoreClientRequest extends Request | |||||||
| 
 | 
 | ||||||
|         $rules['number'] = ['bail', 'nullable', Rule::unique('clients')->where('company_id', $user->company()->id)]; |         $rules['number'] = ['bail', 'nullable', Rule::unique('clients')->where('company_id', $user->company()->id)]; | ||||||
|         $rules['id_number'] = ['bail', 'nullable', Rule::unique('clients')->where('company_id', $user->company()->id)]; |         $rules['id_number'] = ['bail', 'nullable', Rule::unique('clients')->where('company_id', $user->company()->id)]; | ||||||
|         $rules['classification'] = 'bail|sometimes|nullable|in:individual,company,partnership,trust,charity,government,other'; |         $rules['classification'] = 'bail|sometimes|nullable|in:individual,business,partnership,trust,charity,government,other'; | ||||||
|          |          | ||||||
|         return $rules; |         return $rules; | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -60,7 +60,7 @@ class UpdateClientRequest extends Request | |||||||
|         $rules['size_id'] = 'integer|nullable'; |         $rules['size_id'] = 'integer|nullable'; | ||||||
|         $rules['country_id'] = 'integer|nullable'; |         $rules['country_id'] = 'integer|nullable'; | ||||||
|         $rules['shipping_country_id'] = 'integer|nullable'; |         $rules['shipping_country_id'] = 'integer|nullable'; | ||||||
|         $rules['classification'] = 'bail|sometimes|nullable|in:individual,company,partnership,trust,charity,government,other'; |         $rules['classification'] = 'bail|sometimes|nullable|in:individual,business,partnership,trust,charity,government,other'; | ||||||
| 
 | 
 | ||||||
|         if ($this->id_number) { |         if ($this->id_number) { | ||||||
|             $rules['id_number'] = Rule::unique('clients')->where('company_id', $user->company()->id)->ignore($this->client->id); |             $rules['id_number'] = Rule::unique('clients')->where('company_id', $user->company()->id)->ignore($this->client->id); | ||||||
|  | |||||||
| @ -182,9 +182,9 @@ class FacturaEInvoice extends AbstractService | |||||||
|             Storage::makeDirectory($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first())); |             Storage::makeDirectory($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first())); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         $this->fac->export(Storage::disk($disk)->path($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()) . $this->invoice->getFileName("xsig"))); |         // $this->fac->export(Storage::disk($disk)->path($this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()) . $this->invoice->getFileName("xsig")));
 | ||||||
| 
 |         return $this->fac->export(); | ||||||
|         return $this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()) . $this->invoice->getFileName("xsig"); |         // return $this->invoice->client->e_invoice_filepath($this->invoice->invitations->first()) . $this->invoice->getFileName("xsig");
 | ||||||
| 
 | 
 | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
| @ -469,9 +469,10 @@ class FacturaEInvoice extends AbstractService | |||||||
|         $company = $this->invoice->company; |         $company = $this->invoice->company; | ||||||
| 
 | 
 | ||||||
|         $seller = new FacturaeParty([ |         $seller = new FacturaeParty([ | ||||||
|             "isLegalEntity" => $company->custom_value1, // Se asume true si se omite
 |             // "isLegalEntity" => $company->custom_value1, // Se asume true si se omite
 | ||||||
|  |             "isLegalEntity" => $this->invoice->client->classification === 'individual' ? false : true, | ||||||
|             "taxNumber" => $company->settings->vat_number, |             "taxNumber" => $company->settings->vat_number, | ||||||
|             "name" => substr($company->present()->name(), 0, 40), |             "name" => $company->getSetting('classification') === 'individual' ? substr($company->owner()->present()->name(), 0, 40) : substr($company->present()->name(), 0, 40), | ||||||
|             "address" => substr($company->settings->address1, 0, 80), |             "address" => substr($company->settings->address1, 0, 80), | ||||||
|             "postCode" => substr($this->invoice->client->postal_code, 0, 5), |             "postCode" => substr($this->invoice->client->postal_code, 0, 5), | ||||||
|             "town" => substr($company->settings->city, 0, 50), |             "town" => substr($company->settings->city, 0, 50), | ||||||
| @ -504,7 +505,7 @@ class FacturaEInvoice extends AbstractService | |||||||
|     { |     { | ||||||
| 
 | 
 | ||||||
|         $buyer = new FacturaeParty([ |         $buyer = new FacturaeParty([ | ||||||
|         "isLegalEntity" => $this->invoice->client->has_valid_vat_number, |         "isLegalEntity" => $this->invoice->client->classification === 'individual' ? false : true, | ||||||
|         "taxNumber"     => $this->invoice->client->vat_number, |         "taxNumber"     => $this->invoice->client->vat_number, | ||||||
|         "name"          => substr($this->invoice->client->present()->name(),0, 40), |         "name"          => substr($this->invoice->client->present()->name(),0, 40), | ||||||
|         "firstSurname"  => substr($this->invoice->client->present()->first_name(),0, 40), |         "firstSurname"  => substr($this->invoice->client->present()->first_name(),0, 40), | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user