mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 00:07:35 -05:00 
			
		
		
		
	Merge pull request #4834 from turbo124/v5-develop
Fixes for default template
This commit is contained in:
		
						commit
						5f45a72445
					
				
							
								
								
									
										4
									
								
								.env.ci
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								.env.ci
									
									
									
									
									
								
							@ -10,6 +10,8 @@ DB_DATABASE1=ninja
 | 
				
			|||||||
DB_USERNAME1=root
 | 
					DB_USERNAME1=root
 | 
				
			||||||
DB_PASSWORD1=ninja
 | 
					DB_PASSWORD1=ninja
 | 
				
			||||||
DB_HOST1=127.0.0.1
 | 
					DB_HOST1=127.0.0.1
 | 
				
			||||||
 | 
					DB_PORT1=32768
 | 
				
			||||||
 | 
					DB_PORT=32768
 | 
				
			||||||
DB_DATABASE=ninja
 | 
					DB_DATABASE=ninja
 | 
				
			||||||
DB_USERNAME=root
 | 
					DB_USERNAME=root
 | 
				
			||||||
DB_PASSWORD=ninja
 | 
					DB_PASSWORD=ninja
 | 
				
			||||||
@ -17,4 +19,4 @@ DB_HOST=127.0.0.1
 | 
				
			|||||||
NINJA_ENVIRONMENT=hosted
 | 
					NINJA_ENVIRONMENT=hosted
 | 
				
			||||||
COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
 | 
					COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
 | 
				
			||||||
TRAVIS=true
 | 
					TRAVIS=true
 | 
				
			||||||
API_SECRET=superdoopersecrethere
 | 
					API_SECRET=superdoopersecrethere
 | 
				
			||||||
							
								
								
									
										15
									
								
								.github/workflows/phpunit.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								.github/workflows/phpunit.yml
									
									
									
									
										vendored
									
									
								
							@ -39,7 +39,7 @@ jobs:
 | 
				
			|||||||
      mariadb:
 | 
					      mariadb:
 | 
				
			||||||
        image: mariadb:latest
 | 
					        image: mariadb:latest
 | 
				
			||||||
        ports:
 | 
					        ports:
 | 
				
			||||||
          - 3306
 | 
					          - 32768:3306
 | 
				
			||||||
        env:
 | 
					        env:
 | 
				
			||||||
          MYSQL_ALLOW_EMPTY_PASSWORD: yes
 | 
					          MYSQL_ALLOW_EMPTY_PASSWORD: yes
 | 
				
			||||||
          MYSQL_USER: ninja
 | 
					          MYSQL_USER: ninja
 | 
				
			||||||
@ -52,7 +52,6 @@ jobs:
 | 
				
			|||||||
    - name: Start mysql service
 | 
					    - name: Start mysql service
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        sudo /etc/init.d/mysql start
 | 
					        sudo /etc/init.d/mysql start
 | 
				
			||||||
 | 
					 | 
				
			||||||
    - name: Verify MariaDB connection
 | 
					    - name: Verify MariaDB connection
 | 
				
			||||||
      env:
 | 
					      env:
 | 
				
			||||||
        DB_PORT: ${{ job.services.mariadb.ports[3306] }}
 | 
					        DB_PORT: ${{ job.services.mariadb.ports[3306] }}
 | 
				
			||||||
