Merge pull request #2146 from cuneytsenturk/master

Added Revenue/Payment show page [#mdbaet]
This commit is contained in:
Cüneyt Şentürk 2021-06-27 13:06:52 +03:00 committed by GitHub
commit 1e18b19c56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
53 changed files with 3732 additions and 152 deletions

View File

@ -0,0 +1,175 @@
<?php
namespace App\Abstracts\View\Components;
use Illuminate\View\Component;
use Illuminate\Support\Str;
abstract class Transaction extends Component
{
public function getTextFromConfig($type, $config_key, $default_key = '', $trans_type = 'trans')
{
$translation = '';
// if set config translation config_key
if ($translation = config('type.' . $type . '.translation.' . $config_key)) {
return $translation;
}
$alias = config('type.' . $type . '.alias');
$prefix = config('type.' . $type . '.translation.prefix');
if (!empty($alias)) {
$alias .= '::';
}
// This magic trans key..
$translations = [
'general' => $alias . 'general.' . $default_key,
'prefix' => $alias . $prefix . '.' . $default_key,
'config_general' => $alias . 'general.' . $config_key,
'config_prefix' => $alias . $prefix . '.' . $config_key,
];
switch ($trans_type) {
case 'trans':
foreach ($translations as $trans) {
if (trans($trans) !== $trans) {
return $trans;
}
}
break;
case 'trans_choice':
foreach ($translations as $trans_choice) {
if (trans_choice($trans_choice, 1) !== $trans_choice) {
return $trans_choice;
}
}
break;
}
return $translation;
}
public function getRouteFromConfig($type, $config_key, $config_parameters = [])
{
$route = '';
// if set config trasnlation config_key
if ($route = config('type.' . $type . '.route.' . $config_key)) {
return $route;
}
$alias = config('type.' . $type . '.alias');
$prefix = config('type.' . $type . '.route.prefix');
// if use module set module alias
if (!empty($alias)) {
$route .= $alias . '.';
}
if (!empty($prefix)) {
$route .= $prefix . '.';
}
$route .= $config_key;
try {
route($route, $config_parameters);
} catch (\Exception $e) {
try {
$route = Str::plural($type, 2) . '.' . $config_key;
route($route, $config_parameters);
} catch (\Exception $e) {
$route = '';
}
}
return $route;
}
public function getPermissionFromConfig($type, $config_key)
{
$permission = '';
// if set config trasnlation config_key
if ($permission = config('type.' . $type . '.permission.' . $config_key)) {
return $permission;
}
$alias = config('type.' . $type . '.alias');
$group = config('type.' . $type . '.group');
$prefix = config('type.' . $type . '.permission.prefix');
$permission = $config_key . '-';
// if use module set module alias
if (!empty($alias)) {
$permission .= $alias . '-';
}
// if controller in folder it must
if (!empty($group)) {
$permission .= $group . '-';
}
$permission .= $prefix;
return $permission;
}
public function getHideFromConfig($type, $config_key)
{
$hide = false;
$hides = config('type.' . $type . '.hide');
if (!empty($hides) && (in_array($config_key, $hides))) {
$hide = true;
}
return $hide;
}
public function getClassFromConfig($type, $config_key)
{
$class_key = 'type.' . $type . '.class.' . $config_key;
return config($class_key, '');
}
public function getCategoryFromConfig($type)
{
$category_type = '';
// if set config trasnlation config_key
if ($category_type = config('type.' . $type . '.category_type')) {
return $category_type;
}
switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$category_type = 'expense';
break;
case 'item':
$category_type = 'item';
break;
case 'other':
$category_type = 'other';
break;
case 'transfer':
$category_type = 'transfer';
break;
default:
$category_type = 'income';
break;
}
return $category_type;
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,606 @@
<?php
namespace App\Abstracts\View\Components;
use App\Abstracts\View\Components\Transaction as Base;
use App\Models\Common\Media;
use App\Traits\DateTime;
use App\Traits\Transactions;
use App\Utilities\Modules;
use File;
use Illuminate\Support\Facades\Log;
use Image;
use Intervention\Image\Exception\NotReadableException;
use Storage;
use Illuminate\Support\Str;
abstract class TransactionTemplate extends Base
{
use DateTime;
use Transactions;
/** @var string */
public $type;
public $transaction;
public $logo;
/** @var array */
public $payment_methods;
/** @var bool */
public $hideCompany;
/** @var bool */
public $hideCompanyLogo;
/** @var bool */
public $hideCompanyDetails;
/** @var bool */
public $hideCompanyName;
/** @var bool */
public $hideCompanyAddress;
/** @var bool */
public $hideCompanyTaxNumber;
/** @var bool */
public $hideCompanyPhone;
/** @var bool */
public $hideCompanyEmail;
/** @var bool */
public $hideContentTitle;
/** @var bool */
public $hidePaidAt;
/** @var bool */
public $hideAccount;
/** @var bool */
public $hideCategory;
/** @var bool */
public $hidePaymentMethods;
/** @var bool */
public $hideReference;
/** @var bool */
public $hideDescription;
/** @var bool */
public $hideAmount;
/** @var string */
public $textContentTitle;
/** @var string */
public $textPaidAt;
/** @var string */
public $textAccount;
/** @var string */
public $textCategory;
/** @var string */
public $textPaymentMethods;
/** @var string */
public $textReference;
/** @var string */
public $textDescription;
/** @var string */
public $textAmount;
/** @var string */
public $textPaidBy;
/** @var bool */
public $hideContact;
/** @var bool */
public $hideContactInfo;
/** @var bool */
public $hideContactName;
/** @var bool */
public $hideContactAddress;
/** @var bool */
public $hideContactTaxNumber;
/** @var bool */
public $hideContactPhone;
/** @var bool */
public $hideContactEmail;
/** @var bool */
public $hideReletad;
/** @var bool */
public $hideReletadDocumentNumber;
/** @var bool */
public $hideReletadContact;
/** @var bool */
public $hideReletadDocumentDate;
/** @var bool */
public $hideReletadDocumentAmount;
/** @var bool */
public $hideReletadAmount;
/** @var string */
public $textReleatedTransansaction;
/** @var string */
public $textReleatedDocumentNumber;
/** @var string */
public $textReleatedContact;
/** @var string */
public $textReleatedDocumentDate;
/** @var string */
public $textReleatedDocumentAmount;
/** @var string */
public $textReleatedAmount;
/** @var string */
public $routeDocumentShow;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(
$type, $transaction, $logo = '', array $payment_methods = [],
bool $hideCompany = false, bool $hideCompanyLogo = false, bool $hideCompanyDetails = false, bool $hideCompanyName = false, bool $hideCompanyAddress = false,
bool $hideCompanyTaxNumber = false, bool $hideCompanyPhone = false, bool $hideCompanyEmail = false,
bool $hideContentTitle = false,bool $hidePaidAt = false, bool $hideAccount = false, bool $hideCategory = false, bool $hidePaymentMethods = false, bool $hideReference = false, bool $hideDescription = false,
bool $hideAmount = false,
string $textContentTitle = '', string $textPaidAt = '', string $textAccount = '', string $textCategory = '', string $textPaymentMethods = '', string $textReference = '', string $textDescription = '',
string $textAmount = '', string $textPaidBy = '',
bool $hideContact = false, bool $hideContactInfo = false, bool $hideContactName = false, bool $hideContactAddress = false, bool $hideContactTaxNumber = false,
bool $hideContactPhone = false, bool $hideContactEmail = false,
bool $hideReletad = false, bool $hideReletadDocumentNumber = false, bool $hideReletadContact = false, bool $hideReletadDocumentDate = false, bool $hideReletadDocumentAmount = false, bool $hideReletadAmount = false,
string $textReleatedTransansaction = '', string $textReleatedDocumentNumber = '', string $textReleatedContact = '', string $textReleatedDocumentDate = '', string $textReleatedDocumentAmount = '', string $textReleatedAmount = '',
string $routeDocumentShow = ''
) {
$this->type = $type;
$this->transaction = $transaction;
$this->logo = $this->getLogo($logo);
$this->payment_methods = ($payment_methods) ?: Modules::getPaymentMethods('all');
// Company Information Hide checker
$this->hideCompany = $hideCompany;
$this->hideCompanyLogo = $hideCompanyLogo;
$this->hideCompanyDetails = $hideCompanyDetails;
$this->hideCompanyName = $hideCompanyName;
$this->hideCompanyAddress = $hideCompanyAddress;
$this->hideCompanyTaxNumber = $hideCompanyTaxNumber;
$this->hideCompanyPhone = $hideCompanyPhone;
$this->hideCompanyEmail = $hideCompanyEmail;
// Transaction Information Hide checker
$this->hideContentTitle = $hideContentTitle;
$this->hidePaidAt = $hidePaidAt;
$this->hideAccount = $hideAccount;
$this->hideCategory = $hideCategory;
$this->hidePaymentMethods = $hidePaymentMethods;
$this->hideReference = $hideReference;
$this->hideDescription = $hideDescription;
$this->hideAmount = $hideAmount;
// Transaction Information Text
$this->textContentTitle = $this->getTextContentTitle($type, $textContentTitle);
$this->textPaidAt = $this->getTextPaidAt($type, $textPaidAt);
$this->textAccount = $this->getTextAccount($type, $textAccount);
$this->textCategory = $this->getTextCategory($type, $textCategory);
$this->textPaymentMethods = $this->getTextPaymentMethods($type, $textPaymentMethods);
$this->textReference = $this->getTextReference($type, $textReference);
$this->textDescription = $this->getTextDescription($type, $textDescription);
$this->textAmount = $this->getTextAmount($type, $textAmount);
$this->textPaidBy = $this->getTextPaidBy($type, $textPaidBy);
// Contact Information Hide checker
$this->hideContact = $hideContact;
$this->hideContactInfo = $hideContactInfo;
$this->hideContactName = $hideContactName;
$this->hideContactAddress = $hideContactAddress;
$this->hideContactTaxNumber = $hideContactTaxNumber;
$this->hideContactPhone = $hideContactPhone;
$this->hideContactEmail = $hideContactEmail;
// Releated Information Hide checker
$this->hideReletad = $hideReletad;
$this->hideReletadDocumentNumber = $hideReletadDocumentNumber;
$this->hideReletadContact = $hideReletadContact;
$this->hideReletadDocumentDate = $hideReletadDocumentDate;
$this->hideReletadDocumentAmount = $hideReletadDocumentAmount;
$this->hideReletadAmount = $hideReletadAmount;
// Releated Information Text
$this->textReleatedTransansaction = $this->getTextReleatedTransansaction($type, $textReleatedTransansaction);
$this->textReleatedDocumentNumber = $this->getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber);
$this->textReleatedContact = $this->getTextReleatedContact($type, $textReleatedContact);
$this->textReleatedDocumentDate = $this->getTextReleatedDocumentDate($type, $textReleatedDocumentDate);
$this->textReleatedDocumentAmount = $this->getTextReleatedDocumentAmount($type, $textReleatedDocumentAmount);
$this->textReleatedAmount = $this->getTextReleatedAmount($type, $textReleatedAmount);
$this->routeDocumentShow = $this->routeDocumentShow($type, $routeDocumentShow);
}
protected function getLogo($logo)
{
if (!empty($logo)) {
return $logo;
}
$media = Media::find(setting('company.logo'));
if (!empty($media)) {
$path = $media->getDiskPath();
if (Storage::missing($path)) {
return $logo;
}
} else {
$path = base_path('public/img/company.png');
}
try {
$image = Image::cache(function($image) use ($media, $path) {
$width = setting('invoice.logo_size_width');
$height = setting('invoice.logo_size_height');
if ($media) {
$image->make(Storage::get($path))->resize($width, $height)->encode();
} else {
$image->make($path)->resize($width, $height)->encode();
}
});
} catch (NotReadableException | \Exception $e) {
Log::info('Company ID: ' . company_id() . ' components/transactionshow.php exception.');
Log::info($e->getMessage());
$path = base_path('public/img/company.png');
$image = Image::cache(function($image) use ($path) {
$width = setting('invoice.logo_size_width');
$height = setting('invoice.logo_size_height');
$image->make($path)->resize($width, $height)->encode();
});
}
if (empty($image)) {
return $logo;
}
$extension = File::extension($path);
return 'data:image/' . $extension . ';base64,' . base64_encode($image);
}
protected function getTextContentTitle($type, $textContentTitle)
{
if (!empty($textContentTitle)) {
return $textContentTitle;
}
switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'payment_made';
break;
default:
$default_key = 'revenue_received';
break;
}
$translation = $this->getTextFromConfig($type, $type . '_made', $default_key);
if (!empty($translation)) {
return $translation;
}
return 'revenues.revenue_received';
}
protected function getTextPaidAt($type, $textPaidAt)
{
if (!empty($textPaidAt)) {
return $textPaidAt;
}
$translation = $this->getTextFromConfig($type, 'paid_at', 'date');
if (!empty($translation)) {
return $translation;
}
return 'general.date';
}
protected function getTextAccount($type, $textAccount)
{
if (!empty($textAccount)) {
return $textAccount;
}
$translation = $this->getTextFromConfig($type, 'accounts', 'accounts', 'trans_choice');
if (!empty($translation)) {
return $translation;
}
return 'general.accounts';
}
protected function getTextCategory($type, $textCategory)
{
if (!empty($textCategory)) {
return $textCategory;
}
$translation = $this->getTextFromConfig($type, 'categories', 'categories', 'trans_choice');
if (!empty($translation)) {
return $translation;
}
return 'general.categories';
}
protected function getTextPaymentMethods($type, $textPaymentMethods)
{
if (!empty($textPaymentMethods)) {
return $textPaymentMethods;
}
$translation = $this->getTextFromConfig($type, 'payment_methods', 'payment_methods', 'trans_choice');
if (!empty($translation)) {
return $translation;
}
return 'general.payment_methods';
}
protected function getTextReference($type, $textReference)
{
if (!empty($textReference)) {
return $textReference;
}
$translation = $this->getTextFromConfig($type, 'reference', 'reference');
if (!empty($translation)) {
return $translation;
}
return 'general.reference';
}
protected function getTextDescription($type, $textDescription)
{
if (!empty($textDescription)) {
return $textDescription;
}
$translation = $this->getTextFromConfig($type, 'description', 'description');
if (!empty($translation)) {
return $translation;
}
return 'general.description';
}
protected function getTextAmount($type, $textAmount)
{
if (!empty($textAmount)) {
return $textAmount;
}
$translation = $this->getTextFromConfig($type, 'amount', 'amount');
if (!empty($translation)) {
return $translation;
}
return 'general.amount';
}
protected function getTextPaidBy($type, $textPaidBy)
{
if (!empty($textPaidBy)) {
return $textPaidBy;
}
switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'paid_to';
break;
default:
$default_key = 'paid_by';
break;
}
$translation = $this->getTextFromConfig($type, 'paid_to_by', $default_key);
if (!empty($translation)) {
return $translation;
}
return 'revenus.paid_by';
}
protected function getTextReleatedTransansaction($type, $textReleatedTransansaction)
{
if (!empty($textReleatedTransansaction)) {
return $textReleatedTransansaction;
}
switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'related_bill';
break;
default:
$default_key = 'related_invoice';
break;
}
$translation = $this->getTextFromConfig($type, 'related_type', $default_key);
if (!empty($translation)) {
return $translation;
}
return 'revenues.related_invoice';
}
protected function getTextReleatedDocumentNumber($type, $textReleatedDocumentNumber)
{
if (!empty($textReleatedDocumentNumber)) {
return $textReleatedDocumentNumber;
}
$translation = $this->getTextFromConfig($type, 'related_document_number', 'numbers');
if (!empty($translation)) {
return $translation;
}
return 'general.numbers';
}
protected function getTextReleatedContact($type, $textReleatedContact)
{
if (!empty($textReleatedContact)) {
return $textReleatedContact;
}
$default_key = Str::plural(config('type.' . $type . '.contact_type'), 2);
$translation = $this->getTextFromConfig($type, 'related_contact', $default_key, 'trans_choice');
if (!empty($translation)) {
return $translation;
}
return 'general.customers';
}
protected function getTextReleatedDocumentDate($type, $textReleatedDocumentDate)
{
if (!empty($textReleatedDocumentDate)) {
return $textReleatedDocumentDate;
}
switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'bill_date';
break;
default:
$default_key = 'invoice_date';
break;
}
$translation = $this->getTextFromConfig($type, 'related_document_date', $default_key);
if (!empty($translation)) {
return $translation;
}
return 'invoices.invoice_date';
}
protected function getTextReleatedDocumentAmount($type, $textReleatedDocumentAmount)
{
if (!empty($textReleatedDocumentAmount)) {
return $textReleatedDocumentAmount;
}
switch ($type) {
case 'bill':
case 'expense':
case 'purchase':
$default_key = 'bill_amount';
break;
default:
$default_key = 'invoice_amount';
break;
}
$translation = $this->getTextFromConfig($type, 'related_document_amount', $default_key);
if (!empty($translation)) {
return $translation;
}
return 'general.amount';
}
protected function getTextReleatedAmount($type, $textReleatedAmount)
{
if (!empty($textReleatedAmount)) {
return $textReleatedAmount;
}
$translation = $this->getTextFromConfig($type, 'related_amount', 'amount');
if (!empty($translation)) {
return $translation;
}
return 'general.amount';
}
protected function routeDocumentShow($type, $routeDocumentShow)
{
if (!empty($routeDocumentShow)) {
return $routeDocumentShow;
}
if (!$this->transaction->document) {
return $routeDocumentShow;
}
//example route parameter.
$parameter = 1;
$route = $this->getRouteFromConfig($this->transaction->document->type, 'show', $parameter);
if (!empty($route)) {
return $route;
}
return 'invoices.show';
}
}

