Add support for "Leitweg-ID" and po-number

This commit is contained in:
Lars Kusch 2023-03-13 08:01:17 +01:00
parent 454182f49c
commit 060cc2d6a0
4 changed files with 40 additions and 2 deletions

View File

@ -49,8 +49,11 @@ class CreateXRechnung implements ShouldQueue
->setDocumentSeller($company->name)
->setDocumentSellerAddress($company->address1, "", "", $company->postal_code, $company->city, $company->country->country->iso_3166_2)
->setDocumentBuyer($client->name, $client->number)
->setDocumentBuyerAddress($client->address1, "", "", $client->postal_code, $client->city, $client->country->country->iso_3166_2);
//->addDocumentPaymentTerm("Zahlbar innerhalb 30 Tagen netto bis 04.04.2018, 3% Skonto innerhalb 10 Tagen bis 15.03.2018")
->setDocumentBuyerAddress($client->address1, "", "", $client->postal_code, $client->city, $client->country->country->iso_3166_2)
->setDocumentBuyerReference($client->leitweg_id)
->setDocumentBuyerContact($client->primary_contact->first_name." ".$client->primary_contact->last_name, "", $client->primary_contact->phone, "", $client->primary_contact->email)
->setDocumentBuyerOrderReferencedDocument($invoice->po_number)
->addDocumentPaymentTerm(ctrans("texts.xinvoice_payable", ['payeddue' => date_create($invoice->date)->diff(date_create($invoice->due_date))->format("%d"), 'paydate' => $invoice->due_date]));
if (str_contains($company->vat_number, "/")){
$xrechnung->addDocumentSellerTaxRegistration("FC", $company->vat_number);

View File

@ -41,6 +41,7 @@ use Laracasts\Presenter\PresentableTrait;
* @property string|null $client_hash
* @property string|null $logo
* @property string|null $phone
* @property string|null leitweg_id
* @property string $balance
* @property string $paid_to_date
* @property string $credit_balance
@ -220,6 +221,7 @@ class Client extends BaseModel implements HasLocalePreference
'public_notes',
'phone',
'number',
'leitweg_id',
];
protected $with = [
@ -268,6 +270,7 @@ class Client extends BaseModel implements HasLocalePreference
'id_number',
'public_notes',
'phone',
'leitweg_id',
];
// public function scopeExclude($query)

View File

@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clients', function (Blueprint $table) {
$table->string('leitweg_idf')->default(null);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
};

View File

@ -5020,6 +5020,7 @@ $LANG = array(
'white_label_body' => 'Thank you for purchasing a white label license. <br><br> Your license key is: <br><br> :license_key',
'payment_type_Klarna' => 'Klarna',
'payment_type_Interac E Transfer' => 'Interac E Transfer',
'xinvoice_payable' => 'Payable within :payeddue days net until :paydate',
);