akaunting 3.0 (the last dance)
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Attachment extends Component
|
||||
{
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Document extends Component
|
||||
class Buttons extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
@ -13,6 +13,6 @@ class Document extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.document');
|
||||
return view('components.documents.show.buttons');
|
||||
}
|
||||
}
|
24
app/View/Components/Documents/Show/Children.php
Normal file
24
app/View/Components/Documents/Show/Children.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
use App\Models\Common\Recurring;
|
||||
|
||||
|
||||
class Children extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$recurring = Recurring::where('recurable_type', 'App\\Models\\Document\\Document')
|
||||
->where('recurable_id', $this->document->id)
|
||||
->first();
|
||||
|
||||
return view('components.documents.show.children', compact('recurring'));
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Content extends Component
|
||||
{
|
||||
|
25
app/View/Components/Documents/Show/Create.php
Normal file
25
app/View/Components/Documents/Show/Create.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Create extends Component
|
||||
{
|
||||
public $description;
|
||||
|
||||
public $created_date;
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$this->description = ($this->document->isRecurringDocument()) ? 'invoices.slider.create_recurring' : 'invoices.slider.create';
|
||||
$this->created_date = '<span class="font-medium">' . company_date($this->document->created_at) . '</span>';
|
||||
|
||||
return view('components.documents.show.create');
|
||||
}
|
||||
}
|
22
app/View/Components/Documents/Show/GetPaid.php
Normal file
22
app/View/Components/Documents/Show/GetPaid.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class GetPaid extends Component
|
||||
{
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount, $this->document->currency_code, true) . '</span>';
|
||||
|
||||
return view('components.documents.show.get-paid');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
|
||||
class Histories extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.histories');
|
||||
}
|
||||
}
|
22
app/View/Components/Documents/Show/MakePayment.php
Normal file
22
app/View/Components/Documents/Show/MakePayment.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class MakePayment extends Component
|
||||
{
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$this->description = trans('general.amount_due') . ': ' . '<span class="font-medium">' . money($this->document->amount, $this->document->currency_code, true) . '</span>';
|
||||
|
||||
return view('components.documents.show.make-payment');
|
||||
}
|
||||
}
|
44
app/View/Components/Documents/Show/Message.php
Normal file
44
app/View/Components/Documents/Show/Message.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Component;
|
||||
|
||||
class Message extends Component
|
||||
{
|
||||
/** @var string */
|
||||
public $type;
|
||||
|
||||
/** @var string */
|
||||
public $backgroundColor;
|
||||
|
||||
/** @var string */
|
||||
public $textColor;
|
||||
|
||||
/** @var string */
|
||||
public $message;
|
||||
|
||||
/**
|
||||
* Create a new component instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(
|
||||
string $type = '', string $backgroundColor = '', string $textColor = '', string $message = ''
|
||||
) {
|
||||
$this->type = $type;
|
||||
$this->backgroundColor = $backgroundColor;
|
||||
$this->textColor = $textColor;
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.message');
|
||||
}
|
||||
}
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Header extends Component
|
||||
class MoreButtons extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
@ -13,6 +13,6 @@ class Header extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.header');
|
||||
return view('components.documents.show.more-buttons');
|
||||
}
|
||||
}
|
31
app/View/Components/Documents/Show/Receive.php
Normal file
31
app/View/Components/Documents/Show/Receive.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Models\Document\DocumentHistory;
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Receive extends Component
|
||||
{
|
||||
public $description;
|
||||
|
||||
public $sent_date;
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$this->description = ($this->document->isRecurringDocument()) ? 'invoices.slider.create_recurring' : 'general.last_sent';
|
||||
|
||||
$last_sent = DocumentHistory::where('document_id', $this->document->id)->whereIn('status', ['sent', 'received'])->latest()->first();
|
||||
|
||||
$date = ($last_sent) ? company_date($last_sent->created_at) : trans('general.na');
|
||||
|
||||
$this->sent_date = '<span class="font-medium">' . $date . '</span>';
|
||||
|
||||
return view('components.documents.show.receive');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
|
||||
class RecurringMessage extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.recurring-message');
|
||||
}
|
||||
}
|
25
app/View/Components/Documents/Show/Restore.php
Normal file
25
app/View/Components/Documents/Show/Restore.php
Normal file
@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Restore extends Component
|
||||
{
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$last_history = $this->document->histories()->orderBy('id', 'desc')->first();
|
||||
|
||||
$this->description = trans('invoices.cancel_date') . ': ';
|
||||
$this->description .= '<span class="font-medium">' . company_date($last_history->created_at) . '</span>';
|
||||
|
||||
return view('components.documents.show.restore');
|
||||
}
|
||||
}
|
32
app/View/Components/Documents/Show/Schedule.php
Normal file
32
app/View/Components/Documents/Show/Schedule.php
Normal file
@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
use App\Models\Common\Recurring;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class Schedule extends Component
|
||||
{
|
||||
public $description;
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$recurring = Recurring::where('recurable_type', 'App\\Models\\Document\\Document')
|
||||
->where('recurable_id', $this->document->id)
|
||||
->first();
|
||||
|
||||
$started_date = '<span class="font-medium">' . company_date($recurring->started_at) . '</span>';
|
||||
$frequency = Str::lower(trans('recurring.' . str_replace('ly', 's', $recurring->frequency)));
|
||||
$invertal = $recurring->interval;
|
||||
|
||||
$this->description = trans('transactions.slider.schedule', ['frequency' => $frequency, 'interval' => $invertal, 'date' => $started_date]);
|
||||
|
||||
return view('components.documents.show.schedule', compact('recurring'));
|
||||
}
|
||||
}
|
31
app/View/Components/Documents/Show/Send.php
Normal file
31
app/View/Components/Documents/Show/Send.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Models\Document\DocumentHistory;
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Send extends Component
|
||||
{
|
||||
public $description;
|
||||
|
||||
public $sent_date;
|
||||
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
$this->description = ($this->document->isRecurringDocument()) ? 'invoices.slider.create_recurring' : 'general.last_sent';
|
||||
|
||||
$last_sent = DocumentHistory::where('document_id', $this->document->id)->whereIn('status', ['sent', 'received'])->latest()->first();
|
||||
|
||||
$date = ($last_sent) ? company_date($last_sent->created_at) : trans('general.na');
|
||||
|
||||
$this->sent_date = '<span class="font-medium">' . $date . '</span>';
|
||||
|
||||
return view('components.documents.show.send');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
|
||||
class StatusMessage extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.status-message');
|
||||
}
|
||||
}
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
use App\Abstracts\View\Components\Documents\Show as Component;
|
||||
|
||||
class Footer extends Component
|
||||
class Template extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
@ -13,6 +13,6 @@ class Footer extends Component
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.footer');
|
||||
return view('components.documents.show.template');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
|
||||
class Timeline extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.timeline');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
|
||||
class TopButtons extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.top-buttons');
|
||||
}
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Components\Documents\Show;
|
||||
|
||||
use App\Abstracts\View\Components\DocumentShow as Component;
|
||||
|
||||
class Transactions extends Component
|
||||
{
|
||||
/**
|
||||
* Get the view / contents that represent the component.
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|string
|
||||
*/
|
||||
public function render()
|
||||
{
|
||||
return view('components.documents.show.transactions');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user