View File

@ -0,0 +1,22 @@
<?php
namespace App\Events\Transaction;
use Illuminate\Queue\SerializesModels;
class TransactionPrinting
{
use SerializesModels;
public $transaction;
/**
* Create a new event instance.
*
* @param $transaction
*/
public function __construct($transaction)
{
$this->transaction = $transaction;
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Events\Transaction;
use App\Abstracts\Event;
class TransactionSent extends Event
{
public $transaction;
/**
* Create a new event instance.
*
* @param $transaction
*/
public function __construct($transaction)
{
$this->transaction = $transaction;
}
}

View File

@ -7,9 +7,13 @@ use App\Models\Banking\Transaction;
use App\Models\Setting\Currency;
use App\Http\Requests\Portal\PaymentShow as Request;
use App\Utilities\Modules;
use App\Traits\Transactions;
use Illuminate\Support\Facades\URL;
class Payments extends Controller
{
use Transactions;
/**
* Display a listing of the resource.
*
@ -51,4 +55,62 @@ class Payments extends Controller
return $this->response('portal.currencies.index', compact('currencies'));
}
/**
* Show the form for viewing the specified resource.
*
* @param Transaction $payment
*
* @return Response
*/
public function printPayment(Transaction $payment, Request $request)
{
event(new \App\Events\Transaction\TransactionPrinting($payment));
$revenue = $payment;
$view = view($payment->template_path, compact('revenue'));
return mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
}
/**
* Show the form for viewing the specified resource.
*
* @param Transaction $payment
*
* @return Response
*/
public function pdfPayment(Transaction $payment, Request $request)
{
event(new \App\Events\Transaction\TransactionPrinting($payment));
$currency_style = true;
$revenue = $payment;
$view = view($payment->template_path, compact('revenue', 'currency_style'))->render();
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
$pdf = app('dompdf.wrapper');
$pdf->loadHTML($html);
//$pdf->setPaper('A4', 'portrait');
$file_name = $this->getTransactionFileName($payment);
return $pdf->download($file_name);
}
public function signed(Transaction $payment)
{
if (empty($payment)) {
return redirect()->route('login');
}
$payment_methods = Modules::getPaymentMethods();
$print_action = URL::signedRoute('signed.payments.print', [$payment->id]);
$pdf_action = URL::signedRoute('signed.payments.pdf', [$payment->id]);
return view('portal.payments.signed', compact('payment', 'payment_methods', 'print_action', 'pdf_action'));
}
}

View File

@ -17,11 +17,12 @@ use App\Models\Setting\Category;
use App\Models\Setting\Currency;
use App\Traits\Currencies;
use App\Traits\DateTime;
use App\Traits\Transactions;
use App\Utilities\Modules;
class Payments extends Controller
{
use Currencies, DateTime;
use Currencies, DateTime, Transactions;
/**
* Display a listing of the resource.
@ -40,9 +41,9 @@ class Payments extends Controller
*
* @return Response
*/
public function show()
public function show(Transaction $payment)
{
return redirect()->route('payments.index');
return view('purchases.payments.show', compact('payment'));
}
/**
@ -91,7 +92,7 @@ class Payments extends Controller
$response = $this->ajaxDispatch(new CreateTransaction($request));
if ($response['success']) {
$response['redirect'] = route('payments.index');
$response['redirect'] = route('payments.show', $response['data']->id);
$message = trans('messages.success.added', ['type' => trans_choice('general.payments', 1)]);
@ -206,7 +207,7 @@ class Payments extends Controller
$response = $this->ajaxDispatch(new UpdateTransaction($payment, $request));
if ($response['success']) {
$response['redirect'] = route('payments.index');
$response['redirect'] = route('payments.show', $payment->id);
$message = trans('messages.success.updated', ['type' => trans_choice('general.payments', 1)]);
@ -257,4 +258,69 @@ class Payments extends Controller
{
return $this->exportExcel(new Export, trans_choice('general.payments', 2));
}
/**
* Download the PDF file of payment.
*
* @param Transaction $payment
*
* @return Response
*/
public function emailPayment(Transaction $payment)
{
if (empty($payment->contact->email)) {
return redirect()->back();
}
// Notify the customer
$payment->contact->notify(new Notification($payment, 'payment_new_customer', true));
event(new \App\Events\Transaction\TransactionSent($payment));
flash(trans('documents.messages.email_sent', ['type' => trans_choice('general.payments', 1)]))->success();
return redirect()->back();
}
/**
* Print the payment.
*
* @param Transaction $payment
*
* @return Response
*/
public function printPayment(Transaction $payment)
{
event(new \App\Events\Transaction\TransactionPrinting($payment));
$view = view($payment->template_path, compact('payment'));
return mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
}
/**
* Download the PDF file of payment.
*
* @param Transaction $payment
*
* @return Response
*/
public function pdfPayment(Transaction $payment)
{
event(new \App\Events\Transaction\TransactionPrinting($payment));
$currency_style = true;
$view = view($payment->template_path, compact('payment', 'currency_style'))->render();
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
$pdf = app('dompdf.wrapper');
$pdf->loadHTML($html);
//$pdf->setPaper('A4', 'portrait');
$file_name = $this->getTransactionFileName($payment);
return $pdf->download($file_name);
}
}

View File

@ -15,13 +15,15 @@ use App\Models\Banking\Transaction;
use App\Models\Common\Contact;
use App\Models\Setting\Category;
use App\Models\Setting\Currency;
use App\Notifications\Sale\Revenue as Notification;
use App\Traits\Currencies;
use App\Traits\DateTime;
use App\Traits\Transactions;
use App\Utilities\Modules;
class Revenues extends Controller
{
use Currencies, DateTime;
use Currencies, DateTime, Transactions;
/**
* Display a listing of the resource.
@ -40,9 +42,9 @@ class Revenues extends Controller
*
* @return Response
*/
public function show()
public function show(Transaction $revenue)
{
return redirect()->route('revenues.index');
return view('sales.revenues.show', compact('revenue'));
}
/**
@ -91,7 +93,7 @@ class Revenues extends Controller
$response = $this->ajaxDispatch(new CreateTransaction($request));
if ($response['success']) {
$response['redirect'] = route('revenues.index');
$response['redirect'] = route('revenues.show', $response['data']->id);
$message = trans('messages.success.added', ['type' => trans_choice('general.revenues', 1)]);
@ -206,7 +208,7 @@ class Revenues extends Controller
$response = $this->ajaxDispatch(new UpdateTransaction($revenue, $request));
if ($response['success']) {
$response['redirect'] = route('revenues.index');
$response['redirect'] = route('revenues.show', $revenue->id);
$message = trans('messages.success.updated', ['type' => trans_choice('general.revenues', 1)]);
@ -257,4 +259,69 @@ class Revenues extends Controller
{
return $this->exportExcel(new Export, trans_choice('general.revenues', 2));
}
/**
* Download the PDF file of revenue.
*
* @param Transaction $revenue
*
* @return Response
*/
public function emailRevenue(Transaction $revenue)
{
if (empty($revenue->contact->email)) {
return redirect()->back();
}
// Notify the customer
$revenue->contact->notify(new Notification($revenue, 'revenue_new_customer', true));
event(new \App\Events\Transaction\TransactionSent($revenue));
flash(trans('documents.messages.email_sent', ['type' => trans_choice('general.revenues', 1)]))->success();
return redirect()->back();
}
/**
* Print the revenue.
*
* @param Transaction $revenue
*
* @return Response
*/
public function printRevenue(Transaction $revenue)
{
event(new \App\Events\Transaction\TransactionPrinting($revenue));
$view = view($revenue->template_path, compact('revenue'));
return mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
}
/**
* Download the PDF file of revenue.
*
* @param Transaction $revenue
*
* @return Response
*/
public function pdfRevenue(Transaction $revenue)
{
event(new \App\Events\Transaction\TransactionPrinting($revenue));
$currency_style = true;
$view = view($revenue->template_path, compact('revenue', 'currency_style'))->render();
$html = mb_convert_encoding($view, 'HTML-ENTITIES', 'UTF-8');
$pdf = app('dompdf.wrapper');
$pdf->loadHTML($html);
//$pdf->setPaper('A4', 'portrait');
$file_name = $this->getTransactionFileName($revenue);
return $pdf->download($file_name);
}
}

View File

@ -0,0 +1,56 @@
<?php
namespace App\Listeners\Update\V21;
use App\Abstracts\Listeners\Update as Listener;
use App\Events\Install\UpdateFinished as Event;
use App\Models\Common\Company;
use App\Models\Common\EmailTemplate;
use Illuminate\Support\Facades\Artisan;
class Version2118 extends Listener
{
const ALIAS = 'core';
const VERSION = '2.1.18';
/**
* Handle the event.
*
* @param $event
*
* @return void
*/
public function handle(Event $event)
{
if ($this->skipThisUpdate($event)) {
return;
}
$this->updateEmailTemplate();
Artisan::call('migrate', ['--force' => true]);
}
protected function updateCompanies()
{
$company_id = company_id();
$companies = Company::cursor();
foreach ($companies as $company) {
$company->makeCurrent();
EmailTemplate::create([
'company_id' => $company->id,
'alias' => 'revenue_new_customer',
'class' => 'App\Notifications\Sale\Revenue',
'name' => 'settings.email.templates.revenue_new_customer',
'subject' => trans('email_templates.revenue_new_customer.subject'),
'body' => trans('email_templates.revenue_new_customer.body'),
]);
}
company($company_id)->makeCurrent();
}
}

View File

@ -371,11 +371,11 @@ class Transaction extends Model
}
if ($this->isIncome()) {
return !empty($this->document_id) ? 'invoices.show' : 'revenues.edit';
return !empty($this->document_id) ? 'invoices.show' : 'revenues.show';
}
if ($this->isExpense()) {
return !empty($this->document_id) ? 'bills.show' : 'payments.edit';
return !empty($this->document_id) ? 'bills.show' : 'payments.show';
}
return 'transactions.index';
@ -391,6 +391,11 @@ class Transaction extends Model
return !empty($value) ? $value : (!empty($this->document_id) ? $this->document_id : $this->id);
}
public function getTemplatePathAttribute($value = null)
{
return $value ?: 'sales.revenues.print_default';
}
/**
* Create a new factory instance for the model.
*

View File

@ -0,0 +1,121 @@
<?php
namespace App\Notifications\Sale;
use App\Abstracts\Notification;
use App\Models\Common\EmailTemplate;
use App\Traits\Transactions;
use Illuminate\Support\Facades\URL;
class Revenue extends Notification
{
use Transactions;
/**
* The revenue model.
*
* @var object
*/
public $revenue;
/**
* The email template.
*
* @var string
*/
public $template;
/**
* Should attach pdf or not.
*
* @var bool
*/
public $attach_pdf;
/**
* Create a notification instance.
*
* @param object $revenue
* @param object $template_alias
* @param object $attach_pdf
*/
public function __construct($revenue = null, $template_alias = null, $attach_pdf = false)
{
parent::__construct();
$this->revenue = $revenue;
$this->template = EmailTemplate::alias($template_alias)->first();
$this->attach_pdf = $attach_pdf;
}
/**
* Get the mail representation of the notification.
*
* @param mixed $notifiable
* @return \Illuminate\Notifications\Messages\MailMessage
*/
public function toMail($notifiable)
{
$message = $this->initMessage();
// Attach the PDF file
if ($this->attach_pdf) {
$message->attach($this->storeDocumentPdfAndGetPath($this->revenue), [
'mime' => 'application/pdf',
]);
}
return $message;
}
/**
* Get the array representation of the notification.
*
* @param mixed $notifiable
* @return array
*/
public function toArray($notifiable)
{
return [
'template_alias' => $this->template->alias,
'revenue_id' => $this->revenue->id,
'customer_name' => $this->revenue->contact->name,
'amount' => $this->revenue->amount,
'revenue_date' => company_date($this->revenue->paid_at),
];
}
public function getTags()
{
return [
'{revenue_amount}',
'{revenue_date}',
'{revenue_guest_link}',
'{revenue_admin_link}',
'{revenue_portal_link}',
'{customer_name}',
'{company_name}',
'{company_email}',
'{company_tax_number}',
'{company_phone}',
'{company_address}',
];
}
public function getTagsReplacement()
{
return [
money($this->revenue->amount, $this->revenue->currency_code, true),
company_date($this->revenue->paid_at),
URL::signedRoute('signed.payments.show', [$this->revenue->id]),
route('revenues.show', $this->revenue->id),
route('portal.payments.show', $this->revenue->id),
$this->revenue->contact->name,
$this->revenue->company->name,
$this->revenue->company->email,
$this->revenue->company->tax_number,
$this->revenue->company->phone,
nl2br(trim($this->revenue->company->address)),
];
}
}

