mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:07:32 -05:00 
			
		
		
		
	Fixes for imports:
This commit is contained in:
		
							parent
							
								
									b313a3c3ae
								
							
						
					
					
						commit
						6b6fbcc412
					
				@ -213,6 +213,9 @@ class BaseImport
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        foreach ($data as $key => $record) {
 | 
			
		||||
            
 | 
			
		||||
            unset($record['']);
 | 
			
		||||
 | 
			
		||||
            try {
 | 
			
		||||
                $entity = $this->transformer->transform($record);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -121,7 +121,6 @@ class Csv extends BaseImport implements ImportInterface
 | 
			
		||||
 | 
			
		||||
        if (empty($data)) {
 | 
			
		||||
            $this->entity_count['clients'] = 0;
 | 
			
		||||
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -371,7 +371,8 @@ class BaseTransformer
 | 
			
		||||
     */
 | 
			
		||||
    public function getCountryId($name)
 | 
			
		||||
    {
 | 
			
		||||
        if (strlen($name) == 2) {
 | 
			
		||||
 | 
			
		||||
        if (strlen(trim($name)) == 2) {
 | 
			
		||||
            return $this->getCountryIdBy2($name);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -110,8 +110,8 @@ class ClientTransformer extends BaseTransformer
 | 
			
		||||
                    ),
 | 
			
		||||
                ],
 | 
			
		||||
            ],
 | 
			
		||||
            'country_id' => isset($data['client.country'])
 | 
			
		||||
                ? $this->getCountryId($data['client.country'])
 | 
			
		||||
            'country_id' => isset($data['client.country_id'])
 | 
			
		||||
                ? $this->getCountryId($data['client.country_id'])
 | 
			
		||||
                : null,
 | 
			
		||||
            'shipping_country_id' => isset($data['client.shipping_country'])
 | 
			
		||||
                ? $this->getCountryId($data['client.shipping_country'])
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user