diff --git a/app/PaymentDrivers/BTCPayPaymentDriver.php b/app/PaymentDrivers/BTCPayPaymentDriver.php index 755116526703..7d5926ec408c 100644 --- a/app/PaymentDrivers/BTCPayPaymentDriver.php +++ b/app/PaymentDrivers/BTCPayPaymentDriver.php @@ -92,6 +92,7 @@ class BTCPayPaymentDriver extends BaseDriver { $webhook_payload = file_get_contents('php://input'); + /** @var \stdClass $btcpayRep */ $btcpayRep = json_decode($webhook_payload); if ($btcpayRep == null) { throw new PaymentFailed('Empty data'); @@ -109,6 +110,7 @@ class BTCPayPaymentDriver extends BaseDriver return; } + $sig = ''; $headers = getallheaders(); foreach ($headers as $key => $value) { if (strtolower($key) === 'btcpay-sig') { @@ -141,6 +143,7 @@ class BTCPayPaymentDriver extends BaseDriver ]; $payment = $this->createPayment($dataPayment, $StatusId); } else { + /** @var \App\Models\Payment $payment */ $payment = Payment::find($this->payment_hash->payment_id); $StatusId = $payment->status_id; } diff --git a/app/PaymentDrivers/PayPalPPCPPaymentDriver.php b/app/PaymentDrivers/PayPalPPCPPaymentDriver.php index ab9cc5932027..f98d5de3b043 100644 --- a/app/PaymentDrivers/PayPalPPCPPaymentDriver.php +++ b/app/PaymentDrivers/PayPalPPCPPaymentDriver.php @@ -115,7 +115,8 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver { nlog("response"); - + $r = false; + $request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']); $response = json_decode($request['gateway_response'], true); diff --git a/app/PaymentDrivers/PayPalRestPaymentDriver.php b/app/PaymentDrivers/PayPalRestPaymentDriver.php index f9e6725aae3d..07800f2cc665 100644 --- a/app/PaymentDrivers/PayPalRestPaymentDriver.php +++ b/app/PaymentDrivers/PayPalRestPaymentDriver.php @@ -62,7 +62,8 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver { nlog("response"); $this->init(); - + $r = false; + $request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']); $response = json_decode($request['gateway_response'], true); diff --git a/app/Services/EDocument/Standards/RoEInvoice.php b/app/Services/EDocument/Standards/RoEInvoice.php index 553ecca6f552..608173c55282 100644 --- a/app/Services/EDocument/Standards/RoEInvoice.php +++ b/app/Services/EDocument/Standards/RoEInvoice.php @@ -196,7 +196,9 @@ class RoEInvoice extends AbstractService $ubl_invoice->setDocumentCurrencyCode($invoice->client->getCurrencyCode()); $ubl_invoice->setTaxCurrencyCode($invoice->client->getCurrencyCode()); - foreach ($invoice->line_items as $index => $item) { + $taxName = ''; + + foreach ($invoice->line_items as $index => $item) { if (!empty($item->tax_name1)) { $taxName = $item->tax_name1; @@ -205,9 +207,7 @@ class RoEInvoice extends AbstractService } elseif (!empty($item->tax_name3)) { $taxName = $item->tax_name3; } - else { - $taxName = ''; - } + } $supplier_party = $this->createParty($company, $companyVatNr, $coEmail, $coPhone, $companyIdn, $coFullName, 'company', $taxName); diff --git a/app/Services/Template/TemplateService.php b/app/Services/Template/TemplateService.php index ac7ecf4e4611..7819b0bdd8f9 100644 --- a/app/Services/Template/TemplateService.php +++ b/app/Services/Template/TemplateService.php @@ -564,6 +564,7 @@ class TemplateService 'credit_balance' => $invoice->client->credit_balance, 'vat_number' => $invoice->client->vat_number ?? '', 'currency' => $invoice->client->currency()->code ?? 'USD', + 'locale' => substr($invoice->client->locale(),0,2), ], 'payments' => $payments, 'total_tax_map' => $invoice->calc()->getTotalTaxMap(), diff --git a/database/migrations/2024_06_08_043343_2024_06_08__i_s_k_currency_precision.php b/database/migrations/2024_06_08_043343_2024_06_08__i_s_k_currency_precision.php new file mode 100644 index 000000000000..8f4cda36bdbf --- /dev/null +++ b/database/migrations/2024_06_08_043343_2024_06_08__i_s_k_currency_precision.php @@ -0,0 +1,28 @@ +precision = 0; + $c->save(); + } + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + // + } +}; diff --git a/database/seeders/CurrenciesSeeder.php b/database/seeders/CurrenciesSeeder.php index 90c900835bdc..2ea762c575e7 100644 --- a/database/seeders/CurrenciesSeeder.php +++ b/database/seeders/CurrenciesSeeder.php @@ -85,7 +85,7 @@ class CurrenciesSeeder extends Seeder ['id' => 60, 'name' => 'Taiwan New Dollar', 'code' => 'TWD', 'symbol' => 'NT$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 61, 'name' => 'Dominican Peso', 'code' => 'DOP', 'symbol' => 'RD$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 62, 'name' => 'Chilean Peso', 'code' => 'CLP', 'symbol' => '$', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ','], - ['id' => 63, 'name' => 'Icelandic Króna', 'code' => 'ISK', 'symbol' => 'kr', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], + ['id' => 63, 'name' => 'Icelandic Króna', 'code' => 'ISK', 'symbol' => 'kr', 'precision' => '0', 'thousand_separator' => '.', 'decimal_separator' => ',', 'swap_currency_symbol' => true], ['id' => 64, 'name' => 'Papua New Guinean Kina', 'code' => 'PGK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 65, 'name' => 'Jordanian Dinar', 'code' => 'JOD', 'symbol' => '', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'], ['id' => 66, 'name' => 'Myanmar Kyat', 'code' => 'MMK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],