diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 357340506581..df78126e38fd 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -166,7 +166,7 @@ class CheckData extends Command //$this->logMessage('Result: ' . $result); if ($result && $result != $invoice->balance) { - $this->logMessage("PHP/JS amounts do not match {$link} - PHP: {$invoice->balance}, JS: {$result}"); + $this->logMessage("PHP/JS amounts do not match {$link}?silent=true | PHP: {$invoice->balance}, JS: {$result}"); $this->isValid = $isValid = false; } } diff --git a/resources/views/invoices/pdf.blade.php b/resources/views/invoices/pdf.blade.php index c25c12a354bf..57469feda360 100644 --- a/resources/views/invoices/pdf.blade.php +++ b/resources/views/invoices/pdf.blade.php @@ -110,16 +110,25 @@ try { return getPDFString(refreshPDFCB, force); } catch (exception) { - console.warn('Failed to generate PDF: %s', exception.message); - var href = location.href; - if (href.indexOf('/view/') > 0 && href.indexOf('phantomjs') == -1) { - var url = href.replace('/view/', '/download/') + '?base64=true'; - $.get(url, function(result) { - if (result && result.indexOf('data:application/pdf') == 0) { - refreshPDFCB(result); - } - }) - } + @if (Utils::isTravis()) + var message = exception.message || ''; + if (message.indexOf('Attempting to change value of a readonly property') >= 0) { + // do nothing + } else { + throw exception; + } + @else + console.warn('Failed to generate PDF: %s', exception.message); + var href = location.href; + if (href.indexOf('/view/') > 0 && href.indexOf('phantomjs') == -1) { + var url = href.replace('/view/', '/download/') + '?base64=true'; + $.get(url, function(result) { + if (result && result.indexOf('data:application/pdf') == 0) { + refreshPDFCB(result); + } + }) + } + @endif } } diff --git a/tests/acceptance/InvoiceCest.php b/tests/acceptance/InvoiceCest.php index dc1794f7404c..8d9d4b6742ab 100644 --- a/tests/acceptance/InvoiceCest.php +++ b/tests/acceptance/InvoiceCest.php @@ -54,10 +54,20 @@ class InvoiceCest $I->see($invoiceNumber); $I->see('199.01'); + for ($i=1; $i<=10; $i++) { + $this->updateDesign($I, $i); + } + $I->amOnPage("/clients/{$clientId}#invoices"); $I->see('199.01'); } + private function updateDesign($I, $designId) + { + $I->selectOption('#invoice_design_id', $designId); + $I->click('#saveButton'); + } + /* public function editInvoice(AcceptanceTester $I) {