1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Updated URL for trouble shooting

This commit is contained in:
David Bomba 2024-08-08 17:48:24 +10:00
parent a8e313b5e9
commit 286b2087cd
5 changed files with 171 additions and 134 deletions

View File

@ -8,7 +8,7 @@ assignees: ''
---
<!-- Before posting please check our "Troubleshooting" category in the docs:
https://invoiceninja.github.io/docs/self-host-troubleshooting/ -->
https://invoiceninja.github.io/en/self-host-troubleshooting/ -->
## Setup
- Version: <!-- i.e. v4.5.25 / v5.0.30 -->

View File

@ -614,17 +614,17 @@ class Invoice extends BaseModel
event(new InvoiceWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $template));
break;
case 'reminder1':
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $template));
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $reminder_template));
break;
case 'reminder2':
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $template));
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $reminder_template));
break;
case 'reminder3':
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $template));
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $reminder_template));
break;
case 'reminder_endless':
case 'endless_reminder':
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $template));
event(new InvoiceReminderWasEmailed($invitation, $invitation->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null), $reminder_template));
break;
case 'custom1':
case 'custom2':

View File

@ -148,17 +148,20 @@ class Storecove {
"emails" => ["david@invoiceninja.com"]
],
"document"=> [
'documentType' => 'invoice',
"rawDocumentData"=> [
"document" => base64_encode($document),
"parse" => true,
"parseStrategy"=> "ubl",
],
],
];
$payload = array_merge($payload, $override_payload);
$payload['document']['documentType'] = 'invoice';
$payload['document']["rawDocumentData"] = [
"document" => base64_encode($document),
"parse" => true,
"parseStrategy"=> "ubl",
];
$uri = "document_submissions";
nlog($payload);

View File