@ -62,12 +61,11 @@ jobs:
 | 
				
			|||||||
        while ! mysqladmin ping -h"127.0.0.1" -P"$DB_PORT" --silent; do
 | 
					        while ! mysqladmin ping -h"127.0.0.1" -P"$DB_PORT" --silent; do
 | 
				
			||||||
          sleep 1
 | 
					          sleep 1
 | 
				
			||||||
        done
 | 
					        done
 | 
				
			||||||
 | 
					 | 
				
			||||||
    - name: Setup PHP
 | 
					    - name: Setup PHP
 | 
				
			||||||
      uses: shivammathur/setup-php@v2
 | 
					      uses: shivammathur/setup-php@v2
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        php-version: ${{ matrix.php-versions }}
 | 
					        php-version: ${{ matrix.php-versions }}
 | 
				
			||||||
        extensions: mysql, sqlite3, bcmath, gmp, gd, curl, zip, openssl, mbstring, xml
 | 
					        extensions: mysql, mysqlnd, sqlite3, bcmath, gmp, gd, curl, zip, openssl, mbstring, xml
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    - uses: actions/checkout@v1
 | 
					    - uses: actions/checkout@v1
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
@ -77,33 +75,27 @@ jobs:
 | 
				
			|||||||
    - name: Copy .env
 | 
					    - name: Copy .env
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        cp .env.ci .env
 | 
					        cp .env.ci .env
 | 
				
			||||||
 | 
					 | 
				
			||||||
    - name: Install composer dependencies
 | 
					    - name: Install composer dependencies
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
 | 
					        composer config -g github-oauth.github.com ${{ secrets.GITHUB_TOKEN }}
 | 
				
			||||||
        composer install
 | 
					        composer install
 | 
				
			||||||
 | 
					 | 
				
			||||||
    - name: Prepare Laravel Application
 | 
					    - name: Prepare Laravel Application
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        php artisan key:generate
 | 
					        php artisan key:generate
 | 
				
			||||||
        php artisan optimize
 | 
					        php artisan optimize
 | 
				
			||||||
        php artisan cache:clear
 | 
					        php artisan cache:clear
 | 
				
			||||||
        php artisan config:cache
 | 
					        php artisan config:cache
 | 
				
			||||||
 | 
					 | 
				
			||||||
    - name: Create DB and schemas
 | 
					    - name: Create DB and schemas
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        mkdir -p database
 | 
					        mkdir -p database
 | 
				
			||||||
        touch database/database.sqlite
 | 
					        touch database/database.sqlite
 | 
				
			||||||
 | 
					 | 
				
			||||||
    - name: Migrate Database
 | 
					    - name: Migrate Database
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        php artisan migrate:fresh --seed --force && php artisan db:seed --force
 | 
					        php artisan migrate:fresh --seed --force && php artisan db:seed --force
 | 
				
			||||||
 | 
					 | 
				
			||||||
    - name: Prepare JS/CSS assets
 | 
					    - name: Prepare JS/CSS assets
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        npm i
 | 
					        npm i
 | 
				
			||||||
        npm run production
 | 
					        npm run production
 | 
				
			||||||
 | 
					 | 
				
			||||||
    - name: Run Testsuite
 | 
					    - name: Run Testsuite
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        cat .env
 | 
					        cat .env
 | 
				
			||||||
@ -113,5 +105,4 @@ jobs:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    - name: Run php-cs-fixer
 | 
					    - name: Run php-cs-fixer
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        vendor/bin/php-cs-fixer fix
 | 
					        vendor/bin/php-cs-fixer fix
 | 
				
			||||||
 | 
					 | 
				
			||||||
@ -224,8 +224,7 @@ class EmailTemplateDefaults
 | 
				
			|||||||
    private static function transformText($string)
 | 
					    private static function transformText($string)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        //preformat the string, removing trailing colons.
 | 
					        //preformat the string, removing trailing colons.
 | 
				
			||||||
        $string = rtrim($string, ":");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return str_replace(':', '$', ctrans('texts.'.$string));
 | 
					        return str_replace(':', '$', rtrim( ctrans('texts.'.$string), ":"));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -897,8 +897,9 @@ class Import implements ShouldQueue
 | 
				
			|||||||
                    if ($this->tryTransformingId('invoices', $invoice['invoice_id'])) {
 | 
					                    if ($this->tryTransformingId('invoices', $invoice['invoice_id'])) {
 | 
				
			||||||
                        $modified['invoices'][$key]['invoice_id'] = $this->transformId('invoices', $invoice['invoice_id']);
 | 
					                        $modified['invoices'][$key]['invoice_id'] = $this->transformId('invoices', $invoice['invoice_id']);
 | 
				
			||||||
                    } else {
 | 
					                    } else {
 | 
				
			||||||
                        $modified['credits'][$key]['credit_id'] = $this->transformId('credits', $invoice['invoice_id']);
 | 
					                       nlog($modified['invoices']);
 | 
				
			||||||
                        $modified['credits'][$key]['amount'] = $modified['invoices'][$key]['amount'];
 | 
					                        // $modified['credits'][$key]['credit_id'] = $this->transformId('credits', $invoice['invoice_id']);
 | 
				
			||||||
 | 
					                        // $modified['credits'][$key]['amount'] = $modified['invoices'][$key]['amount'];
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user