View File

@ -34,6 +34,7 @@ class Event extends Provider
'App\Listeners\Update\V21\Version2114',
'App\Listeners\Update\V21\Version2116',
'App\Listeners\Update\V21\Version2117',
'App\Listeners\Update\V21\Version2118',
],
'Illuminate\Auth\Events\Login' => [
'App\Listeners\Auth\Login',

View File

@ -2,6 +2,9 @@
namespace App\Traits;
use App\Models\Banking\Transaction;
use Illuminate\Support\Str;
trait Transactions
{
public function isIncome()
@ -59,4 +62,30 @@ trait Transactions
'transaction.type.' . $index => implode(',', $types),
])->save();
}
public function getTransactionFileName(Transaction $transaction, string $separator = '-', string $extension = 'pdf'): string
{
return $this->getSafeTransactionNumber($transaction, $separator) . $separator . time() . '.' . $extension;
}
public function getSafeTransactionNumber(Transaction $transaction, string $separator = '-'): string
{
return Str::slug($transaction->id, $separator, language()->getShortCode());
}
protected function getSettingKey($type, $setting_key)
{
$key = '';
$alias = config('type.' . $type . '.alias');
if (!empty($alias)) {
$key .= $alias . '.';
}
$prefix = config('type.' . $type . '.setting.prefix');
$key .= $prefix . '.' . $setting_key;
return $key;
}
}

