Logo, Template and Invoice stuff

This commit is contained in:
WBLKLeipe 2021-11-30 15:50:43 +01:00
parent 92f048c4bd
commit 928086953c
4 changed files with 21 additions and 14 deletions

View file

@ -23,6 +23,12 @@ PAYPAL_SECRET=
PAYPAL_CLIENT_ID= PAYPAL_CLIENT_ID=
PAYPAL_EMAIL= PAYPAL_EMAIL=
#INVOICE RELATED - put every value in quotes ""
COMPANY_PHONE=
COMPANY_ADRESS=
COMPANY_VAT_ID=
INVOICE_PREFIX=
#set-up for extra discord verification #set-up for extra discord verification
DISCORD_CLIENT_ID= DISCORD_CLIENT_ID=
DISCORD_CLIENT_SECRET= DISCORD_CLIENT_SECRET=

View file

@ -198,30 +198,31 @@ class PaymentController extends Controller
event(new UserUpdateCreditsEvent($user)); event(new UserUpdateCreditsEvent($user));
//create invoice //create invoice
$lastInvoiceID = \App\Models\invoice::where("invoice_name","like","%".now()->format('mY')."%")->max("id");
$newInvoiceID = $lastInvoiceID + 1;
$seller = new Party([ $seller = new Party([
'name' => 'Hafuga Company', 'name' => env("APP_NAME", "Controlpanel.gg"),
'phone' => '+49 12346709', 'phone' => env("COMPANY_PHONE",""),
'address' => 'Deutschlandstr 4, 66666 Hell', 'address' => env("COMPANY_ADRESS",""),
'custom_fields' => [ 'custom_fields' => [
'UST_ID' => '365#GG', 'VAT ID' => env("COMPANY_VAT_ID",""),
'E-Mail' => 'invoice@hafuga.de', 'E-Mail' => env("MAIL_FROM_ADDRESS", "company@mail.com"),
"Web" => env("APP_URL","https://controlpanel.gg")
], ],
]); ]);
$customer = new Buyer([ $customer = new Buyer([
'name' => 'Not Dennis', 'name' => $user->name,
'custom_fields' => [ 'custom_fields' => [
'email' => 'customer@google.de', 'E-Mail' => $user->email,
'order number' => '> 654321 <', 'Client ID' => $user->id,
], ],
]); ]);
$item = (new InvoiceItem())->title($paypalProduct->description)->pricePerUnit($paypalProduct->price); $item = (new InvoiceItem())->title($paypalProduct->description)->pricePerUnit($paypalProduct->price);
$lastInvoiceID = \App\Models\invoice::where("invoice_name","like","%".now()->format('M')."%")->max("id");
$newInvoiceID = $lastInvoiceID + 1;
$invoice = Invoice::make() $invoice = Invoice::make()
->buyer($customer) ->buyer($customer)
->seller($seller) ->seller($seller)
@ -231,10 +232,10 @@ class PaymentController extends Controller
->addItem($item) ->addItem($item)
->status(__('invoices::invoice.paid')) ->status(__('invoices::invoice.paid'))
->series(now()->format('M_Y')) ->series(now()->format('mY'))
->delimiter("-") ->delimiter("-")
->sequence($newInvoiceID) ->sequence($newInvoiceID)
->serialNumberFormat('{SEQUENCE} - {SERIES}') ->serialNumberFormat(env("INVOICE_PREFIX","").'-{SERIES}{SEQUENCE}')
->logo(public_path('vendor/invoices/logo.png')) ->logo(public_path('vendor/invoices/logo.png'))
->save("local"); ->save("local");

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 21 KiB

View file

@ -140,7 +140,7 @@
<tr> <tr>
<td class="border-0 pl-0" width="70%"> <td class="border-0 pl-0" width="70%">
<h4 class="text-uppercase"> <h4 class="text-uppercase">
<strong>{{ $invoice->name }}</strong> <strong>{{ $invoice->name }}</strong> {{$invoice->getSerialNumber()}}
</h4> </h4>
</td> </td>
<td class="border-0 pl-0"> <td class="border-0 pl-0">