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