View File

@ -0,0 +1,55 @@
<?php
namespace App\View\Components\Transactions;
use Illuminate\View\Component;
class Script extends Component
{
/** @var string */
public $type;
/** @var string */
public $scriptFile;
/** @var string */
public $version;
public $transaction;
/**
* Create a new component instance.
*
* @return void
*/
public function __construct(string $type = '', string $scriptFile = '', string $version = '', $transaction = false)
{
$this->type = $type;
$this->scriptFile = ($scriptFile) ? $scriptFile : 'public/js/common/documents.js';
$this->version = $this->getVersion($version);
$this->transaction = $transaction;
}
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transactions.script');
}
protected function getVersion($version)
{
if (!empty($version)) {
return $version;
}
if ($alias = config('type.' . $this->type . '.alias')) {
return module_version($alias);
}
return version('short');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Show;
use App\Abstracts\View\Components\TransactionShow as Component;
class Attachment extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transactions.show.attachment');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Show;
use App\Abstracts\View\Components\TransactionShow as Component;
class Content extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transactions.show.content');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Show;
use App\Abstracts\View\Components\TransactionShow as Component;
class Footer extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transactions.show.footer');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Show;
use App\Abstracts\View\Components\TransactionShow as Component;
class Header extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transactions.show.header');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Show;
use App\Abstracts\View\Components\TransactionShow 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.transactions.show.histories');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Show;
use App\Abstracts\View\Components\TransactionShow 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.transactions.show.top-buttons');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Show;
use App\Abstracts\View\Components\TransactionShow as Component;
class Transaction extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transactions.show.transaction');
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\View\Components\Transactions\Template;
use App\Abstracts\View\Components\TransactionTemplate as Component;
class Ddefault extends Component
{
/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|string
*/
public function render()
{
return view('components.transactions.template.default');
}
}

View File

@ -89,19 +89,37 @@ return [
// Transactions
'income' => [
'group' => 'sales',
'route' => [
'prefix' => 'revenues', // core use with group + prefix, module ex. estimates
'parameter' => 'revenue', // sales/invoices/{parameter}/edit
//'create' => 'invoices.create', // if you change route, you can write full path
],
'permission' => [
'prefix' => 'revenues',
//'create' => 'create-sales-revenues',
],
'translation' => [
'prefix' => 'revenues', // this translation file name.
'related_document_amount' => 'invoices.invoice_amount',
],
'contact_type' => 'customer',
],
'expense' => [
'group' => 'purchases',
'route' => [
'prefix' => 'payments', // core use with group + prefix, module ex. estimates
'parameter' => 'payment', // sales/invoices/{parameter}/edit
//'create' => 'invoices.create', // if you change route, you can write full path
],
'permission' => [
'prefix' => 'payments',
//'create' => 'create-purchases-payments',
],
'translation' => [
'prefix' => 'payments', // this translation file name.
'related_document_amount' => 'bills.bill_amount',
],
'contact_type' => 'vendor',
],

View File

@ -72,6 +72,11 @@ class EmailTemplates extends Seeder
'class' => 'App\Notifications\Purchase\Bill',
'name' => 'settings.email.templates.bill_recur_admin',
],
[
'alias' => 'revenue_new_customer',
'class' => 'App\Notifications\Sale\Revenue',
'name' => 'settings.email.templates.revenue_new_customer',
],
];
foreach ($templates as $template) {

16
public/css/custom.css vendored
View File

@ -220,6 +220,22 @@ button:focus {
.mwpx-100 {
max-width: 100px !important;
}
.mwpx-200 {
max-width: 200px !important;
}
.mwpx-300 {
max-width: 300px !important;
}
.mwpx-400 {
max-width: 400px !important;
}
.mwpx-500 {
max-width: 500px !important;
}
/*--------Max Width 100 Pixel Finish--------*/
/*--------Form Group--------*/

60
public/css/print.css vendored
View File

@ -249,6 +249,13 @@ th, td
vertical-align: top;
}
.col-16
{
display: inline-block;
max-width: 16%;
vertical-align: top;
}
.col-100
{
display: inline-block;
@ -493,4 +500,57 @@ th, td
display: block;
clear: both;
content: ""
}
.show-card {
padding: 0px 15px;
border-radius: 0px;
box-shadow: rgb(0 0 0 / 20%) 0px 4px 16px;
}
.card-amount-badge h5 {
font-size: 20px;
}
.card-amount-badge span {
font-size: 32px;
}
.show-card-body {
padding: 1.5rem 2.5rem;
}
.show-card-bg-success {
width: 350px;
height: 150px;
border-radius: unset;
}
.show-company-value strong {
font-weight: bold;
}
.show-company p {
min-height: 52px;
}
@media (max-width: 1200px) {
.transaction-head-text {
max-width: 100px !important;
}
}
@media (max-width: 991px) {
.transaction-head-text {
max-width: 75px !important;
}
}
@media (max-width: 575.98px) {
.show-card {
overflow-y: scroll;
}
.show-card-body {
padding: 1.5rem 1.5rem;
}
}

View File

@ -4,6 +4,7 @@ return [
'bill_number' => 'Bill Number',
'bill_date' => 'Bill Date',
'bill_amount' => 'Bill Amount',
'total_price' => 'Total Price',
'due_date' => 'Due Date',
'order_number' => 'Order Number',

View File

@ -3,7 +3,7 @@
return [
'edit_columns' => 'Edit Columns',
'empty_items' =>'You have not added any items.',
'empty_items' => 'You have not added any items.',
'statuses' => [
'draft' => 'Draft',

View File

@ -47,4 +47,8 @@ return [
'body' => 'Hello,<br /><br />Based on {vendor_name} recurring circle, <strong>{bill_number}</strong> bill has been automatically created.<br /><br />You can see the bill details from the following link: <a href="{bill_admin_link}">{bill_number}</a>.<br /><br />Best Regards,<br />{company_name}',
],
'revenue_new_customer' => [
'subject' => '{revenue_date} payment created',
'body' => 'Dear {customer_name},<br /><br />We have prepared the following payment. <br /><br />You can see the payment details from the following link: <a href="{revenue_guest_link}">{revenue_date}</a>.<br /><br />Feel free to contact us for any question.<br /><br />Best Regards,<br />{company_name}',
],
];

View File

@ -162,6 +162,7 @@ return [
'due_on' => 'Due on',
'amount_due' => 'Amount due',
'financial_year' => 'Financial Year',
'created' => 'Created',
'card' => [
'cards' => 'Card|Cards',

View File

@ -4,6 +4,7 @@ return [
'invoice_number' => 'Invoice Number',
'invoice_date' => 'Invoice Date',
'invoice_amount' => 'Invoice Amount',
'total_price' => 'Total Price',
'due_date' => 'Due Date',
'order_number' => 'Order Number',

View File

@ -0,0 +1,9 @@
<?php
return [
'payment_made' => 'Payment Made',
'paid_to' => 'Paid To',
'related_bill' => 'Releated Bill',
];

View File

@ -0,0 +1,9 @@
<?php
return [
'revenue_received' => 'Revenue Received',
'paid_by' => 'Paid By',
'related_invoice' => 'Releated Invoice',
];

View File

@ -0,0 +1 @@
<script src="{{ asset( $scriptFile . '?v=' . $version) }}"></script>

View File

@ -0,0 +1,9 @@
@if ($attachment)
<div class="row align-items-center">
@foreach ($attachment as $file)
<div class="col-xs-12 col-sm-4 mb-4">
@include('partials.media.file')
</div>
@endforeach
</div>
@endif

View File

@ -0,0 +1,108 @@
@stack('content_header_start')
@if (!$hideHeader)
<x-transactions.show.header
type="{{ $type }}"
:transaction="$transaction"
hide-header-account="{{ $hideHeaderAccount }}"
text-header-account="{{ $textHeaderAccount }}"
class-header-account="{{ $classHeaderAccount }}"
hide-header-category="{{ $hideHeaderCategory }}"
text-header-category="{{ $textHeaderCategory }}"
class-header-category="{{ $classHeaderCategory }}"
hide-header-contact="{{ $hideHeaderContact }}"
text-header-contact="{{ $textHeaderContact }}"
class-header-contact="{{ $classHeaderContact }}"
hide-header-amount="{{ $hideHeaderAmount }}"
text-header-amount="{{ $textHeaderAmount }}"
class-header-amount="{{ $classHeaderAmount }}"
hide-header-paid-at="{{ $hideHeaderPaidAt }}"
text-header-paid-at="{{ $textHeaderPaidAt }}"
class-header-paid-at="{{ $classHeaderPaidAt }}"
/>
@endif
@stack('content_header_end')
@stack('transaction_start')
<x-transactions.show.transaction
type="{{ $type }}"
:transaction="$transaction"
transaction-template="{{ $transactionTemplate }}"
logo="{{ $logo }}"
hide-company="{{ $hideCompany }}"
hide-company-logo="{{ $hideCompanyLogo }}"
hide-company-details="{{ $hideCompanyDetails }}"
hide-company-name="{{ $hideCompanyName }}"
hide-company-address="{{ $hideCompanyAddress }}"
hide-company-tax-number="{{ $hideCompanyTaxNumber }}"
hide-company-phone="{{ $hideCompanyPhone }}"
hide-company-email="{{ $hideCompanyEmail }}"
hide-content-title="{{ $hideContentTitle }}"
hide-paid-at="{{ $hidePaidAt }}"
hide-account="{{ $hideAccount }}"
hide-category="{{ $hideCategory }}"
hide-payment-methods="{{ $hidePaymentMethods }}"
hide-reference="{{ $hideReference }}"
hide-description="{{ $hideDescription }}"
hide-amount="{{ $hideAmount }}"
text-content-title="{{ $textContentTitle }}"
text-paid-at="{{ $textPaidAt }}"
text-account="{{ $textAccount }}"
text-category="{{ $textCategory }}"
text-payment-methods="{{ $textPaymentMethods }}"
text-reference="{{ $textReference }}"
text-description="{{ $textDescription }}"
text-paid-by="{{ $textAmount }}"
hide-contact="{{ $hideContact }}"
hide-contact-info="{{ $hideContactInfo }}"
hide-contact-name="{{ $hideContactName }}"
hide-contact-address="{{ $hideContactAddress }}"
hide-contact-tax-number="{{ $hideContactTaxNumber }}"
hide-contact-phone="{{ $hideContactPhone }}"
hide-contact-email="{{ $hideContactEmail }}"
hide-releated="{{ $hideReletad }}"
hide-releated-document-number="{{ $hideReletadDocumentNumber }}"
hide-releated-contact="{{ $hideReletadContact }}"
hide-releated-document-date="{{ $hideReletadDocumentDate }}"
hide-releated-document-amount="{{ $hideReletadDocumentAmount }}"
hide-releated-amount="{{ $hideReletadAmount }}"
text-releated-transaction="{{ $textReleatedTransansaction }}"
text-releated-document-number="{{ $textReleatedDocumentNumber }}"
text-releated-contact="{{ $textReleatedContact }}"
text-releated-document-date="{{ $textReleatedDocumentDate }}"
text-releated-document-amount="{{ $textReleatedDocumentAmount }}"
text-releated-amount="{{ $textReleatedAmount }}"
route-document-show="{{ $routeDocumentShow }}"
/>
@stack('transaction_end')
@stack('attachment_start')
@if (!$hideAttachment)
<x-transactions.show.attachment
type="{{ $type }}"
:transaction="$transaction"
:attachment="$attachment"
/>
@endif
@stack('attachment_end')
@stack('row_footer_start')
@if (!$hideFooter)
<x-transactions.show.footer
type="{{ $type }}"
:transaction="$transaction"
:histories="$histories"
class-footer-histories="{{ $classFooterHistories }}"
hide-footer-histories="{{ $hideFooterHistories }}"
text-histories="{{ $textHistories }}"
/>
@endif
@stack('row_footer_end')
{{ Form::hidden('transaction_id', $transaction->id, ['id' => 'transaction_id']) }}
{{ Form::hidden($type . '_id', $transaction->id, ['id' => $type . '_id']) }}

View File

@ -0,0 +1,14 @@
<div class="row">
@stack('row_footer_histories_start')
@if (!$hideFooterHistories)
<div class="{{ $classFooterHistories }}">
<x-transactions.show.histories
type="{{ $type }}"
:transaction="$transaction"
:histories="$histories"
text-histories="{{ $textHistories }}"
/>
</div>
@endif
@stack('row_footer_histories_end')
</div>

View File

@ -0,0 +1,81 @@
<div class="row" style="font-size: inherit !important">
@stack('header_account_start')
@if (!$hideHeaderAccount)
<div class="{{ $classHeaderAccount }}">
{{ trans_choice($textHeaderAccount, 1) }}
<br>
<strong>
<span class="float-left long-texts mwpx-200 transaction-head-text">
{{ $transaction->account->name }}
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_account_end')
@stack('header_category_start')
@if (!$hideHeaderCategory)
<div class="{{ $classHeaderCategory }}">
{{ trans_choice($textHeaderCategory, 1) }}
<br>
<strong>
<span class="float-left long-texts mwpx-300 transaction-head-text">
{{ $transaction->category->name }}
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_category_end')
@stack('header_contact_start')
@if (!$hideHeaderContact)
<div class="{{ $classHeaderContact }}">
{{ trans_choice($textHeaderContact, 1) }}
<br>
<strong>
<span class="float-left long-texts mwpx-300 transaction-head-text">
{{ $transaction->contact->name }}
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_contact_end')
@stack('header_amount_start')
@if (!$hideHeaderAmount)
<div class="{{ $classHeaderAmount }}">
{{ trans($textHeaderAmount) }}
<br>
<strong>
<span class="float-left long-texts mwpx-100 transaction-head-text">
@money($transaction->amount, $transaction->currency_code, true)
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_amount_end')
@stack('header_paid_at_start')
@if (!$hideHeaderPaidAt)
<div class="{{ $classHeaderPaidAt }}">
{{ trans($textHeaderPaidAt) }}
<br>
<strong>
<span class="float-left long-texts mwpx-100 transaction-head-text">
@date($transaction->paid_at)
</span>
</strong>
<br><br>
</div>
@endif
@stack('header_paid_at_end')
</div>

View File

@ -0,0 +1,47 @@
<div class="accordion">
<div class="card">
<div class="card-header" id="accordion-histories-header" data-toggle="collapse" data-target="#accordion-histories-body" aria-expanded="false" aria-controls="accordion-histories-body">
<h4 class="mb-0">{{ trans($textHistories) }}</h4>
</div>
<div id="accordion-histories-body" class="collapse hide" aria-labelledby="accordion-histories-header">
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
@stack('row_footer_histories_head_tr_start')
<tr class="row table-head-line">
@stack('row_footer_histories_head_start')
<th class="col-xs-4 col-sm-3">
{{ trans('general.date') }}
</th>
<th class="col-xs-8 col-sm-9 text-left long-texts">
{{ trans('general.created') }}
</th>
@stack('row_footer_histories_head_end')
</tr>
@stack('row_footer_histories_head_tr_end')
</thead>
<tbody>
@stack('row_footer_histories_body_tr_start')
@foreach($histories as $history)
<tr class="row align-items-center border-top-1 tr-py">
@stack('row_footer_histories_body_td_start')
<td class="col-xs-4 col-sm-3">
@date($history->created_at)
</td>
<td class="col-xs-4 col-sm-6 text-left long-texts">
{{ $history->owner->name }}
</td>
@stack('row_footer_histories_body_td_end')
</tr>
@endforeach
@stack('row_footer_histories_body_tr_end')
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,109 @@
@stack('button_group_start')
@if (!$hideButtonMoreActions)
<div class="dropup header-drop-top">
<button type="button" class="btn btn-white btn-sm" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-chevron-down"></i>&nbsp; {{ trans('general.more_actions') }}
</button>
<div class="dropdown-menu" role="menu">
@stack('button_dropdown_start')
@stack('edit_button_start')
@if (!$hideButtonEdit)
@can($permissionUpdate)
<a class="dropdown-item" href="{{ route($routeButtonEdit, $transaction->id) }}">
{{ trans('general.edit') }}
</a>
@endcan
@endif
@stack('edit_button_end')
@stack('duplicate_button_start')
@if (!$hideButtonDuplicate)
@can($permissionCreate)
<a class="dropdown-item" href="{{ route($routeButtonDuplicate, $transaction->id) }}">
{{ trans('general.duplicate') }}
</a>
@endcan
@endif
@stack('duplicate_button_end')
@stack('button_dropdown_divider_1_start')
@if (!$hideButtonGroupDivider1)
<div class="dropdown-divider"></div>
@endif
@stack('button_dropdown_divider_1_end')
@if (!$hideButtonPrint)
@stack('button_print_start')
<a class="dropdown-item" href="{{ route($routeButtonPrint, $transaction->id) }}" target="_blank">
{{ trans('general.print') }}
</a>
@stack('button_print_end')
@endif
@stack('share_button_start')
@if (!$hideButtonShare)
<a class="dropdown-item" href="{{ $signedUrl }}" target="_blank">
{{ trans('general.share') }}
</a>
@endif
@stack('share_button_end')
@stack('edit_button_start')
@if (!$hideButtonEmail)
@if($transaction->contact->email)
<a class="dropdown-item" href="{{ route($routeButtonEmail, $transaction->id) }}">
{{ trans('invoices.send_mail') }}
</a>
@else
<el-tooltip content="{{ trans('invoices.messages.email_required') }}" placement="right">
<button type="button" class="dropdown-item btn-tooltip">
<span class="text-disabled">{{ trans('invoices.send_mail') }}</span>
</button>
</el-tooltip>
@endif
@endif
@stack('edit_button_end')
@stack('button_pdf_start')
@if (!$hideButtonPdf)
<a class="dropdown-item" href="{{ route($routeButtonPdf, $transaction->id) }}">
{{ trans('general.download_pdf') }}
</a>
@endif
@stack('button_pdf_end')
@stack('button_dropdown_divider_3_start')
@if (!$hideButtonGroupDivider3)
<div class="dropdown-divider"></div>
@endif
@stack('button_dropdown_divider_3_end')
@stack('delete_button_start')
@if (!$hideButtonDelete)
@can($permissionDelete)
@if ($checkButtonReconciled)
@if (!$transaction->reconciled)
{!! Form::deleteLink($transaction, $routeButtonDelete, $textDeleteModal, 'transaction_number') !!}
@endif
@else
{!! Form::deleteLink($transaction, $routeButtonDelete, $textDeleteModal, 'transaction_number') !!}
@endif
@endcan
@endif
@stack('delete_button_end')
@stack('button_dropdown_end')
</div>
</div>
@endif
@stack('button_group_end')
@stack('add_new_button_start')
@if (!$hideButtonAddNew)
@can($permissionCreate)
<a href="{{ route($routeButtonAddNew) }}" class="btn btn-white btn-sm">
{{ trans('general.add_new') }}
</a>
@endcan
@endif
@stack('add_new_button_end')

View File

@ -0,0 +1,73 @@
<div class="card show-card" style="padding: 0; padding-left: 15px; padding-right: 15px; border-radius: 0; box-shadow: 0 4px 16px rgba(0,0,0,.2);">
<div class="card-body show-card-body">
@if ($transactionTemplate)
@switch($transactionTemplate)
@case('classic')
@break
@case('modern')
@break
@default
<x-transactions.template.ddefault
type="{{ $type }}"
:transaction="$transaction"
:payment_methods="$payment_methods"
transaction-template="{{ $transactionTemplate }}"
logo="{{ $logo }}"
hide-company="{{ $hideCompany }}"
hide-company-logo="{{ $hideCompanyLogo }}"
hide-company-details="{{ $hideCompanyDetails }}"
hide-company-name="{{ $hideCompanyName }}"
hide-company-address="{{ $hideCompanyAddress }}"
hide-company-tax-number="{{ $hideCompanyTaxNumber }}"
hide-company-phone="{{ $hideCompanyPhone }}"
hide-company-email="{{ $hideCompanyEmail }}"
hide-content-title="{{ $hideContentTitle }}"
hide-paid-at="{{ $hidePaidAt }}"
hide-account="{{ $hideAccount }}"
hide-category="{{ $hideCategory }}"
hide-payment-methods="{{ $hidePaymentMethods }}"
hide-reference="{{ $hideReference }}"
hide-description="{{ $hideDescription }}"
hide-amount="{{ $hideAmount }}"
text-content-title="{{ $textContentTitle }}"
text-paid-at="{{ $textPaidAt }}"
text-account="{{ $textAccount }}"
text-category="{{ $textCategory }}"
text-payment-methods="{{ $textPaymentMethods }}"
text-reference="{{ $textReference }}"
text-description="{{ $textDescription }}"
text-paid-by="{{ $textAmount }}"
hide-contact="{{ $hideContact }}"
hide-contact-info="{{ $hideContactInfo }}"
hide-contact-name="{{ $hideContactName }}"
hide-contact-address="{{ $hideContactAddress }}"
hide-contact-tax-number="{{ $hideContactTaxNumber }}"
hide-contact-phone="{{ $hideContactPhone }}"
hide-contact-email="{{ $hideContactEmail }}"
hide-releated="{{ $hideReletad }}"
hide-releated-document-number="{{ $hideReletadDocumentNumber }}"
hide-releated-contact="{{ $hideReletadContact }}"
hide-releated-document-date="{{ $hideReletadDocumentDate }}"
hide-releated-document-amount="{{ $hideReletadDocumentAmount }}"
hide-releated-amount="{{ $hideReletadAmount }}"
text-releated-transaction="{{ $textReleatedTransansaction }}"
text-releated-document-number="{{ $textReleatedDocumentNumber }}"
text-releated-contact="{{ $textReleatedContact }}"
text-releated-document-date="{{ $textReleatedDocumentDate }}"
text-releated-document-amount="{{ $textReleatedDocumentAmount }}"
text-releated-amount="{{ $textReleatedAmount }}"
route-document-show="{{ $routeDocumentShow }}"
/>
@endswitch
@else
@include($transactionTemplate)
@endif
</div>
</div>

View File

@ -0,0 +1,337 @@
@stack('company_start')
@if (!$hideCompany)
<table class="border-bottom-1">
<tr>
@if (!$hideCompanyLogo)
<td style="width:5%;" valign="top">
@stack('company_logo_start')
@if (!empty($document->contact->logo) && !empty($document->contact->logo->id))
<img src="{{ Storage::url($document->contact->logo->id) }}" height="128" width="128" alt="{{ $document->contact_name }}" />
@else
<img src="{{ $logo }}" alt="{{ setting('company.name') }}" />
@endif
@stack('company_logo_end')
</td>
@endif
@if (!$hideCompanyDetails)
<td style="width: 60%;">
@stack('company_details_start')
@if (!$hideCompanyName)
<h2 class="mb-1" style="font-size: 16px;">
{{ setting('company.name') }}
</h2>
@endif
@if (!$hideCompanyAddress)
<p style="margin:0; padding:0; font-size:14px;">{!! nl2br(setting('company.address')) !!}</p>
@endif
@if (!$hideCompanyTaxNumber)
<p style="margin:0; padding:0; font-size:14px;">
@if (setting('company.tax_number'))
{{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
@endif
</p>
@endif
@if (!$hideCompanyPhone)
<p style="margin:0; padding:0; font-size:14px;">
@if (setting('company.phone'))
{{ setting('company.phone') }}
@endif
</p>
@endif
@if (!$hideCompanyEmail)
<p style="margin:0; padding:0; font-size:14px;">{{ setting('company.email') }}</p>
@endif
@stack('company_details_end')
</td>
@endif
</tr>
</table>
@endif
@stack('company_end')
@if (!$hideContentTitle)
<table>
<tr>
<td style="padding-bottom: 0; padding-top: 32px;">
<h2 class="text-center text-uppercase" style="font-size: 16px;">
{{ trans($textContentTitle) }}
</h2>
</td>
</tr>
</table>
@endif
<table>
<tr>
<td style="width: 70%; padding-top:0; padding-bottom:0;">
<table>
@if (!$hidePaidAt)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textPaidAt) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
@date($transaction->paid_at)
</td>
</tr>
@endif
@if (!$hideAccount)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans_choice($textAccount, 1) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transaction->account->name }}
</td>
</tr>
@endif
@if (!$hideCategory)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans_choice($textCategory, 1) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transaction->category->name }}
</td>
</tr>
@endif
@if (!$hidePaymentMethods)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans_choice($textPaymentMethods, 1) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $payment_methods[$transaction->payment_method] }}
</td>
</tr>
@endif
@if (!$hideReference)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textReference) }}:
</td>
<td class="border-bottom-1" style="width:80%; padding-bottom:3px; font-size:14px;">
{{ $transaction->reference }}
</td>
</tr>
@endif
@if (!$hideDescription)
<tr>
<td style="width: 20%; padding-bottom:3px; font-size:14px; font-weight: bold;">
{{ trans($textDescription) }}:
</td>
<td style="width:80%; padding-bottom:3px; font-size:14px;">
<p style="font-size:14px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin: 0;">
{!! nl2br($transaction->description) !!}
</p>
</td>
</tr>
@endif
@if (!$hideContact)
<tr>
<td style="padding-top:45px; padding-bottom:0;">
<h2 style="font-size: 16px;">
{{ trans($textDescription) }}
</h2>
</td>
</tr>
@if ($hideContactInfo)
<tr>
<td style="padding-bottom:5px; padding-top:0; font-size:14px;">
<strong>{{ trans($textContactInfo) }}</strong><br>
</td>
</tr>
@endif
@stack('name_input_start')
@if (!$hideContactName)
<tr>
<td style="padding-bottom:5px; padding-top:0; font-size:14px;">
<strong>{{ $transaction->contact->name }}</strong><br>
</td>
</tr>
@endif
@stack('name_input_end')
@stack('address_input_start')
@if (!$hideContactAddress)
<tr>
<td style="padding-bottom:5px; padding-top:0; font-size:14px;">
<p style="margin:0; padding:0; font-size:14px;">
{!! nl2br($transaction->contact->address) !!}
</p>
</td>
</tr>
@endif
@stack('address_input_end')
@stack('tax_number_input_start')
@if (!$hideContactTaxNumber)
<tr>
<td style="padding-bottom:5px; padding-top:0; font-size:14px;">
<p style="margin:0; padding:0; font-size:14px;">
@if ($transaction->contact->tax_number)
{{ trans('general.tax_number') }}: {{ $transaction->contact->tax_number }}
@endif
</p>
</td>
</tr>
@endif
@stack('tax_number_input_end')
@stack('phone_input_start')
@if (!$hideContactPhone)
<tr>
<td style="padding-bottom:0; padding-top:0; font-size:14px;">
<p style="margin:0; padding:0; font-size:14px;">
@if ($transaction->contact->phone)
{{ $transaction->contact->phone }}
@endif
</p>
</td>
</tr>
@endif
@stack('phone_input_end')
@stack('email_start')
@if (!$hideContactEmail)
<tr>
<td style="padding-bottom:0; padding-top:0; font-size:14px;">
<p style="margin:0; padding:0; font-size:14px;">
{{ $transaction->contact->email }}
</p>
</td>
</tr>
@endif
@stack('email_input_end')
@endif
</table>
</td>
@if (!$hideAmount)
<td style="width:30%; padding-top:32px; padding-left: 25px;" valign="top">
<table>
<tr>
<td style="background-color: #6da252; -webkit-print-color-adjust: exact; width: 280px; font-weight:bold !important; display:block;">
<h5 class="text-muted mb-0 text-white" style="font-size: 20px; color:#ffffff; text-align:center; margin-top: 16px;">
{{ trans($textAmount) }}
</h5>
<p class="font-weight-bold mb-0 text-white" style="font-size: 32px; color:#ffffff; text-align:center;">
@money($transaction->amount, $transaction->currency_code, true)
</p>
</td>
</tr>
</table>
</td>
@endif
</tr>
</table>
@if (!$hideReletad)
@if ($transaction->document)
<table>
<tr>
<td class="border-bottom-1" style="padding-bottom: 0; padding-top:16px;"></td>
</tr>
</table>
<table>
<tr>
<td style="padding-bottom: 0; padding-top:36px;">
<h2 style="font-size: 16px;">{{ trans($textReleatedTransansaction) }}</h2>
</td>
</tr>
</table>
<table class="table table-flush table-hover" cellspacing="0" cellpadding="0" style="margin-bottom: 36px;">
<thead style="background-color: #f6f9fc; -webkit-print-color-adjust: exact; font-family: Arial, sans-serif; color:#8898aa; font-size:11px;">
<tr class="border-bottom-1">
@if (!$hideReletadDocumentNumber)
<th class="item text-left" style="text-align: left; text-transform: uppercase; font-family: Arial, sans-serif;">
<span>{{ trans_choice($textReleatedDocumentNumber, 1) }}</span>
</th>
@endif
@if (!$hideReletadContact)
<th class="quantity" style="text-align: left; text-transform: uppercase; font-family: Arial, sans-serif;">
{{ trans_choice($textReleatedContact, 1) }}
</th>
@endif
@if (!$hideReletadDocumentDate)
<th class="price" style="text-align: left; text-transform: uppercase; font-family: Arial, sans-serif;">
{{ trans($textReleatedDocumentDate) }}
</th>
@endif
@if (!$hideReletadDocumentAmount)
<th class="price" style="text-align: left; text-transform: uppercase; font-family: Arial, sans-serif;">
{{ trans($textReleatedDocumentAmount) }}
</th>
@endif
@if (!$hideReletadAmount)
<th class="total" style="text-align: left; text-transform: uppercase; font-family: Arial, sans-serif;">
{{ trans($textReleatedAmount) }}
</th>
@endif
</tr>
</thead>
<tbody>
<tr>
@if (!$hideReletadDocumentNumber)
<td class="item" style="color:#525f7f; font-size:13px;">
<a style="color:#6da252 !important;" href="{{ route($routeDocumentShow, $transaction->document->id) }}">
{{ $transaction->document->document_number }}
</a>
</td>
@endif
@if (!$hideReletadContact)
<td class="quantity" style="color:#525f7f; font-size:13px;">
{{ $transaction->document->contact_name }}
</td>
@endif
@if (!$hideReletadDocumentDate)
<td class="price" style="color:#525f7f; font-size:13px;">
@date($transaction->document->due_at)
</td>
@endif
@if (!$hideReletadDocumentAmount)
<td class="price" style="color:#525f7f; font-size:13px;">
@money($transaction->document->amount, $transaction->document->currency_code, true)
</td>
@endif
@if (!$hideReletadAmount)
<td class="total" style="color:#525f7f; font-size:13px;">
@money($transaction->amount, $transaction->currency_code, true)
</td>
@endif
</tr>
</tbody>
</table>
@endif
@endif

