mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
commit
aca5fba6d2
@ -1 +1 @@
|
||||
5.7.40
|
||||
5.7.41
|
@ -399,7 +399,12 @@ class InvoiceItemSum
|
||||
|
||||
$item_tax = 0;
|
||||
|
||||
$amount = $this->item->line_total - ($this->item->line_total * ($this->invoice->discount / $this->sub_total));
|
||||
try {
|
||||
$amount = $this->item->line_total - ($this->item->line_total * ($this->invoice->discount / $this->sub_total));
|
||||
} catch(\DivisionByZeroError $e) {
|
||||
$amount = $this->item->line_total;
|
||||
}
|
||||
|
||||
//$amount = ($this->sub_total > 0) ? $this->item->line_total - ($this->invoice->discount * ($this->item->line_total / $this->sub_total)) : 0;
|
||||
|
||||
$item_tax_rate1_total = $this->calcAmountLineTax($this->item->tax_rate1, $amount);
|
||||
|
@ -614,7 +614,7 @@ class PdfBuilder
|
||||
} else {
|
||||
$_type = Str::startsWith($type, '$') ? ltrim($type, '$') : $type;
|
||||
|
||||
foreach ($this->service->config->pdf_variables["{$_type}_columns"] as $key => $cell) {
|
||||
foreach ($this->service->config->pdf_variables[$table_type] as $key => $cell) {
|
||||
// We want to keep aliases like these:
|
||||
// $task.cost => $task.rate
|
||||
// $task.quantity => $task.hours
|
||||
@ -773,7 +773,6 @@ class PdfBuilder
|
||||
*/
|
||||
public function buildTableHeader(string $type): array
|
||||
{
|
||||
$this->processTaxColumns($type);
|
||||
|
||||
$elements = [];
|
||||
|
||||
@ -785,11 +784,16 @@ class PdfBuilder
|
||||
];
|
||||
|
||||
$table_type = "{$type}_columns";
|
||||
|
||||
$column_type = $type;
|
||||
|
||||
if ($type == 'product' && $this->service->config->entity instanceof Quote && !$this->service->config->settings_object?->sync_invoice_quote_columns) {
|
||||
if ($type == 'product' && $this->service->config->entity instanceof Quote && !$this->service->config->settings?->sync_invoice_quote_columns) {
|
||||
$table_type = "product_quote_columns";
|
||||
$column_type = 'product_quote';
|
||||
}
|
||||
|
||||
$this->processTaxColumns($column_type);
|
||||
|
||||
foreach ($this->service->config->pdf_variables[$table_type] as $column) {
|
||||
if (array_key_exists($column, $aliases)) {
|
||||
$elements[] = ['element' => 'th', 'content' => $aliases[$column] . '_label', 'properties' => ['data-ref' => "{$type}_table-" . substr($aliases[$column], 1) . '-th', 'hidden' => $this->service->config->settings->hide_empty_columns_on_pdf]];
|
||||
@ -831,6 +835,13 @@ class PdfBuilder
|
||||
$type_id = 2;
|
||||
}
|
||||
|
||||
/** 17-05-2023 need to explicity define product_quote here */
|
||||
if ($type == 'product_quote') {
|
||||
$type_id = 1;
|
||||
$column_type = 'product_quote';
|
||||
$type = 'product';
|
||||
}
|
||||
|
||||
// At the moment we pass "task" or "product" as type.
|
||||
// However, "pdf_variables" contains "$task.tax" or "$product.tax" <-- Notice the dollar sign.
|
||||
// This sprintf() will help us convert "task" or "product" into "$task" or "$product" without
|
||||
|
@ -15,8 +15,8 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => env('APP_VERSION','5.7.40'),
|
||||
'app_tag' => env('APP_TAG','5.7.40'),
|
||||
'app_version' => env('APP_VERSION','5.7.41'),
|
||||
'app_tag' => env('APP_TAG','5.7.41'),
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
|
@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="true" stopOnFailure="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false"
|
||||
bootstrap="vendor/autoload.php" colors="true" processIsolation="true" stopOnError="true" stopOnFailure="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
|
||||
cacheDirectory=".phpunit.cache" backupStaticProperties="false">
|
||||
<testsuites>
|
||||
<testsuite name="Unit">
|
||||
<directory suffix="Test.php">./tests/Unit</directory>
|
||||
|
0
storage/app/public/.gitignore
vendored
Normal file → Executable file
0
storage/app/public/.gitignore
vendored
Normal file → Executable file
@ -284,7 +284,7 @@ class ReportCsvGenerationTest extends TestCase
|
||||
|
||||
private function poll($hash)
|
||||
{
|
||||
$response = Http::retry(50, 1000, throw: false)
|
||||
$response = Http::retry(100, 400, throw: false)
|
||||
->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
|
Loading…
Reference in New Issue
Block a user