mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 17:54:38 -04:00
Updates for seeders
This commit is contained in:
parent
b70f01fff2
commit
145fef637b
@ -92,6 +92,7 @@ class BTCPayPaymentDriver extends BaseDriver
|
|||||||
{
|
{
|
||||||
$webhook_payload = file_get_contents('php://input');
|
$webhook_payload = file_get_contents('php://input');
|
||||||
|
|
||||||
|
/** @var \stdClass $btcpayRep */
|
||||||
$btcpayRep = json_decode($webhook_payload);
|
$btcpayRep = json_decode($webhook_payload);
|
||||||
if ($btcpayRep == null) {
|
if ($btcpayRep == null) {
|
||||||
throw new PaymentFailed('Empty data');
|
throw new PaymentFailed('Empty data');
|
||||||
@ -109,6 +110,7 @@ class BTCPayPaymentDriver extends BaseDriver
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$sig = '';
|
||||||
$headers = getallheaders();
|
$headers = getallheaders();
|
||||||
foreach ($headers as $key => $value) {
|
foreach ($headers as $key => $value) {
|
||||||
if (strtolower($key) === 'btcpay-sig') {
|
if (strtolower($key) === 'btcpay-sig') {
|
||||||
@ -141,6 +143,7 @@ class BTCPayPaymentDriver extends BaseDriver
|
|||||||
];
|
];
|
||||||
$payment = $this->createPayment($dataPayment, $StatusId);
|
$payment = $this->createPayment($dataPayment, $StatusId);
|
||||||
} else {
|
} else {
|
||||||
|
/** @var \App\Models\Payment $payment */
|
||||||
$payment = Payment::find($this->payment_hash->payment_id);
|
$payment = Payment::find($this->payment_hash->payment_id);
|
||||||
$StatusId = $payment->status_id;
|
$StatusId = $payment->status_id;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,8 @@ class PayPalPPCPPaymentDriver extends PayPalBasePaymentDriver
|
|||||||
{
|
{
|
||||||
|
|
||||||
nlog("response");
|
nlog("response");
|
||||||
|
$r = false;
|
||||||
|
|
||||||
$request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']);
|
$request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']);
|
||||||
$response = json_decode($request['gateway_response'], true);
|
$response = json_decode($request['gateway_response'], true);
|
||||||
|
|
||||||
|
@ -62,7 +62,8 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver
|
|||||||
{
|
{
|
||||||
nlog("response");
|
nlog("response");
|
||||||
$this->init();
|
$this->init();
|
||||||
|
$r = false;
|
||||||
|
|
||||||
$request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']);
|
$request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']);
|
||||||
$response = json_decode($request['gateway_response'], true);
|
$response = json_decode($request['gateway_response'], true);
|
||||||
|
|
||||||
|
@ -196,7 +196,9 @@ class RoEInvoice extends AbstractService
|
|||||||
$ubl_invoice->setDocumentCurrencyCode($invoice->client->getCurrencyCode());
|
$ubl_invoice->setDocumentCurrencyCode($invoice->client->getCurrencyCode());
|
||||||
$ubl_invoice->setTaxCurrencyCode($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)) {
|
if (!empty($item->tax_name1)) {
|
||||||
$taxName = $item->tax_name1;
|
$taxName = $item->tax_name1;
|
||||||
@ -205,9 +207,7 @@ class RoEInvoice extends AbstractService
|
|||||||
} elseif (!empty($item->tax_name3)) {
|
} elseif (!empty($item->tax_name3)) {
|
||||||
$taxName = $item->tax_name3;
|
$taxName = $item->tax_name3;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$taxName = '';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$supplier_party = $this->createParty($company, $companyVatNr, $coEmail, $coPhone, $companyIdn, $coFullName, 'company', $taxName);
|
$supplier_party = $this->createParty($company, $companyVatNr, $coEmail, $coPhone, $companyIdn, $coFullName, 'company', $taxName);
|
||||||
|
@ -564,6 +564,7 @@ class TemplateService
|
|||||||
'credit_balance' => $invoice->client->credit_balance,
|
'credit_balance' => $invoice->client->credit_balance,
|
||||||
'vat_number' => $invoice->client->vat_number ?? '',
|
'vat_number' => $invoice->client->vat_number ?? '',
|
||||||
'currency' => $invoice->client->currency()->code ?? 'USD',
|
'currency' => $invoice->client->currency()->code ?? 'USD',
|
||||||
|
'locale' => substr($invoice->client->locale(),0,2),
|
||||||
],
|
],
|
||||||
'payments' => $payments,
|
'payments' => $payments,
|
||||||
'total_tax_map' => $invoice->calc()->getTotalTaxMap(),
|
'total_tax_map' => $invoice->calc()->getTotalTaxMap(),
|
||||||
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
if($c=\App\Models\Currency::find(63))
|
||||||
|
{
|
||||||
|
$c->precision = 0;
|
||||||
|
$c->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
@ -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' => 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' => 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' => 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' => 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' => 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' => '.'],
|
['id' => 66, 'name' => 'Myanmar Kyat', 'code' => 'MMK', 'symbol' => 'K', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user