View File

@ -4,7 +4,7 @@
@section('new_button')
@stack('button_print_start')
<a href="{{ route('portal.invoices.print', $invoice->id) }}" target="_blank" class="btn btn-success btn-sm">
<a href="{{ route('portal.invoices.print', $invoice->id) }}" target="_blank" class="btn btn-white btn-sm">
{{ trans('general.print') }}
</a>
@stack('button_print_end')

View File

@ -1,144 +1,39 @@
@extends('layouts.portal')
@section('title', trans_choice('general.payments', 1))
@section('title', trans_choice('general.payments', 1) . ': ' . @date($payment->paid_at))
@section('content')
<div class="card">
<div class="card-header">
<h3 class="m-0 float-right">@date($payment->paid_at)</h3>
</div>
@section('new_button')
@stack('button_print_start')
<a href="{{ route('portal.payments.print', $payment->id) }}" target="_blank" class="btn btn-white btn-sm">
{{ trans('general.print') }}
</a>
@stack('button_print_end')
<div class="card-body">
<div class="row">
<div class="col-md-6">
<div class="card list-group">
<li class="list-group-item list-group-item-action active">
<b>{{ trans('general.from') }}:</b> {{ setting('company.name') }}
</li>
<li class="list-group-item"><b>{{ trans('general.address') }}:</b> {{ setting('company.address') }}</li>
<li class="list-group-item"><b>{{ trans('general.phone') }}:</b> {{ setting('company.phone') }}</li>
<li class="list-group-item"><b>{{ trans('general.email') }}:</b> {{ setting('company.email') }}</li>
</div>
</div>
<div class="col-md-6">
<div class="card list-group">
<li class="list-group-item list-group-item-action active">
<b>{{ trans('general.to') }}:</b> {{ $payment->contact->name }}
</li>
<li class="list-group-item"><b>{{ trans('general.address') }}:</b> {{ $payment->contact->address }}</li>
<li class="list-group-item"><b>{{ trans('general.phone') }}:</b> {{ $payment->contact->phone }}</li>
<li class="list-group-item"><b>{{ trans('general.email') }}:</b> {{ $payment->contact->email }}</li>
</div>
</div>
<div class="col-md-6">
@if ($payment->description)
<p class="form-control-label">{{ trans('general.description') }}</p>
<p class="text-muted long-texts">{{ $payment->description }}</p>
@endif
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header border-bottom-0">
<div class="row align-items-center">
<div class="col-12 text-nowrap">
<h4 class="mb-0">{{ trans_choice('general.payments', 1) }}</h4>
</div>
</div>
</div>
<div class="table-responsive">
<table class="table table-flush table-hover">
<thead class="thead-light">
<tr class="row table-head-line">
<th class="col-xs-4 col-sm-2 text-right">{{ trans('general.amount') }}</th>
<th class="col-xs-4 col-sm-3 text-left">{{ trans_choice('general.payment_methods', 1) }}</th>
<th class="col-xs-4 col-sm-7 text-left long-texts">{{ trans('general.description') }}</th>
</tr>
</thead>
<tbody>
<tr class="row border-top-1 tr-py">
<td class="col-xs-4 col-sm-2 text-right">@money($payment->amount, $payment->currency_code, true)</td>
<td class="col-xs-4 col-sm-3 text-left">{{ $payment_methods[$payment->payment_method] }}</td>
<td class="col-xs-4 col-sm-7 text-left long-texts">{{ $payment->description }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
@if ($payment->attachment)
<div class="card-footer">
<div class="row float-right">
<div class="col-md-12">
@if (1)
<div class="card mb-0">
<div class="card-body">
<div class="row align-items-center">
<div class="col-auto">
<i class="far fa-file-pdf display-3"></i>
</div>
<div class="col-auto">
<a class="btn btn-sm btn-icon btn-white" type="button">
<span class="btn-inner--icon">
<i class="fas fa-paperclip"></i>
{{ basename($payment->attachment) }}
</span>
</a>
<a class="btn btn-sm btn-icon btn-info text-white float-right" type="button">
<span class="btn-inner--icon">
<i class="fas fa-file-download"></i>
{{ basename($payment->attachment) }}
</span>
</a>
</div>
</div>
</div>
</div>
@else
<div class="card mb-0">
<div class="card-body">
<div class="row align-items-center">
<div class="col-auto">
@if($payment->attachment)
<img src="public/img/invoice_templates/classic.png" alt="Attachment">
@else
<i class="far fa-file-image display-3"></i>
@endif
</div>
<div class="col-auto">
<a class="btn btn-sm btn-icon btn-white" type="button">
<span class="btn-inner--icon">
<i class="fas fa-camera"></i>
{{ basename($payment->attachment) }}
</span>
</a>
<a class="btn btn-sm btn-icon btn-info text-white float-right" type="button">
<span class="btn-inner--icon">
<i class="fas fa-file-download"></i>
{{ basename($payment->attachment) }}
</span>
</a>
</div>
</div>
</div>
</div>
@endif
</div>
</div>
</div>
@endif
</div>
@stack('button_pdf_start')
<a href="{{ route('portal.payments.pdf', $payment->id) }}" class="btn btn-white btn-sm">
{{ trans('general.download') }}
</a>
@stack('button_pdf_end')
@endsection
@push('scripts_start')
@section('content')
<x-transactions.show.header
type="payment"
:transaction="$payment"
hide-header-contact
class-header-status="col-md-8"
/>
<x-transactions.show.transaction
type="payment"
:transaction="$payment"
transaction-template="{{ setting('payment.template', 'default') }}"
hide-payment-methods
/>
@endsection
@push('footer_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
<script src="{{ asset('public/js/portal/payments.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -0,0 +1,46 @@
@extends('layouts.signed')
@section('title', trans_choice('general.payments', 1) . ': ' . @date($payment->paid_at))
@section('new_button')
@stack('button_print_start')
<a href="{{ $print_action }}" target="_blank" class="btn btn-white btn-sm">
{{ trans('general.print') }}
</a>
@stack('button_print_end')
@stack('button_pdf_start')
<a href="{{ $pdf_action }}" class="btn btn-white btn-sm">
{{ trans('general.download') }}
</a>
@stack('button_pdf_end')
@stack('button_dashboard_start')
@if (!user())
<a href="{{ route('portal.dashboard') }}" class="btn btn-white btn-sm">
{{ trans('payments.all_payments') }}
</a>
@endif
@stack('button_dashboard_end')
@endsection
@section('content')
<x-transactions.show.header
type="payment"
:transaction="$payment"
hide-header-contact
class-header-status="col-md-8"
/>
<x-transactions.show.transaction
type="payment"
:transaction="$payment"
transaction-template="{{ setting('payment.template', 'default') }}"
hide-payment-methods
/>
@endsection
@push('footer_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
<script src="{{ asset('public/js/portal/payments.js?v=' . version('short')) }}"></script>
@endpush

View File

@ -49,7 +49,7 @@
@if ($item->reconciled)
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1"><a class="col-aka" href="#">@date($item->paid_at)</a></td>
@else
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1"><a class="col-aka" href="{{ route('payments.edit', $item->id) }}">@date($item->paid_at)</a></td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1"><a class="col-aka" href="{{ route('payments.show', $item->id) }}">@date($item->paid_at)</a></td>
@endif
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-3 col-xl-3 d-none d-md-block text-left">
@ -85,16 +85,20 @@
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="{{ route('payments.show', $item->id) }}">{{ trans('general.show') }}</a>
@if (!$item->reconciled)
<a class="dropdown-item" href="{{ route('payments.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@endif
@if (empty($item->document_id))
@can('create-purchases-payments')
<a class="dropdown-item" href="{{ route('payments.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
<div class="dropdown-divider"></div>
@endcan
@endif
@if (!$item->reconciled)
@can('delete-purchases-payments')
{!! Form::deleteLink($item, 'payments.destroy') !!}

View File

@ -0,0 +1,17 @@
@extends('layouts.admin')
@section('title', trans('payments.payment_made'))
@section('new_button')
<x-transactions.show.top-buttons type="expense" :transaction="$payment" hide-button-share hide-button-email />
@endsection
@section('content')
<x-transactions.show.content type="expense" :transaction="$payment" />
@endsection
@push('scripts_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
<x-transactions.script type="expense" />
@endpush

View File

@ -49,7 +49,7 @@
@if ($item->reconciled)
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1"><a class="col-aka" href="#">@date($item->paid_at)</a></td>
@else
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1"><a class="col-aka" href="{{ route('revenues.edit', $item->id) }}">@date($item->paid_at)</a></td>
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-1 col-xl-1"><a class="col-aka" href="{{ route('revenues.show', $item->id) }}">@date($item->paid_at)</a></td>
@endif
<td class="col-xs-4 col-sm-4 col-md-3 col-lg-2 col-xl-2 text-right">@money($item->amount, $item->currency_code, true)</td>
<td class="col-md-2 col-lg-3 col-xl-3 d-none d-md-block text-left">
@ -85,16 +85,20 @@
<i class="fa fa-ellipsis-h text-muted"></i>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-menu-arrow">
<a class="dropdown-item" href="{{ route('revenues.show', $item->id) }}">{{ trans('general.show') }}</a>
@if (!$item->reconciled)
<a class="dropdown-item" href="{{ route('revenues.edit', $item->id) }}">{{ trans('general.edit') }}</a>
<div class="dropdown-divider"></div>
@endif
@if (empty($item->document_id))
@can('create-sales-revenues')
<a class="dropdown-item" href="{{ route('revenues.duplicate', $item->id) }}">{{ trans('general.duplicate') }}</a>
<div class="dropdown-divider"></div>
@endcan
@endif
@if (!$item->reconciled)
@can('delete-sales-revenues')
{!! Form::deleteLink($item, 'revenues.destroy') !!}

View File

@ -0,0 +1,10 @@
@extends('layouts.print')
@section('title', trans_choice('general.revenues', 1) . ': ' . $revenue->id)
@section('content')
<x-transactions.template.ddefault
type="revenue"
:transaction="$revenue"
/>
@endsection

View File

@ -0,0 +1,17 @@
@extends('layouts.admin')
@section('title', trans('revenues.revenue_received'))
@section('new_button')
<x-transactions.show.top-buttons type="income" :transaction="$revenue" />
@endsection
@section('content')
<x-transactions.show.content type="income" :transaction="$revenue" />
@endsection
@push('scripts_start')
<link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
<x-transactions.script type="income" />
@endpush

View File

@ -81,6 +81,9 @@ Route::group(['prefix' => 'sales'], function () {
Route::get('invoices/export', 'Sales\Invoices@export')->name('invoices.export');
Route::resource('invoices', 'Sales\Invoices', ['middleware' => ['date.format', 'money', 'dropzone']]);
Route::get('revenues/{revenue}/email', 'Sales\Revenues@emailRevenue')->name('revenues.email');
Route::get('revenues/{revenue}/print', 'Sales\Revenues@printRevenue')->name('revenues.print');
Route::get('revenues/{revenue}/pdf', 'Sales\Revenues@pdfRevenue')->name('revenues.pdf');
Route::get('revenues/{revenue}/duplicate', 'Sales\Revenues@duplicate')->name('revenues.duplicate');
Route::post('revenues/import', 'Sales\Revenues@import')->name('revenues.import');
Route::get('revenues/export', 'Sales\Revenues@export')->name('revenues.export');
@ -108,6 +111,9 @@ Route::group(['prefix' => 'purchases'], function () {
Route::get('bills/export', 'Purchases\Bills@export')->name('bills.export');
Route::resource('bills', 'Purchases\Bills', ['middleware' => ['date.format', 'money', 'dropzone']]);
Route::get('payments/{payment}/email', 'Purchases\Payments@emailPayment')->name('payments.email');
Route::get('payments/{payment}/print', 'Purchases\Payments@printPayment')->name('payments.print');
Route::get('payments/{payment}/pdf', 'Purchases\Payments@pdfPayment')->name('payments.pdf');
Route::get('payments/{payment}/duplicate', 'Purchases\Payments@duplicate')->name('payments.duplicate');
Route::post('payments/import', 'Purchases\Payments@import')->name('payments.import');
Route::get('payments/export', 'Purchases\Payments@export')->name('payments.export');

View File

@ -17,6 +17,8 @@ Route::group(['as' => 'portal.'], function () {
Route::resource('invoices', 'Portal\Invoices');
Route::get('payments/currencies', 'Portal\Payments@currencies')->name('payment.currencies');
Route::get('payments/{payment}/print', 'Portal\Payments@printPayment')->name('payments.print');
Route::get('payments/{payment}/pdf', 'Portal\Payments@pdfPayment')->name('payments.pdf');
Route::resource('payments', 'Portal\Payments');
Route::get('profile/read-invoices', 'Portal\Profile@readOverdueInvoices')->name('invoices.read');

View File

@ -14,3 +14,7 @@ Route::get('invoices/{invoice}/print', 'Portal\Invoices@printInvoice')->name('si
Route::get('invoices/{invoice}/pdf', 'Portal\Invoices@pdfInvoice')->name('signed.invoices.pdf');
Route::post('invoices/{invoice}/payment', 'Portal\Invoices@payment')->name('signed.invoices.payment');
Route::post('invoices/{invoice}/confirm', 'Portal\Invoices@confirm')->name('signed.invoices.confirm');
Route::get('payments/{payment}', 'Portal\Payments@signed')->name('signed.payments.show');
Route::get('payments/{payment}/print', 'Portal\Payments@printInvoice')->name('signed.payments.print');
Route::get('payments/{payment}/pdf', 'Portal\Payments@pdfInvoice')->name('signed.payments.pdf');