mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:57:35 -05:00 
			
		
		
		
	Change invoice_item_type_id to line_item_type_id (#3187)
* fix typo * php-cs traits * CS fixer pass * Password protect User routes * Implement checks to prevent editing a deleted record * Clean up payment flows * Fixes for tests * Fix for missing * Change invoice_item_type_id to line_item_type_id
This commit is contained in:
		
							parent
							
								
									f712b789ca
								
							
						
					
					
						commit
						c47bf76f48
					
				@ -51,10 +51,10 @@ class InvoiceItem
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public $custom_value4 = '';
 | 
					    public $custom_value4 = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public $invoice_item_type_id = 1; //1 = product, 2 = service
 | 
					    public $line_item_type_id = 1; //1 = product, 2 = service, 3 unpaid gateway fee, 4 paid gateway fee
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static $casts = [
 | 
					    public static $casts = [
 | 
				
			||||||
        'invoice_item_type_id' => 'string',
 | 
					        'line_item_type_id' => 'string',
 | 
				
			||||||
        'quantity' => 'float',
 | 
					        'quantity' => 'float',
 | 
				
			||||||
        'cost' => 'float',
 | 
					        'cost' => 'float',
 | 
				
			||||||
        'product_key' => 'string',
 | 
					        'product_key' => 'string',
 | 
				
			||||||
 | 
				
			|||||||
@ -59,12 +59,15 @@ class MultiDB
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        //multi-db active
 | 
					        //multi-db active
 | 
				
			||||||
        foreach (self::$dbs as $db) {
 | 
					        foreach (self::$dbs as $db) {
 | 
				
			||||||
            if (Company::whereSubdomain($subdomain)->get()->count() >=1) {
 | 
					          
 | 
				
			||||||
 | 
					            if (Company::on($db)->whereSubdomain($subdomain)->get()->count() >=1) {
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					          
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self::setDefaultDatabase();
 | 
					        self::setDefaultDatabase();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return true;
 | 
					        return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -27,7 +27,7 @@ class InvoiceItemTransformer extends EntityTransformer
 | 
				
			|||||||
            'tax_rate1' => (float) ($item->tax_rate1 ?: 0.0),
 | 
					            'tax_rate1' => (float) ($item->tax_rate1 ?: 0.0),
 | 
				
			||||||
            'tax_name2' => $item->tax_name2 ? $item->tax_name2 : '',
 | 
					            'tax_name2' => $item->tax_name2 ? $item->tax_name2 : '',
 | 
				
			||||||
            'tax_rate2' => (float) ($item->tax_rate2 ?: 0.0),
 | 
					            'tax_rate2' => (float) ($item->tax_rate2 ?: 0.0),
 | 
				
			||||||
            'invoice_item_type_id' => (string) $item->invoice_item_type_id ?: '',
 | 
					            'line_item_type_id' => (string) $item->line_item_type_id ?: '',
 | 
				
			||||||
            'custom_value1' => $item->custom_value1 ?: '',
 | 
					            'custom_value1' => $item->custom_value1 ?: '',
 | 
				
			||||||
            'custom_value2' => $item->custom_value2 ?: '',
 | 
					            'custom_value2' => $item->custom_value2 ?: '',
 | 
				
			||||||
            'discount' => (float) $item->discount ?: '',
 | 
					            'discount' => (float) $item->discount ?: '',
 | 
				
			||||||
 | 
				
			|||||||
@ -66,7 +66,7 @@ trait MockAccountData
 | 
				
			|||||||
        $cached_tables = config('ninja.cached_tables');
 | 
					        $cached_tables = config('ninja.cached_tables');
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        foreach ($cached_tables as $name => $class) {
 | 
					        foreach ($cached_tables as $name => $class) {
 | 
				
			||||||
            if (! Cache::has($name)) {
 | 
					            
 | 
				
			||||||
            // check that the table exists in case the migration is pending
 | 
					            // check that the table exists in case the migration is pending
 | 
				
			||||||
            if (! Schema::hasTable((new $class())->getTable())) {
 | 
					            if (! Schema::hasTable((new $class())->getTable())) {
 | 
				
			||||||
                continue;
 | 
					                continue;
 | 
				
			||||||
@ -84,7 +84,7 @@ trait MockAccountData
 | 
				
			|||||||
            if ($tableData->count()) {
 | 
					            if ($tableData->count()) {
 | 
				
			||||||
                Cache::forever($name, $tableData);
 | 
					                Cache::forever($name, $tableData);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            }
 | 
					            
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user