@ -862,15 +862,17 @@ class Peppol extends AbstractService
$this->p_invoice->OrderReference = $order_reference;
$this->setStorecoveMeta(["document" => [
"invoice" => [
"references" => [
"documentType" => "purchase_order",
"documentId" => $this->invoice->po_number,
],
],
]
]);
// $this->setStorecoveMeta(["document" => [
// "invoice" => [
// [
// "references" => [
// "documentType" => "purchase_order",
// "documentId" => $this->invoice->po_number,
// ],
// ],
// ],
// ]
// ]);
return $this;
}
@ -952,7 +954,25 @@ class Peppol extends AbstractService
];
}
/**
* setStorecoveMeta
*
* updates the storecove payload for sending documents
*
* @param array $meta
* @return self
*/
private function setStorecoveMeta(array $meta): self
{
$this->storecove_meta = array_merge($this->storecove_meta, $meta);
return $this;
}
public function getStorecoveMeta(): array
{
return $this->storecove_meta;
}
@ -978,20 +998,6 @@ class Peppol extends AbstractService
return $this;
}
/**
* setStorecoveMeta
*
* updates the storecove payload for sending documents
*
* @param array $meta
* @return self
*/
private function setStorecoveMeta(array $meta): self
{
$this->storecove_meta = array_merge($this->storecove_meta, $meta);
return $this;
}
/**
* CH
*
@ -1110,7 +1116,6 @@ class Peppol extends AbstractService
}
if(strlen($this->invoice->client->id_number ?? '') == 9) {
//SIREN
$this->setStorecoveMeta($this->buildRouting('FR:SIREN', "0002:{$this->invoice->client->id_number}"));

View File

@ -509,113 +509,110 @@ $x = '<?xml version="1.0" encoding="utf-8"?>
{
$this->routing_id = 293338;
$settings = CompanySettings::defaults();
$settings->company_logo = 'https://pdf.invoicing.co/favicon-v2.png';
$settings->website = 'www.invoiceninja.de';
$settings = CompanySettings::defaults();
$settings->company_logo = 'https://pdf.invoicing.co/favicon-v2.png';
$settings->website = 'www.invoiceninja.de';
$settings->address1 = '10 Rue de la Paix';
$settings->address2 = 'Bâtiment A, Bureau 5';
$settings->city = 'Paris';
$settings->state = 'Île-de-France';
$settings->postal_code = '75002';
$settings->phone = '01 23456789';
$settings->email = $this->faker->unique()->safeEmail();
$settings->country_id = '250'; // France's ISO country code
$settings->vat_number = 'FR82345678911';
$settings->id_number = '12345678900010';
$settings->classification = 'business';
$settings->use_credits_payment = 'always';
$settings->timezone_id = '1'; // CET (Central European Time)
$settings->entity_send_time = 0;
$settings->e_invoice_type = 'PEPPOL';
$settings->currency_id = '3';
$settings->address1 = '10 Rue de la Paix';
$settings->address2 = 'Bâtiment A, Bureau 5';
$settings->city = 'Paris';
$settings->state = 'Île-de-France';
$settings->postal_code = '75002';
$settings->phone = '01 23456789';
$settings->email = $this->faker->unique()->safeEmail();
$settings->country_id = '250'; // France's ISO country code
$settings->vat_number = 'FR12345678901';
$settings->id_number = '12345678900010';
$company = Company::factory()->create([
'account_id' => $this->account->id,
'settings' => $settings,
]);
$settings->use_credits_payment = 'always';
$settings->timezone_id = '1'; // CET (Central European Time)
$settings->entity_send_time = 0;
$settings->e_invoice_type = 'PEPPOL';
$settings->currency_id = '3';
$this->user->companies()->attach($company->id, [
'account_id' => $this->account->id,
'is_owner' => true,
'is_admin' => 1,
'is_locked' => 0,
'permissions' => '',
'notifications' => CompanySettings::notificationAdminDefaults(),
'settings' => null,
]);
$company = Company::factory()->create([
'account_id' => $this->account->id,
'settings' => $settings,
]);
Client::unguard();
$this->user->companies()->attach($company->id, [
'account_id' => $this->account->id,
'is_owner' => true,
'is_admin' => 1,
'is_locked' => 0,
'permissions' => '',
'notifications' => CompanySettings::notificationAdminDefaults(),
'settings' => null,
]);
Client::unguard();
$c =
Client::create([
'company_id' => $company->id,
'user_id' => $this->user->id,
'name' => 'Beispiel Firma GmbH',
'website' => 'https://www.beispiel-firma.de',
'private_notes' => 'Dies sind private Notizen zum Testkunden.',
'balance' => 0,
'paid_to_date' => 0,
'vat_number' => 'DE654321987',
'id_number' => 'HRB 12345', // Typical format for German company registration numbers
'custom_value1' => '2024-07-22 10:00:00',
'custom_value2' => 'blau',
'custom_value3' => 'musterwort',
'custom_value4' => 'test@example.com',
'address1' => 'Musterstraße 123',
'address2' => '2. Etage, Büro 45',
'city' => 'München',
'state' => 'Bayern',
'postal_code' => '80331',
'country_id' => '276', // Germany
'shipping_address1' => 'Musterstraße 123',
'shipping_address2' => '2. Etage, Büro 45',
'shipping_city' => 'München',
'shipping_state' => 'Bayern',
'shipping_postal_code' => '80331',
'shipping_country_id' => '276', // Germany
'settings' => ClientSettings::Defaults(),
'client_hash' => \Illuminate\Support\Str::random(32),
'routing_id' => '',
]);
$c =
Client::create([
'company_id' => $company->id,
'user_id' => $this->user->id,
'name' => 'Exemple Société S.A.',
'website' => 'https://www.exemple-societe.fr',
'private_notes' => 'Ceci est une note privée pour le client test.',
'balance' => 0,
'paid_to_date' => 0,
'vat_number' => 'FR12345678901',
'id_number' => '12345678900010', // Typical format for French company registration numbers
'custom_value1' => '2024-07-22 10:00:00',
'custom_value2' => 'bleu',
'custom_value3' => 'motexemple',
'custom_value4' => 'test@example.com',
'address1' => '123 Rue de l\'Exemple',
'address2' => '2ème étage, Bureau 45',
'city' => 'Paris',
'state' => 'Île-de-France',
'postal_code' => '75001',
'country_id' => '250', // France
'shipping_address1' => '123 Rue de l\'Exemple',
'shipping_address2' => '2ème étage, Bureau 45',
'shipping_city' => 'Paris',
'shipping_state' => 'Île-de-France',
'shipping_postal_code' => '75001',
'shipping_country_id' => '250', // France
'classification' => 'business',
'settings' => ClientSettings::Defaults(),
'client_hash' => \Illuminate\Support\Str::random(32),
'routing_id' => '',
]);
$item = new InvoiceItem();
$item->product_key = "Product Key";
$item->notes = "Product Description";
$item->cost = 10;
$item->quantity = 10;
$item->tax_rate1 = 19;
$item->tax_name1 = 'mwst';
$item = new InvoiceItem();
$item->product_key = "Product Key";
$item->notes = "Product Description";
$item->cost = 10;
$item->quantity = 10;
$item->tax_rate1 = 20;
$item->tax_name1 = 'VAT';
$invoice = Invoice::factory()->create([
'company_id' => $company->id,
'user_id' => $this->user->id,
'client_id' => $c->id,
'discount' => 0,
'uses_inclusive_taxes' => false,
'status_id' => 1,
'tax_rate1' => 0,
'tax_name1' => '',
'tax_rate2' => 0,
'tax_rate3' => 0,
'tax_name2' => '',
'tax_name3' => '',
'line_items' => [$item],
'number' => 'DE-'.rand(1000, 100000),
'date' => now()->format('Y-m-d'),
'due_date' => now()->addDays(14)->format('Y-m-d'),
]);
$invoice = $invoice->calc()->getInvoice();
$invoice->service()->markSent()->save();
return $invoice;
$invoice = Invoice::factory()->create([
'company_id' => $company->id,
'user_id' => $this->user->id,
'client_id' => $c->id,
'discount' => 0,
'uses_inclusive_taxes' => false,
'status_id' => 1,
'tax_rate1' => 0,
'tax_name1' => '',
'tax_rate2' => 0,
'tax_rate3' => 0,
'tax_name2' => '',
'tax_name3' => '',
'line_items' => [$item],
'number' => 'DE-'.rand(1000, 100000),
'date' => now()->format('Y-m-d'),
'due_date' => now()->addDays(14)->format('Y-m-d'),
]);
$invoice = $invoice->calc()->getInvoice();
$invoice->service()->markSent()->save();
return $invoice;
}
@ -728,7 +725,39 @@ return $invoice;
}
public function testEsRules()
public function testFrRules()
{
$invoice = $this->createFRData();
$e_invoice = new \InvoiceNinja\EInvoice\Models\Peppol\Invoice();
$stub = json_decode('{"Invoice":{"Note":"Nooo","PaymentMeans":[{"ID":{"value":"afdasfasdfasdfas"},"PayeeFinancialAccount":{"Name":"PFA-NAME","ID":{"value":"DE89370400440532013000"},"AliasName":"PFA-Alias","AccountTypeCode":{"value":"CHECKING"},"AccountFormatCode":{"value":"IBAN"},"CurrencyCode":{"value":"EUR"},"FinancialInstitutionBranch":{"ID":{"value":"DEUTDEMMXXX"},"Name":"Deutsche Bank"}}}]}}');
foreach($stub as $key => $value) {
$e_invoice->{$key} = $value;
}
$invoice->e_invoice = $e_invoice;
$invoice->save();
$this->assertInstanceOf(Invoice::class, $invoice);
$this->assertInstanceof(\InvoiceNinja\EInvoice\Models\Peppol\Invoice::class, $e_invoice);
$p = new Peppol($invoice);
$p->run();
$xml = $p->toXml();
nlog($xml);
$identifiers = $p->getStorecoveMeta();
$sc = new \App\Services\EDocument\Gateway\Storecove\Storecove();
$sc->sendDocument($xml, $this->routing_id, $identifiers);
}
public function RtestEsRules()
{
$invoice = $this->createESData();
@ -768,7 +797,7 @@ return $invoice;
}
public function testDeRules()
public function RtestDeRules()
{
$invoice = $this->createDEData();