transaction show page file updated..
This commit is contained in:
		
							
								
								
									
										175
									
								
								app/Abstracts/View/Components/Transaction.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										175
									
								
								app/Abstracts/View/Components/Transaction.php
									
									
									
									
									
										Normal 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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										899
									
								
								app/Abstracts/View/Components/TransactionShow.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										899
									
								
								app/Abstracts/View/Components/TransactionShow.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,899 @@
 | 
			
		||||
<?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 Illuminate\Support\Facades\URL;
 | 
			
		||||
use Illuminate\Support\Str;
 | 
			
		||||
use Image;
 | 
			
		||||
use Intervention\Image\Exception\NotReadableException;
 | 
			
		||||
use Illuminate\Support\Facades\Storage;
 | 
			
		||||
 | 
			
		||||
abstract class TransactionShow extends Base
 | 
			
		||||
{
 | 
			
		||||
    use DateTime, Transactions;
 | 
			
		||||
 | 
			
		||||
    public $type;
 | 
			
		||||
 | 
			
		||||
    public $transaction;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $transactionTemplate;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $logo;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $signedUrl;
 | 
			
		||||
 | 
			
		||||
    public $histories;
 | 
			
		||||
 | 
			
		||||
    public $date_format;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textHistories;
 | 
			
		||||
 | 
			
		||||
    /** @var array */
 | 
			
		||||
    public $payment_methods;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $checkButtonReconciled;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $routeButtonAddNew;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $routeButtonEdit;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $routeButtonDuplicate;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $routeButtonPrint;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $routeButtonPdf;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $routeButtonDelete;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $routeButtonEmail;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $permissionCreate;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $permissionUpdate;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $permissionDelete;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonGroupDivider1;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonGroupDivider2;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonGroupDivider3;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonMoreActions;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonAddNew;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonEdit;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonDuplicate;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonPrint;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonPdf;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonDelete;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideHeader;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideFooter;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideFooterHistories;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonEmail;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideButtonShare;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textHeaderAccount;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textHeaderCategory;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textHeaderContact;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textHeaderAmount;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textHeaderPaidAt;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideHeaderAccount;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideHeaderCategory;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $classHeaderCategory;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $classHeaderContact;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $classHeaderAmount;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $classHeaderPaidAt;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $classHeaderAccount;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $classFooterHistories;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideHeaderContact;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideHeaderAmount;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideHeaderPaidAt;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyLogo;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyDetails;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideCompanyName;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyAddress;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyTaxNumber;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyPhone;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyEmail;
 | 
			
		||||
 | 
			
		||||
    public $hideContactInfo;
 | 
			
		||||
 | 
			
		||||
    public $hideContactName;
 | 
			
		||||
 | 
			
		||||
    public $hideContactAddress;
 | 
			
		||||
 | 
			
		||||
    public $hideContactTaxNumber;
 | 
			
		||||
 | 
			
		||||
    public $hideContactPhone;
 | 
			
		||||
 | 
			
		||||
    public $hideContactEmail;
 | 
			
		||||
 | 
			
		||||
    public $hideIssuedAt;
 | 
			
		||||
 | 
			
		||||
    public $hideDueAt;
 | 
			
		||||
 | 
			
		||||
    public $textContactInfo;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textIssuedAt;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textDueAt;
 | 
			
		||||
 | 
			
		||||
    public $hideName;
 | 
			
		||||
 | 
			
		||||
    public $hideDescription;
 | 
			
		||||
 | 
			
		||||
    public $hideAmount;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textAmount;
 | 
			
		||||
 | 
			
		||||
    /** @var bool */
 | 
			
		||||
    public $hideAttachment;
 | 
			
		||||
 | 
			
		||||
    public $attachment;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textDeleteModal;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Create a new component instance.
 | 
			
		||||
     *
 | 
			
		||||
     * @return void
 | 
			
		||||
     */
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        $type, $transaction, $transactionTemplate = '', $logo = '', string $signedUrl = '', $histories = [], string $textHistories = '',
 | 
			
		||||
        string $routeButtonAddNew = '', string $routeButtonEdit = '', string $routeButtonDuplicate = '', string $routeButtonPrint = '', string $routeButtonPdf = '', string $routeButtonDelete = '', string $routeButtonEmail = '',
 | 
			
		||||
        string $permissionCreate = '', string $permissionUpdate = '', string $permissionDelete = '',
 | 
			
		||||
        bool $checkButtonReconciled = true, array $payment_methods = [],
 | 
			
		||||
        bool $hideButtonGroupDivider1 = false, bool $hideButtonGroupDivider2 = false, bool $hideButtonGroupDivider3 = false,
 | 
			
		||||
        bool $hideButtonMoreActions = false, bool $hideButtonAddNew = false, bool $hideButtonEdit = false, bool $hideButtonDuplicate = false, bool $hideButtonPrint = false, bool $hideButtonPdf = false, bool $hideButtonDelete = false,
 | 
			
		||||
        bool $hideHeader = false, bool $hideFooter = false, bool $hideFooterHistories = false,
 | 
			
		||||
        bool $hideButtonEmail = false, bool $hideButtonShare = false,
 | 
			
		||||
        string $textHeaderAccount = '', string $textHeaderCategory = '', string $textHeaderContact = '', string $textHeaderAmount = '', string $textHeaderPaidAt = '',
 | 
			
		||||
        string $classHeaderAccount = '', string $classHeaderCategory = '', string $classHeaderContact = '', string $classHeaderAmount = '', string $classHeaderPaidAt = '', string $classFooterHistories = '',
 | 
			
		||||
        bool $hideHeaderAccount = false, bool $hideHeaderCategory = false, bool $hideHeaderContact = false, bool $hideHeaderAmount = false, bool $hideHeaderPaidAt = false,
 | 
			
		||||
        bool $hideTimelineCreate = false, bool $hideCompanyLogo = false, bool $hideCompanyDetails = false,
 | 
			
		||||
        bool $hideCompanyName = false, bool $hideCompanyAddress = false, bool $hideCompanyTaxNumber = false, bool $hideCompanyPhone = false, bool $hideCompanyEmail = false, bool $hideContactInfo = false,
 | 
			
		||||
        bool $hideContactName = false, bool $hideContactAddress = false, bool $hideContactTaxNumber = false, bool $hideContactPhone = false, bool $hideContactEmail = false,
 | 
			
		||||
        bool $hideOrderNumber = false, bool $hidetransactionNumber = false, bool $hideIssuedAt = false, bool $hideDueAt = false,
 | 
			
		||||
        string $textContactInfo = '', string $textIssuedAt = '', string $textDueAt = '',
 | 
			
		||||
        bool $hideName = false, bool $hideDescription = false, bool $hideAmount = false, bool $hideAttachment = false,
 | 
			
		||||
        string $textAmount = '', $attachment = [],
 | 
			
		||||
        string $textDeleteModal = ''
 | 
			
		||||
    ) {
 | 
			
		||||
        $this->type = $type;
 | 
			
		||||
        $this->transaction = $transaction;
 | 
			
		||||
        $this->transactionTemplate = $this->getTransactionTemplate($type, $transactionTemplate);
 | 
			
		||||
        $this->logo = $this->getLogo($logo);
 | 
			
		||||
        $this->signedUrl = $this->getSignedUrl($type, $signedUrl);
 | 
			
		||||
 | 
			
		||||
        $this->histories = $this->getHistories($histories);
 | 
			
		||||
 | 
			
		||||
        $this->date_format = $this->getCompanyDateFormat();
 | 
			
		||||
 | 
			
		||||
        $this->textHistories = $this->getTextHistories($type, $textHistories);
 | 
			
		||||
 | 
			
		||||
        $this->checkButtonReconciled = $checkButtonReconciled;
 | 
			
		||||
 | 
			
		||||
        $this->payment_methods = ($payment_methods) ?: Modules::getPaymentMethods();
 | 
			
		||||
 | 
			
		||||
        $this->routeButtonAddNew = $this->getRouteButtonAddNew($type, $routeButtonAddNew);
 | 
			
		||||
        $this->routeButtonEdit = $this->getRouteButtonEdit($type, $routeButtonEdit);
 | 
			
		||||
        $this->routeButtonDuplicate = $this->getRouteButtonDuplicate($type, $routeButtonDuplicate);
 | 
			
		||||
        $this->routeButtonPrint = $this->getRouteButtonPrint($type, $routeButtonPrint);
 | 
			
		||||
        $this->routeButtonPdf = $this->getRouteButtonPdf($type, $routeButtonPdf);
 | 
			
		||||
        $this->routeButtonDelete = $this->getRouteButtonDelete($type, $routeButtonDelete);
 | 
			
		||||
 | 
			
		||||
        $this->permissionCreate = $this->getPermissionCreate($type, $permissionCreate);
 | 
			
		||||
        $this->permissionUpdate = $this->getPermissionUpdate($type, $permissionUpdate);
 | 
			
		||||
        $this->permissionDelete = $this->getPermissionDelete($type, $permissionDelete);
 | 
			
		||||
 | 
			
		||||
        $this->hideButtonGroupDivider1 = $hideButtonGroupDivider1;
 | 
			
		||||
        $this->hideButtonGroupDivider2 = $hideButtonGroupDivider2;
 | 
			
		||||
        $this->hideButtonGroupDivider3 = $hideButtonGroupDivider3;
 | 
			
		||||
 | 
			
		||||
        $this->hideButtonMoreActions = $hideButtonMoreActions;
 | 
			
		||||
        $this->hideButtonAddNew = $hideButtonAddNew;
 | 
			
		||||
        $this->hideButtonEdit = $hideButtonEdit;
 | 
			
		||||
        $this->hideButtonDuplicate  = $hideButtonDuplicate;
 | 
			
		||||
        $this->hideButtonPrint  = $hideButtonPrint;
 | 
			
		||||
        $this->hideButtonPdf  = $hideButtonPdf;
 | 
			
		||||
        $this->hideButtonDelete = $hideButtonDelete;
 | 
			
		||||
 | 
			
		||||
        $this->hideHeader = $hideHeader;
 | 
			
		||||
        $this->hideFooter = $hideFooter;
 | 
			
		||||
        $this->hideFooterHistories = $hideFooterHistories;
 | 
			
		||||
 | 
			
		||||
        $this->classHeaderAccount = $this->getclassHeaderAccount($type, $classHeaderAccount);
 | 
			
		||||
        $this->classHeaderContact = $this->getClassHeaderContact($type, $classHeaderContact);
 | 
			
		||||
        $this->classHeaderCategory = $this->getClassHeaderCategory($type, $classHeaderCategory);
 | 
			
		||||
        $this->classHeaderAmount = $this->getClassHeaderAmount($type, $classHeaderAmount);
 | 
			
		||||
        $this->classHeaderPaidAt = $this->getclassHeaderPaidAt($type, $classHeaderPaidAt);
 | 
			
		||||
 | 
			
		||||
        $this->classFooterHistories = $this->getClassFooterHistories($type, $classFooterHistories);
 | 
			
		||||
 | 
			
		||||
        $this->hideHeaderAccount = $hideHeaderAccount;
 | 
			
		||||
        $this->hideHeaderCategory = $hideHeaderCategory;
 | 
			
		||||
        $this->hideHeaderContact = $hideHeaderContact;
 | 
			
		||||
        $this->hideHeaderCategory = $hideHeaderCategory;
 | 
			
		||||
        $this->hideHeaderAmount = $hideHeaderAmount;
 | 
			
		||||
        $this->hideHeaderPaidAt = $hideHeaderPaidAt;
 | 
			
		||||
 | 
			
		||||
        $this->textHeaderAccount = $this->getTextHeaderAccount($type, $textHeaderAccount);
 | 
			
		||||
        $this->textHeaderCategory = $this->getTextHeaderCategory($type, $textHeaderCategory);
 | 
			
		||||
        $this->textHeaderContact = $this->getTextHeaderContact($type, $textHeaderContact);
 | 
			
		||||
        $this->textHeaderAmount = $this->getTextHeaderAmount($type, $textHeaderAmount);
 | 
			
		||||
        $this->textHeaderPaidAt = $this->gettextHeaderPaidAt($type, $textHeaderPaidAt);
 | 
			
		||||
 | 
			
		||||
        $this->hideTimelineCreate = $hideTimelineCreate;
 | 
			
		||||
        $this->hideButtonEmail = $hideButtonEmail;
 | 
			
		||||
        $this->hideButtonShare = $hideButtonShare;
 | 
			
		||||
 | 
			
		||||
        $this->routeButtonEmail = $this->getRouteButtonEmail($type, $routeButtonEmail);
 | 
			
		||||
 | 
			
		||||
        $this->hideCompanyDetails = $hideCompanyDetails;
 | 
			
		||||
        $this->hideCompanyLogo = $hideCompanyLogo;
 | 
			
		||||
        $this->hideCompanyName = $hideCompanyName;
 | 
			
		||||
        $this->hideContactAddress = $hideContactAddress;
 | 
			
		||||
        $this->hideContactTaxNumber = $hideContactTaxNumber;
 | 
			
		||||
        $this->hideContactPhone = $hideContactPhone;
 | 
			
		||||
        $this->hideContactEmail = $hideContactEmail;
 | 
			
		||||
        $this->hideIssuedAt = $hideIssuedAt;
 | 
			
		||||
        $this->hideDueAt = $hideDueAt;
 | 
			
		||||
 | 
			
		||||
        $this->textContactInfo = $textContactInfo;
 | 
			
		||||
        $this->textIssuedAt = $textIssuedAt;
 | 
			
		||||
        $this->textDueAt = $textDueAt;
 | 
			
		||||
 | 
			
		||||
        $this->hideName = $this->getHideName($type, $hideName);
 | 
			
		||||
        $this->hideDescription = $this->getHideDescription($type, $hideDescription);
 | 
			
		||||
        $this->hideAmount = $this->getHideAmount($type, $hideAmount);
 | 
			
		||||
        $this->hideAttachment = $hideAttachment;
 | 
			
		||||
 | 
			
		||||
        $this->attachment = '';
 | 
			
		||||
 | 
			
		||||
        if (!empty($attachment)) {
 | 
			
		||||
            $this->attachment = $attachment;
 | 
			
		||||
        } else if (!empty($transaction)) {
 | 
			
		||||
            $this->attachment = $transaction->attachment;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $this->textAmount = $textAmount;
 | 
			
		||||
 | 
			
		||||
        $this->textDeleteModal = $textDeleteModal;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTransactionTemplate($type, $transactionTemplate)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($transactionTemplate)) {
 | 
			
		||||
            return $transactionTemplate;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($template = config('type.' . $type . 'template', false)) {
 | 
			
		||||
            return $template;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!empty($alias = config('type.' . $type . '.alias'))) {
 | 
			
		||||
            $type = $alias . '.' . str_replace('-', '_', $type);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $transactionTemplate = setting($this->getSettingKey($type, 'template')) ?: 'default';
 | 
			
		||||
 | 
			
		||||
        return $transactionTemplate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    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 getHistories($histories)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($histories)) {
 | 
			
		||||
            return $histories;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $histories[] = $this->transaction;
 | 
			
		||||
 | 
			
		||||
        return $histories;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getSignedUrl($type, $signedUrl)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($signedUrl)) {
 | 
			
		||||
            return $signedUrl;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $page = config('type.' . $type . '.route.prefix');
 | 
			
		||||
        $alias = config('type.' . $type . '.alias');
 | 
			
		||||
 | 
			
		||||
        $route = '';
 | 
			
		||||
 | 
			
		||||
        if (!empty($alias)) {
 | 
			
		||||
            $route .= $alias . '.';
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $route .= 'signed.' . $page . '.show';
 | 
			
		||||
 | 
			
		||||
        try {
 | 
			
		||||
            route($route, [$this->transaction->id, 'company_id' => company_id()]);
 | 
			
		||||
 | 
			
		||||
            $signedUrl = URL::signedRoute($route, [$this->transaction->id]);
 | 
			
		||||
        } catch (\Exception $e) {
 | 
			
		||||
            $signedUrl = URL::signedRoute('signed.payments.show', [$this->transaction->id]);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return $signedUrl;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextHistories($type, $textHistories)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textHistories)) {
 | 
			
		||||
            return $textHistories;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'histories', 'histories');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'invoices.histories';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getRouteButtonAddNew($type, $routeButtonAddNew)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($routeButtonAddNew)) {
 | 
			
		||||
            return $routeButtonAddNew;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $route = $this->getRouteFromConfig($type, 'create');
 | 
			
		||||
 | 
			
		||||
        if (!empty($route)) {
 | 
			
		||||
            return $route;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'revenues.create';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getRouteButtonEdit($type, $routeButtonEdit)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($routeButtonEdit)) {
 | 
			
		||||
            return $routeButtonEdit;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //example route parameter.
 | 
			
		||||
        $parameter = 1;
 | 
			
		||||
 | 
			
		||||
        $route = $this->getRouteFromConfig($type, 'edit', $parameter);
 | 
			
		||||
 | 
			
		||||
        if (!empty($route)) {
 | 
			
		||||
            return $route;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'revenues.edit';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getRouteButtonDuplicate($type, $routeButtonDuplicate)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($routeButtonDuplicate)) {
 | 
			
		||||
            return $routeButtonDuplicate;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //example route parameter.
 | 
			
		||||
        $parameter = 1;
 | 
			
		||||
 | 
			
		||||
        $route = $this->getRouteFromConfig($type, 'duplicate', $parameter);
 | 
			
		||||
 | 
			
		||||
        if (!empty($route)) {
 | 
			
		||||
            return $route;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'revenues.duplicate';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getRouteButtonPrint($type, $routeButtonPrint)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($routeButtonPrint)) {
 | 
			
		||||
            return $routeButtonPrint;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //example route parameter.
 | 
			
		||||
        $parameter = 1;
 | 
			
		||||
 | 
			
		||||
        $route = $this->getRouteFromConfig($type, 'print', $parameter);
 | 
			
		||||
 | 
			
		||||
        if (!empty($route)) {
 | 
			
		||||
            return $route;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'revenues.print';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getRouteButtonPdf($type, $routeButtonPdf)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($routeButtonPdf)) {
 | 
			
		||||
            return $routeButtonPdf;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //example route parameter.
 | 
			
		||||
        $parameter = 1;
 | 
			
		||||
 | 
			
		||||
        $route = $this->getRouteFromConfig($type, 'pdf', $parameter);
 | 
			
		||||
 | 
			
		||||
        if (!empty($route)) {
 | 
			
		||||
            return $route;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'revenues.pdf';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getRouteButtonDelete($type, $routeButtonDelete)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($routeButtonDelete)) {
 | 
			
		||||
            return $routeButtonDelete;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //example route parameter.
 | 
			
		||||
        $parameter = 1;
 | 
			
		||||
 | 
			
		||||
        $route = $this->getRouteFromConfig($type, 'destroy', $parameter);
 | 
			
		||||
 | 
			
		||||
        if (!empty($route)) {
 | 
			
		||||
            return $route;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'revenues.destroy';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getRouteButtonEmail($type, $routeButtonEmail)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($routeButtonEmail)) {
 | 
			
		||||
            return $routeButtonEmail;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        //example route parameter.
 | 
			
		||||
        $parameter = 1;
 | 
			
		||||
 | 
			
		||||
        $route = $this->getRouteFromConfig($type, 'email', $parameter);
 | 
			
		||||
 | 
			
		||||
        if (!empty($route)) {
 | 
			
		||||
            return $route;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'revenues.email';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getPermissionCreate($type, $permissionCreate)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($permissionCreate)) {
 | 
			
		||||
            return $permissionCreate;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $permissionCreate = $this->getPermissionFromConfig($type, 'create');
 | 
			
		||||
 | 
			
		||||
        return $permissionCreate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getPermissionUpdate($type, $permissionUpdate)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($permissionUpdate)) {
 | 
			
		||||
            return $permissionUpdate;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $permissionUpdate = $this->getPermissionFromConfig($type, 'update');
 | 
			
		||||
 | 
			
		||||
        return $permissionUpdate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getPermissionDelete($type, $permissionDelete)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($permissionDelete)) {
 | 
			
		||||
            return $permissionDelete;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $permissionDelete = $this->getPermissionFromConfig($type, 'delete');
 | 
			
		||||
 | 
			
		||||
        return $permissionDelete;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextHeaderAccount($type, $textHeaderAccount)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textHeaderAccount)) {
 | 
			
		||||
            return $textHeaderAccount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $default_key = Str::plural(config('type.' . $type . '.contact_type'), 2);
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'header_contact', $default_key, 'trans_choice');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'general.customers';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextHeaderCategory($type, $textHeaderCategory)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textHeaderCategory)) {
 | 
			
		||||
            return $textHeaderCategory;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $default_key = Str::plural(config('type.' . $type . '.contact_type'), 2);
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'header_contact', $default_key, 'trans_choice');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'general.customers';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextHeaderContact($type, $textHeaderContact)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textHeaderContact)) {
 | 
			
		||||
            return $textHeaderContact;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $default_key = Str::plural(config('type.' . $type . '.contact_type'), 2);
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'header_contact', $default_key, 'trans_choice');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'general.customers';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextHeaderAmount($type, $textHeaderAmount)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textHeaderAmount)) {
 | 
			
		||||
            return $textHeaderAmount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'header_amount', 'amount_due');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'general.amount_due';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function gettextHeaderPaidAt($type, $textHeaderPaidAt)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textHeaderPaidAt)) {
 | 
			
		||||
            return $textHeaderPaidAt;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'header_due_at', 'due_on');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'general.due_on';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getclassHeaderAccount($type, $classHeaderAccount)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($classHeaderAccount)) {
 | 
			
		||||
            return $classHeaderAccount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $class = $this->getClassFromConfig($type, 'header_status');
 | 
			
		||||
 | 
			
		||||
        if (!empty($class)) {
 | 
			
		||||
            return $class;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'col-md-2';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getClassHeaderContact($type, $classHeaderContact)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($classHeaderContact)) {
 | 
			
		||||
            return $classHeaderContact;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $class = $this->getClassFromConfig($type, 'header_contact');
 | 
			
		||||
 | 
			
		||||
        if (!empty($class)) {
 | 
			
		||||
            return $class;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'col-md-3';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getClassHeaderCategory($type, $classHeaderCategory)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($classHeaderCategory)) {
 | 
			
		||||
            return $classHeaderCategory;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $class = $this->getClassFromConfig($type, 'header_contact');
 | 
			
		||||
 | 
			
		||||
        if (!empty($class)) {
 | 
			
		||||
            return $class;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'col-md-3';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getClassHeaderAmount($type, $classHeaderAmount)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($classHeaderAmount)) {
 | 
			
		||||
            return $classHeaderAmount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $class = $this->getClassFromConfig($type, 'header_amount');
 | 
			
		||||
 | 
			
		||||
        if (!empty($class)) {
 | 
			
		||||
            return $class;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'col-md-2';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getclassHeaderAccountAt($type, $classHeaderAccountAt)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($classHeaderPaidAt)) {
 | 
			
		||||
            return $classHeaderPaidAt;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $class = $this->getClassFromConfig($type, 'header_paid_at');
 | 
			
		||||
 | 
			
		||||
        if (!empty($class)) {
 | 
			
		||||
            return $class;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'col-md-2';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getclassHeaderPaidAt($type, $classHeaderPaidAt)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($classHeaderPaidAt)) {
 | 
			
		||||
            return $classHeaderPaidAt;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $class = $this->getClassFromConfig($type, 'header_due_at');
 | 
			
		||||
 | 
			
		||||
        if (!empty($class)) {
 | 
			
		||||
            return $class;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'col-md-2';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getClassFooterHistories($type, $classFooterHistories)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($classFooterHistories)) {
 | 
			
		||||
            return $classFooterHistories;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $class = $this->getClassFromConfig($type, 'footer_histories');
 | 
			
		||||
 | 
			
		||||
        if (!empty($class)) {
 | 
			
		||||
            return $class;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'col-sm-6 col-md-6 col-lg-6 col-xl-6';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getClassFooterTransactions($type, $classFooterTransactions)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($classFooterTransactions)) {
 | 
			
		||||
            return $classFooterTransactions;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $class = $this->getClassFromConfig($type, 'footer_transactions');
 | 
			
		||||
 | 
			
		||||
        if (!empty($class)) {
 | 
			
		||||
            return $class;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'col-sm-6 col-md-6 col-lg-6 col-xl-6';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideName($type, $hideName)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideName)) {
 | 
			
		||||
            return $hideName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hideName = setting($this->getSettingKey($type, 'hide_item_name'), false)) {
 | 
			
		||||
            return $hideName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'name');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_item_name', $hideName);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideDescription($type, $hideDescription)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideDescription)) {
 | 
			
		||||
            return $hideDescription;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hideDescription = setting($this->getSettingKey($type, 'hide_item_description'), false)) {
 | 
			
		||||
            return $hideDescription;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'description');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_item_description', $hideDescription);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideAmount($type, $hideAmount)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideAmount)) {
 | 
			
		||||
            return $hideAmount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hideAmount = setting($this->getSettingKey($type, 'hide_amount'), false)) {
 | 
			
		||||
            return $hideAmount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'amount');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_amount', $hideAmount);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										653
									
								
								app/Abstracts/View/Components/TransactionTemplate.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										653
									
								
								app/Abstracts/View/Components/TransactionTemplate.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,653 @@
 | 
			
		||||
<?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;
 | 
			
		||||
 | 
			
		||||
    public $type;
 | 
			
		||||
 | 
			
		||||
    public $item;
 | 
			
		||||
 | 
			
		||||
    public $transaction;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $transactionTemplate;
 | 
			
		||||
 | 
			
		||||
    public $date_format;
 | 
			
		||||
 | 
			
		||||
    public $logo;
 | 
			
		||||
 | 
			
		||||
    public $backgroundColor;
 | 
			
		||||
 | 
			
		||||
    public $hideFooter;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyLogo;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyDetails;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyName;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyAddress;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyTaxNumber;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyPhone;
 | 
			
		||||
 | 
			
		||||
    public $hideCompanyEmail;
 | 
			
		||||
 | 
			
		||||
    public $hideContactInfo;
 | 
			
		||||
 | 
			
		||||
    public $hideContactName;
 | 
			
		||||
 | 
			
		||||
    public $hideContactAddress;
 | 
			
		||||
 | 
			
		||||
    public $hideContactTaxNumber;
 | 
			
		||||
 | 
			
		||||
    public $hideContactPhone;
 | 
			
		||||
 | 
			
		||||
    public $hideContactEmail;
 | 
			
		||||
 | 
			
		||||
    public $hideOrderNumber;
 | 
			
		||||
 | 
			
		||||
    public $hidetransactionNumber;
 | 
			
		||||
 | 
			
		||||
    public $hideIssuedAt;
 | 
			
		||||
 | 
			
		||||
    public $hideDueAt;
 | 
			
		||||
 | 
			
		||||
    /** @var array */
 | 
			
		||||
    public $payment_methods;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $texttransactionTitle;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $texttransactionSubheading;
 | 
			
		||||
 | 
			
		||||
    public $textContactInfo;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textIssuedAt;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textDueAt;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $texttransactionNumber;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textOrderNumber;
 | 
			
		||||
 | 
			
		||||
    public $hideItems;
 | 
			
		||||
 | 
			
		||||
    public $hideName;
 | 
			
		||||
 | 
			
		||||
    public $hideDescription;
 | 
			
		||||
 | 
			
		||||
    public $hideQuantity;
 | 
			
		||||
 | 
			
		||||
    public $hidePrice;
 | 
			
		||||
 | 
			
		||||
    public $hideDiscount;
 | 
			
		||||
 | 
			
		||||
    public $hideAmount;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textItems;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textQuantity;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textPrice;
 | 
			
		||||
 | 
			
		||||
    /** @var string */
 | 
			
		||||
    public $textAmount;
 | 
			
		||||
 | 
			
		||||
    public $hideNote;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Create a new component instance.
 | 
			
		||||
     *
 | 
			
		||||
     * @return void
 | 
			
		||||
     */
 | 
			
		||||
    public function __construct(
 | 
			
		||||
        $type, $transaction, $item = false,  $transactionTemplate = '', $logo = '', $backgroundColor = '',
 | 
			
		||||
        bool $hideFooter = false, bool $hideCompanyLogo = false, bool $hideCompanyDetails = false, array $payment_methods = [],
 | 
			
		||||
        bool $hideCompanyName = false, bool $hideCompanyAddress = false, bool $hideCompanyTaxNumber = false, bool $hideCompanyPhone = false, bool $hideCompanyEmail = false, bool $hideContactInfo = false,
 | 
			
		||||
        bool $hideContactName = false, bool $hideContactAddress = false, bool $hideContactTaxNumber = false, bool $hideContactPhone = false, bool $hideContactEmail = false,
 | 
			
		||||
        bool $hideOrderNumber = false, bool $hidetransactionNumber = false, bool $hideIssuedAt = false, bool $hideDueAt = false,
 | 
			
		||||
        string $texttransactionTitle = '', string $texttransactionSubheading = '',
 | 
			
		||||
        string $textContactInfo = '', string $texttransactionNumber = '', string $textOrderNumber = '', string $textIssuedAt = '', string $textDueAt = '',
 | 
			
		||||
        bool $hideItems = false, bool $hideName = false, bool $hideDescription = false, bool $hideQuantity = false, bool $hidePrice = false, bool $hideDiscount = false, bool $hideAmount = false, bool $hideNote = false,
 | 
			
		||||
        string $textItems = '', string $textQuantity = '', string $textPrice = '', string $textAmount = ''
 | 
			
		||||
    ) {
 | 
			
		||||
        $this->type = $type;
 | 
			
		||||
        $this->item = $item;
 | 
			
		||||
        $this->transaction = $transaction;
 | 
			
		||||
        $this->transactionTemplate = $this->gettransactionTemplate($type, $transactionTemplate);
 | 
			
		||||
        $this->logo = $this->getLogo($logo);
 | 
			
		||||
        $this->backgroundColor = $this->getBackgroundColor($type, $backgroundColor);
 | 
			
		||||
 | 
			
		||||
        $this->payment_methods = ($payment_methods) ?: Modules::getPaymentMethods();
 | 
			
		||||
 | 
			
		||||
        $this->hideFooter = $hideFooter;
 | 
			
		||||
        $this->hideCompanyLogo = $hideCompanyLogo;
 | 
			
		||||
        $this->hideCompanyDetails = $hideCompanyDetails;
 | 
			
		||||
        $this->hideCompanyName = $hideCompanyName;
 | 
			
		||||
        $this->hideCompanyAddress = $hideCompanyAddress;
 | 
			
		||||
        $this->hideCompanyTaxNumber = $hideCompanyTaxNumber;
 | 
			
		||||
        $this->hideCompanyPhone = $hideCompanyPhone;
 | 
			
		||||
        $this->hideCompanyEmail = $hideCompanyEmail;
 | 
			
		||||
        $this->hideContactInfo = $hideContactInfo;
 | 
			
		||||
        $this->hideContactName = $hideContactName;
 | 
			
		||||
        $this->hideContactAddress = $hideContactAddress;
 | 
			
		||||
        $this->hideContactTaxNumber = $hideContactTaxNumber;
 | 
			
		||||
        $this->hideContactPhone = $hideContactPhone;
 | 
			
		||||
        $this->hideContactEmail = $hideContactEmail;
 | 
			
		||||
        $this->hideOrderNumber = $hideOrderNumber;
 | 
			
		||||
        $this->hidetransactionNumber = $hidetransactionNumber;
 | 
			
		||||
        $this->hideIssuedAt = $hideIssuedAt;
 | 
			
		||||
        $this->hideDueAt = $hideDueAt;
 | 
			
		||||
 | 
			
		||||
        $this->texttransactionTitle = $this->getTexttransactionTitle($type, $texttransactionTitle);
 | 
			
		||||
        $this->texttransactionSubheading = $this->gettexttransactionSubheading($type, $texttransactionSubheading);
 | 
			
		||||
        $this->textContactInfo = $this->getTextContactInfo($type, $textContactInfo);
 | 
			
		||||
        $this->textIssuedAt = $this->getTextIssuedAt($type, $textIssuedAt);
 | 
			
		||||
        $this->texttransactionNumber = $this->getTexttransactionNumber($type, $texttransactionNumber);
 | 
			
		||||
        $this->textDueAt = $this->getTextDueAt($type, $textDueAt);
 | 
			
		||||
        $this->textOrderNumber = $this->getTextOrderNumber($type, $textOrderNumber);
 | 
			
		||||
 | 
			
		||||
        $this->hideItems = $this->getHideItems($type, $hideItems, $hideName, $hideDescription);
 | 
			
		||||
        $this->hideName = $this->getHideName($type, $hideName);
 | 
			
		||||
        $this->hideDescription = $this->getHideDescription($type, $hideDescription);
 | 
			
		||||
        $this->hideQuantity = $this->getHideQuantity($type, $hideQuantity);
 | 
			
		||||
        $this->hidePrice = $this->getHidePrice($type, $hidePrice);
 | 
			
		||||
        $this->hideDiscount = $this->getHideDiscount($type, $hideDiscount);
 | 
			
		||||
        $this->hideAmount = $this->getHideAmount($type, $hideAmount);
 | 
			
		||||
        $this->hideNote = $hideNote;
 | 
			
		||||
 | 
			
		||||
        $this->textItems = $this->getTextItems($type, $textItems);
 | 
			
		||||
        $this->textQuantity = $this->getTextQuantity($type, $textQuantity);
 | 
			
		||||
        $this->textPrice = $this->getTextPrice($type, $textPrice);
 | 
			
		||||
        $this->textAmount = $this->getTextAmount($type, $textAmount);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function gettransactionTemplate($type, $transactionTemplate)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($transactionTemplate)) {
 | 
			
		||||
            return $transactionTemplate;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($template = config('type.' . $type . 'template', false)) {
 | 
			
		||||
            return $template;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $transactionTemplate =  setting($this->getSettingKey($type, 'template'), 'default');
 | 
			
		||||
 | 
			
		||||
        return $transactionTemplate;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    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 getBackgroundColor($type, $backgroundColor)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($backgroundColor)) {
 | 
			
		||||
            return $backgroundColor;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if ($background_color = config('type.' . $type . 'color', false)) {
 | 
			
		||||
            return $background_color;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        if (!empty($alias = config('type.' . $type . '.alias'))) {
 | 
			
		||||
            $type = $alias . '.' . str_replace('-', '_', $type);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $backgroundColor = setting($this->getSettingKey($type, 'color'), '#55588b');
 | 
			
		||||
 | 
			
		||||
        return $backgroundColor;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTexttransactionTitle($type, $texttransactionTitle)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($texttransactionTitle)) {
 | 
			
		||||
            return $texttransactionTitle;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!empty(setting($type . '.title'))) {
 | 
			
		||||
            return setting($type . '.title');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'transaction_title', Str::plural($type));
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return trans_choice($translation, 1);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return setting('invoice.title');
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTexttransactionSubheading($type, $texttransactionSubheading)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($texttransactionSubheading)) {
 | 
			
		||||
            return $texttransactionSubheading;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (!empty(setting($type . '.subheading'))) {
 | 
			
		||||
            return setting($type . '.subheading');
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'transaction_subheading', 'subheading');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return trans($translation);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTexttransactionNumber($type, $texttransactionNumber)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($texttransactionNumber)) {
 | 
			
		||||
            return $texttransactionNumber;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        switch ($type) {
 | 
			
		||||
            case 'bill':
 | 
			
		||||
            case 'expense':
 | 
			
		||||
            case 'purchase':
 | 
			
		||||
                $default_key = 'bill_number';
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                $default_key = 'invoice_number';
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'transaction_number', $default_key);
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'general.numbers';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextOrderNumber($type, $textOrderNumber)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textOrderNumber)) {
 | 
			
		||||
            return $textOrderNumber;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'order_number');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'invoices.order_number';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextContactInfo($type, $textContactInfo)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textContactInfo)) {
 | 
			
		||||
            return $textContactInfo;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        switch ($type) {
 | 
			
		||||
            case 'bill':
 | 
			
		||||
            case 'expense':
 | 
			
		||||
            case 'purchase':
 | 
			
		||||
                $default_key = 'bill_from';
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                $default_key = 'bill_to';
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'contact_info', $default_key);
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'invoices.bill_to';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextIssuedAt($type, $textIssuedAt)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textIssuedAt)) {
 | 
			
		||||
            return $textIssuedAt;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        switch ($type) {
 | 
			
		||||
            case 'bill':
 | 
			
		||||
            case 'expense':
 | 
			
		||||
            case 'purchase':
 | 
			
		||||
                $default_key = 'bill_date';
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                $default_key = 'invoice_date';
 | 
			
		||||
                break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'issued_at', $default_key);
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'invoices.invoice_date';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextDueAt($type, $textDueAt)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textDueAt)) {
 | 
			
		||||
            return $textDueAt;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'due_at', 'due_date');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'invoices.due_date';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextItems($type, $textItems)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textItems)) {
 | 
			
		||||
            return $textItems;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if (setting($this->getSettingKey($type, 'item_name'), 'items') == 'custom') {
 | 
			
		||||
            if (empty($textItems = setting($this->getSettingKey($type, 'item_name_input')))) {
 | 
			
		||||
                $textItems = 'general.items';
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return $textItems;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'items');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'general.items';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextQuantity($type, $textQuantity)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textQuantity)) {
 | 
			
		||||
            return $textQuantity;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if (setting($this->getSettingKey($type, 'quantity_name'), 'quantity') === 'custom') {
 | 
			
		||||
            if (empty($textQuantity = setting($this->getSettingKey($type, 'quantity_name_input')))) {
 | 
			
		||||
                $textQuantity = 'invoices.quantity';
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return $textQuantity;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'quantity');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'invoices.quantity';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextPrice($type, $textPrice)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textPrice)) {
 | 
			
		||||
            return $textPrice;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if (setting($this->getSettingKey($type, 'price_name'), 'price') === 'custom') {
 | 
			
		||||
            if (empty($textPrice = setting($this->getSettingKey($type, 'price_name_input')))) {
 | 
			
		||||
                $textPrice = 'invoices.price';
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return $textPrice;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'price');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'invoices.price';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getTextAmount($type, $textAmount)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($textAmount)) {
 | 
			
		||||
            return $textAmount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $translation = $this->getTextFromConfig($type, 'amount');
 | 
			
		||||
 | 
			
		||||
        if (!empty($translation)) {
 | 
			
		||||
            return $translation;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return 'general.amount';
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideItems($type, $hideItems, $hideName, $hideDescription)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideItems)) {
 | 
			
		||||
            return $hideItems;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'items');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hideItems = ($this->getHideName($type, $hideName) & $this->getHideDescription($type, $hideDescription)) ? true  : false;
 | 
			
		||||
 | 
			
		||||
        return $hideItems;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideName($type, $hideName)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideName)) {
 | 
			
		||||
            return $hideName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hideName = setting($this->getSettingKey($type, 'hide_item_name'), false)) {
 | 
			
		||||
            return $hideName;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'name');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_item_name', $hideName);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideDescription($type, $hideDescription)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideDescription)) {
 | 
			
		||||
            return $hideDescription;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hideDescription = setting($this->getSettingKey($type, 'hide_item_description'), false)) {
 | 
			
		||||
            return $hideDescription;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'description');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_item_description', $hideDescription);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideQuantity($type, $hideQuantity)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideQuantity)) {
 | 
			
		||||
            return $hideQuantity;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hideQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false)) {
 | 
			
		||||
            return $hideQuantity;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'quantity');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_quantity', $hideQuantity);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHidePrice($type, $hidePrice)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hidePrice)) {
 | 
			
		||||
            return $hidePrice;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hidePrice = setting($this->getSettingKey($type, 'hide_price'), false)) {
 | 
			
		||||
            return $hidePrice;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'price');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_price', $hidePrice);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideDiscount($type, $hideDiscount)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideDiscount)) {
 | 
			
		||||
            return $hideDiscount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hideDiscount = setting($this->getSettingKey($type, 'hide_discount'), false)) {
 | 
			
		||||
            return $hideDiscount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'discount');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_discount', $hideDiscount);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    protected function getHideAmount($type, $hideAmount)
 | 
			
		||||
    {
 | 
			
		||||
        if (!empty($hideAmount)) {
 | 
			
		||||
            return $hideAmount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // if you use settting translation
 | 
			
		||||
        if ($hideAmount = setting($this->getSettingKey($type, 'hide_amount'), false)) {
 | 
			
		||||
            return $hideAmount;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        $hide = $this->getHideFromConfig($type, 'amount');
 | 
			
		||||
 | 
			
		||||
        if ($hide) {
 | 
			
		||||
            return $hide;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // @todo what return value invoice or always false??
 | 
			
		||||
        return setting('invoice.hide_amount', $hideAmount);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										22
									
								
								app/Events/Transaction/TransactionPrinting.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								app/Events/Transaction/TransactionPrinting.php
									
									
									
									
									
										Normal 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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										20
									
								
								app/Events/Transaction/TransactionSent.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								app/Events/Transaction/TransactionSent.php
									
									
									
									
									
										Normal 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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -257,4 +257,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->getDocumentFileName($payment);
 | 
			
		||||
 | 
			
		||||
        return $pdf->download($file_name);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -257,4 +257,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->getDocumentFileName($revenue);
 | 
			
		||||
 | 
			
		||||
        return $pdf->download($file_name);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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.
 | 
			
		||||
     *
 | 
			
		||||
 
 | 
			
		||||
@@ -59,4 +59,20 @@ trait Transactions
 | 
			
		||||
            'transaction.type.' . $index => implode(',', $types),
 | 
			
		||||
        ])->save();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    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;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										55
									
								
								app/View/Components/Transactions/Script.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										55
									
								
								app/View/Components/Transactions/Script.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								app/View/Components/Transactions/Show/Attachment.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/Transactions/Show/Attachment.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								app/View/Components/Transactions/Show/Content.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/Transactions/Show/Content.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								app/View/Components/Transactions/Show/Footer.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/Transactions/Show/Footer.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								app/View/Components/Transactions/Show/Header.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/Transactions/Show/Header.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								app/View/Components/Transactions/Show/Histories.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/Transactions/Show/Histories.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								app/View/Components/Transactions/Show/TopButtons.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/Transactions/Show/TopButtons.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								app/View/Components/Transactions/Show/Transaction.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/Transactions/Show/Transaction.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										18
									
								
								app/View/Components/Transactions/Template/Ddefault.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								app/View/Components/Transactions/Template/Ddefault.php
									
									
									
									
									
										Normal 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');
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -89,19 +89,35 @@ 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.
 | 
			
		||||
        ],
 | 
			
		||||
        '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.
 | 
			
		||||
        ],
 | 
			
		||||
        'contact_type'          => 'vendor',
 | 
			
		||||
    ],
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										1
									
								
								resources/views/components/transactions/script.blade.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								resources/views/components/transactions/script.blade.php
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1 @@
 | 
			
		||||
<script src="{{ asset( $scriptFile . '?v=' . $version) }}"></script>
 | 
			
		||||
@@ -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
 | 
			
		||||
@@ -0,0 +1,58 @@
 | 
			
		||||
@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 }}"
 | 
			
		||||
    />
 | 
			
		||||
@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']) }}
 | 
			
		||||
@@ -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>
 | 
			
		||||
@@ -0,0 +1,81 @@
 | 
			
		||||
<div class="row" style="font-size: inherit !important">
 | 
			
		||||
    @stack('header_account_start')
 | 
			
		||||
        @if (!$hideHeaderAccount)
 | 
			
		||||
        <div class="{{ $classHeaderAccount }}">
 | 
			
		||||
            {{ trans_choice('general.accounts', 1) }}
 | 
			
		||||
            <br>
 | 
			
		||||
 | 
			
		||||
            <strong>
 | 
			
		||||
                <span class="float-left">
 | 
			
		||||
                    {{ $transaction->account->name }}
 | 
			
		||||
                </span>
 | 
			
		||||
            </strong>
 | 
			
		||||
            <br><br>
 | 
			
		||||
        </div>
 | 
			
		||||
        @endif
 | 
			
		||||
    @stack('header_account_end')
 | 
			
		||||
 | 
			
		||||
    @stack('header_category_start')
 | 
			
		||||
        @if (!$hideHeaderCategory)
 | 
			
		||||
        <div class="{{ $classHeaderCategory }}">
 | 
			
		||||
            {{ trans_choice('general.categories', 1) }}
 | 
			
		||||
            <br>
 | 
			
		||||
 | 
			
		||||
            <strong>
 | 
			
		||||
                <span class="float-left">
 | 
			
		||||
                    {{ $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">
 | 
			
		||||
                    {{ $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">
 | 
			
		||||
                    @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">
 | 
			
		||||
                    @date($transaction->paid_at)
 | 
			
		||||
                </span>
 | 
			
		||||
            </strong>
 | 
			
		||||
            <br><br>
 | 
			
		||||
        </div>
 | 
			
		||||
        @endif
 | 
			
		||||
    @stack('header_paid_at_end')
 | 
			
		||||
</div>
 | 
			
		||||
@@ -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.description') }}
 | 
			
		||||
                            </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->description }}
 | 
			
		||||
                                </td>
 | 
			
		||||
                                @stack('row_footer_histories_body_td_end')
 | 
			
		||||
                            </tr>
 | 
			
		||||
                        @endforeach
 | 
			
		||||
                        @stack('row_footer_histories_body_tr_end')
 | 
			
		||||
                    </tbody>
 | 
			
		||||
                </table>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -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>  {{ 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')
 | 
			
		||||
@@ -0,0 +1,22 @@
 | 
			
		||||
<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 }}"
 | 
			
		||||
                    />
 | 
			
		||||
            @endswitch
 | 
			
		||||
        @else
 | 
			
		||||
            @include($transactionTemplate)
 | 
			
		||||
        @endif
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -0,0 +1,247 @@
 | 
			
		||||
<div class="row border-bottom-1 pt-6 pb-6">
 | 
			
		||||
    <div class="col-16">
 | 
			
		||||
      <div class="text company">
 | 
			
		||||
          @stack('company_logo_start')
 | 
			
		||||
            @if (!$hideCompanyLogo)
 | 
			
		||||
                @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
 | 
			
		||||
            @endif
 | 
			
		||||
            @stack('company_logo_end')
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
 | 
			
		||||
    <div class="col-42">
 | 
			
		||||
        <div class="text company lead">
 | 
			
		||||
            @stack('company_details_start')
 | 
			
		||||
            @if (!$hideCompanyDetails)
 | 
			
		||||
                @if (!$hideCompanyName)
 | 
			
		||||
                    <h2 class="mb-1">
 | 
			
		||||
                        {{ setting('company.name') }}
 | 
			
		||||
                    </h2>
 | 
			
		||||
                @endif
 | 
			
		||||
 | 
			
		||||
                @if (!$hideCompanyAddress)
 | 
			
		||||
                    <p>{!! nl2br(setting('company.address')) !!}</p>
 | 
			
		||||
                @endif
 | 
			
		||||
 | 
			
		||||
                @if (!$hideCompanyTaxNumber)
 | 
			
		||||
                    <p>
 | 
			
		||||
                        @if (setting('company.tax_number'))
 | 
			
		||||
                            {{ trans('general.tax_number') }}: {{ setting('company.tax_number') }}
 | 
			
		||||
                        @endif
 | 
			
		||||
                    </p>
 | 
			
		||||
                @endif
 | 
			
		||||
 | 
			
		||||
                @if (!$hideCompanyPhone)
 | 
			
		||||
                    <p>
 | 
			
		||||
                        @if (setting('company.phone'))
 | 
			
		||||
                            {{ setting('company.phone') }}
 | 
			
		||||
                        @endif
 | 
			
		||||
                    </p>
 | 
			
		||||
                @endif
 | 
			
		||||
 | 
			
		||||
                @if (!$hideCompanyEmail)
 | 
			
		||||
                    <p>{{ setting('company.email') }}</p>
 | 
			
		||||
                @endif
 | 
			
		||||
            @endif
 | 
			
		||||
            @stack('company_details_end')
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
<div class="row border-bottom-1 w-100 mt-6 pb-6 d-flex flex-column">
 | 
			
		||||
    <h2 class="text-center text-uppercase mb-6">{{ trans('invoices.revenue_made') }}</h2>
 | 
			
		||||
 | 
			
		||||
    <div class="d-flex">
 | 
			
		||||
        <div class="d-flex flex-column col-lg-7 pl-0">
 | 
			
		||||
            <div class="d-flex mt-3">
 | 
			
		||||
                <div class="text company show-company col-lg-4 pl-0">
 | 
			
		||||
                    <p>
 | 
			
		||||
                        <strong>{{ trans('general.date') }}:</strong>
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p>
 | 
			
		||||
                        <strong>{{ trans_choice('general.accounts', 1) }}:</strong>
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p>
 | 
			
		||||
                        {{ trans_choice('general.categories', 1) }}:</strong>
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p>
 | 
			
		||||
                        <strong>{{ trans_choice('general.payment_methods', 1) }}:</strong>
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p>
 | 
			
		||||
                        <strong>{{ trans('general.reference') }}:</strong>
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p>
 | 
			
		||||
                        <strong>{{ trans('general.description') }}:</strong>
 | 
			
		||||
                    </p>
 | 
			
		||||
                </div>
 | 
			
		||||
 | 
			
		||||
                <div class="text company col-lg-8 pr-0 show-company show-company-value">
 | 
			
		||||
                    <p class="border-bottom-1">
 | 
			
		||||
                        @date($transaction->paid_at)
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p class="border-bottom-1">
 | 
			
		||||
                        {{ $transaction->account->name }}
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p class="border-bottom-1">
 | 
			
		||||
                        {{ $transaction->category->name }}
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p class="border-bottom-1">
 | 
			
		||||
                        {{ $payment_methods[$transaction->payment_method] }}
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p class="border-bottom-1">
 | 
			
		||||
                        {{ $transaction->reference }}
 | 
			
		||||
                    </p>
 | 
			
		||||
 | 
			
		||||
                    <p>
 | 
			
		||||
                        {!! nl2br($transaction->description) !!}
 | 
			
		||||
                    </p>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
 | 
			
		||||
            <div class="text company mt-5">
 | 
			
		||||
                <h2>{{ trans('general.paid_by') }}</h2>
 | 
			
		||||
 | 
			
		||||
                @if ($hideContactInfo)
 | 
			
		||||
                    <strong>{{ trans($textContactInfo) }}</strong><br>
 | 
			
		||||
                @endif
 | 
			
		||||
    
 | 
			
		||||
                @stack('name_input_start')
 | 
			
		||||
                    @if (!$hideContactName)
 | 
			
		||||
                        <strong>{{ $transaction->contact->name }}</strong><br>
 | 
			
		||||
                    @endif
 | 
			
		||||
                @stack('name_input_end')
 | 
			
		||||
    
 | 
			
		||||
                @stack('address_input_start')
 | 
			
		||||
                    @if (!$hideContactAddress)
 | 
			
		||||
                        <p>{!! nl2br($transaction->contact->address) !!}</p>
 | 
			
		||||
                    @endif
 | 
			
		||||
                @stack('address_input_end')
 | 
			
		||||
    
 | 
			
		||||
                @stack('tax_number_input_start')
 | 
			
		||||
                    @if (!$hideContactTaxNumber)
 | 
			
		||||
                        <p>
 | 
			
		||||
                            @if ($transaction->contact->tax_number)
 | 
			
		||||
                                {{ trans('general.tax_number') }}: {{ $transaction->contact->tax_number }}
 | 
			
		||||
                            @endif
 | 
			
		||||
                        </p>
 | 
			
		||||
                    @endif
 | 
			
		||||
                @stack('tax_number_input_end')
 | 
			
		||||
    
 | 
			
		||||
                @stack('phone_input_start')
 | 
			
		||||
                    @if (!$hideContactPhone)
 | 
			
		||||
                        <p>
 | 
			
		||||
                            @if ($transaction->contact->phone)
 | 
			
		||||
                                {{ $transaction->contact->phone }}
 | 
			
		||||
                            @endif
 | 
			
		||||
                        </p>
 | 
			
		||||
                    @endif
 | 
			
		||||
                @stack('phone_input_end')
 | 
			
		||||
    
 | 
			
		||||
                @stack('email_start')
 | 
			
		||||
                    @if (!$hideContactEmail)
 | 
			
		||||
                        <p>
 | 
			
		||||
                            {{ $transaction->contact->email }}
 | 
			
		||||
                        </p>
 | 
			
		||||
                    @endif
 | 
			
		||||
                @stack('email_input_end')
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
        <div class="d-flex flex-column align-items-end col-lg-5 pr-0">
 | 
			
		||||
            <div class="card bg-success show-card-bg-success border-0 mt-4 mb-0">
 | 
			
		||||
                <div class="card-body">
 | 
			
		||||
                    <div class="row">
 | 
			
		||||
                        <div class="col card-amount-badge text-center mt-3">
 | 
			
		||||
                            <h5 class="text-muted mb-0 text-white">{{ trans('general.amount') }}</h5>
 | 
			
		||||
 | 
			
		||||
                            <span class="h2 font-weight-bold mb-0 text-white">
 | 
			
		||||
                                @money($transaction->amount, $transaction->currency_code, true)
 | 
			
		||||
                            </span>
 | 
			
		||||
                        </div>
 | 
			
		||||
                    </div>
 | 
			
		||||
                </div>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@if ($transaction->document)
 | 
			
		||||
    <div class="row mt-3 mb-3">
 | 
			
		||||
        <div class="col-100">
 | 
			
		||||
            <div class="text">
 | 
			
		||||
                <h3>{{ trans('invoices.related_revenue') }}</h3>
 | 
			
		||||
 | 
			
		||||
                <table class="table table-flush table-hover mt-3">
 | 
			
		||||
                    <thead class="thead-light">
 | 
			
		||||
                        <tr class="border-bottom-1">
 | 
			
		||||
                            <th class="item text-left">
 | 
			
		||||
                                <span>{{ trans_choice('general.numbers', 1) }}</span>
 | 
			
		||||
                            </th>
 | 
			
		||||
 | 
			
		||||
                            <th class="quantity">
 | 
			
		||||
                                {{ trans_choice('general.customers', 1) }}
 | 
			
		||||
                            </th>
 | 
			
		||||
 | 
			
		||||
                            <th class="price">
 | 
			
		||||
                                {{ trans('invoices.invoice_date') }}
 | 
			
		||||
                            </th>
 | 
			
		||||
 | 
			
		||||
                            <th class="price">
 | 
			
		||||
                                {{ trans('invoices.invoice_date') }}
 | 
			
		||||
                            </th>
 | 
			
		||||
 | 
			
		||||
                            <th class="total">
 | 
			
		||||
                                {{ trans('general.amount') }}
 | 
			
		||||
                            </th>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                    </thead>
 | 
			
		||||
 | 
			
		||||
                    <tbody>
 | 
			
		||||
                        <tr class="border-bottom-1">
 | 
			
		||||
                            <td class="item">
 | 
			
		||||
                                <a href="{{ route('invoices.show' , $transaction->document->id) }}">
 | 
			
		||||
                                    {{ $transaction->document->document_number }}
 | 
			
		||||
                                </a>
 | 
			
		||||
                            </td>
 | 
			
		||||
 | 
			
		||||
                            <td class="quantity">
 | 
			
		||||
                                {{ $transaction->document->contact_name }}
 | 
			
		||||
                            </td>
 | 
			
		||||
 | 
			
		||||
                            <td class="price">
 | 
			
		||||
                                @date($transaction->document->due_at)
 | 
			
		||||
                            </td>
 | 
			
		||||
 | 
			
		||||
                            <td class="price">
 | 
			
		||||
                                @money($transaction->document->amount, $transaction->document->currency_code, true)
 | 
			
		||||
                            </td>
 | 
			
		||||
 | 
			
		||||
                            <td class="total">
 | 
			
		||||
                                @money($transaction->amount, $transaction->currency_code, true)
 | 
			
		||||
                            </td>
 | 
			
		||||
                        </tr>
 | 
			
		||||
                    </tbody>
 | 
			
		||||
                </table>
 | 
			
		||||
            </div>
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
@else
 | 
			
		||||
    <div class="row mt-3 mb-3">
 | 
			
		||||
        <p>
 | 
			
		||||
            {{ trans('invoices.overdue_revenue') }}: <strong style="font-weight: bold;">@money($transaction->amount, $transaction->currency_code, true)</strong>
 | 
			
		||||
        </p>
 | 
			
		||||
    </div>
 | 
			
		||||
@endif
 | 
			
		||||
@@ -1,180 +1,17 @@
 | 
			
		||||
@extends('layouts.admin')
 | 
			
		||||
 | 
			
		||||
@section('title', trans('bills.payment_made') )
 | 
			
		||||
@section('title', trans('invoices.payment_made'))
 | 
			
		||||
 | 
			
		||||
@section('new_button')
 | 
			
		||||
@can('create-sales-revenues')
 | 
			
		||||
 | 
			
		||||
<a href="{{ route('revenues.create') }}" class="btn btn-white btn-sm">{{ trans('general.add_new') }}</a>
 | 
			
		||||
@endcan
 | 
			
		||||
    <x-transactions.show.top-buttons type="expense" :transaction="$payment" hide-button-share />
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
<div id="app">
 | 
			
		||||
  <div class="row mt-3 w-100 mb-3" style="font-size: unset; padding: 0px 15px;">
 | 
			
		||||
    <div class="d-flex w-100" style="padding: 1.5rem;">
 | 
			
		||||
      <div class="row w-100 justify-content-between" style="font-size: unset;">
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans_choice('general.accounts', 1) }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
              Account name
 | 
			
		||||
            </span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans_choice('general.categories', 1) }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
              Category name
 | 
			
		||||
            </span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans_choice('general.vendors', 1) }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
              Vendor name</span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans('general.amount') }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
              {{ $payment->amount }} </span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans('general.date') }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
              {{ Date::parse($payment->paid_at)->toDateString() }} </span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="card show-card">
 | 
			
		||||
    <div class="card-body show-card-body">
 | 
			
		||||
      <div class="row border-bottom-1 pt-6 pb-6">
 | 
			
		||||
        <div class="col-16">
 | 
			
		||||
          <div class="text company"><img src="data:image/png;base64,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" alt="Company - Brkcvn"></div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="col-42">
 | 
			
		||||
          <div class="text company lead">
 | 
			
		||||
            <h2 class="mb-1">{{ setting('company.name') }}</h2>
 | 
			
		||||
 | 
			
		||||
            <p class="mb-1">{{ trans('general.tax_number') }}: <strong>{{ setting('company.tax_number') }}</strong></p>
 | 
			
		||||
 | 
			
		||||
            <p class="mb-1"><a href="tel:{{ setting('company.phone') }}">{{ setting('company.phone') }}</a></p>
 | 
			
		||||
 | 
			
		||||
            <p class="mb-1"><a href="mailto:{{ setting('company.email') }}">{{ setting('company.email') }}</a></p>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="row border-bottom-1 w-100 mt-6 pb-6 d-flex flex-column">
 | 
			
		||||
        <h2 class="text-center text-uppercase mb-6">{{ trans_choice('bills.payment_made', 1) }}</h2>
 | 
			
		||||
        <div class="d-flex">
 | 
			
		||||
          <div class="d-flex flex-column col-lg-7 pl-0">
 | 
			
		||||
            <div class="d-flex mt-3">
 | 
			
		||||
              <div class="text company show-company col-lg-4 pl-0">
 | 
			
		||||
                <p>{{ trans('general.date') }}:</p>
 | 
			
		||||
 | 
			
		||||
                <p>{{ trans_choice('general.accounts', 1) }}:</p>
 | 
			
		||||
 | 
			
		||||
                <p>{{ trans_choice('general.categories', 1) }}:</p>
 | 
			
		||||
                <p>{{ trans_choice('general.payment_methods', 1) }}:</p>
 | 
			
		||||
                <p>{{ trans('general.reference') }}:</p>
 | 
			
		||||
                <p>{{ trans('general.description') }}:</p>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="text company col-lg-8 pr-0 show-company show-company-value">
 | 
			
		||||
                <p class="border-bottom-1"><strong>12.12.2022</strong></p>
 | 
			
		||||
 | 
			
		||||
                <p class="border-bottom-1"><strong>Account One</strong></p>
 | 
			
		||||
                <p class="border-bottom-1"><strong>Data Category</strong></p>
 | 
			
		||||
                <p class="border-bottom-1"><strong>Cash</strong></p>
 | 
			
		||||
                <p class="border-bottom-1"><strong>Lorem Ipsum</strong></p>
 | 
			
		||||
                <p><strong>Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum</strong></p>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="text company mt-5">
 | 
			
		||||
              <h2>{{ trans('general.paid_to') }}</h2>
 | 
			
		||||
              <h4 class="mb-1"><a href="">Name</a></h4>
 | 
			
		||||
              <p class="mb-1">Adress</p>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="d-flex flex-column align-items-end col-lg-5 pr-0">
 | 
			
		||||
            <div class="card bg-success show-card-bg-success border-0 mt-4 mb-0">
 | 
			
		||||
              <div class="card-body">
 | 
			
		||||
                <div class="row">
 | 
			
		||||
                  <div class="col card-amount-badge text-center mt-3">
 | 
			
		||||
                    <h5 class="text-muted mb-0 text-white">{{ trans('general.amount') }}</h5>
 | 
			
		||||
                    <span class="h2 font-weight-bold mb-0 text-white">₺0,00</span>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="row mt-3 mb-3">
 | 
			
		||||
        <div class="col-100">
 | 
			
		||||
          <div class="text">
 | 
			
		||||
            <h3>{{ trans('bills.related_bill') }}</h3>
 | 
			
		||||
            <table class="table table-flush table-hover mt-3">
 | 
			
		||||
              <thead class="thead-light">
 | 
			
		||||
                <tr class="border-bottom-1">
 | 
			
		||||
                  <th class="item text-left"><span>{{ trans('bills.bill_number') }}</span></th>
 | 
			
		||||
                  <th class="quantity">{{ trans_choice('general.vendors', 1) }}</th>
 | 
			
		||||
                  <th class="price">{{ trans('bills.bill_date') }}</th>
 | 
			
		||||
                  <th class="total">{{ trans('general.amount') }}</th>
 | 
			
		||||
                </tr>
 | 
			
		||||
              </thead>
 | 
			
		||||
              <tbody>
 | 
			
		||||
                <tr class="border-bottom-1">
 | 
			
		||||
                  <td class="item"><a href="">BILL-123</a></td>
 | 
			
		||||
                  <td class="quantity">Vendor name</td>
 | 
			
		||||
                  <td class="price">12.12.2022</td>
 | 
			
		||||
                  <td class="total">₺6.000,00</td>
 | 
			
		||||
                </tr>
 | 
			
		||||
              </tbody>
 | 
			
		||||
            </table>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="row mt-3 mb-3">
 | 
			
		||||
        <p>{{ trans('bills.overdue_payment') }}: <strong style="font-weight: bold;">₺6.000,00</strong></p>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="col-sm-6 col-md-6 col-lg-6 col-xl-6 pl-0 pr-0">
 | 
			
		||||
    <div class="accordion">
 | 
			
		||||
      <div class="card">
 | 
			
		||||
        <div class="card-header" id="accordion-transactions-header" data-toggle="collapse" data-target="#accordion-transactions-body" aria-expanded="false" aria-controls="accordion-transactions-body">
 | 
			
		||||
          <h4 class="mb-0">{{ trans('bills.payment_history') }}</h4>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div id="accordion-transactions-body" class="collapse hide" aria-labelledby="accordion-transactions-header">
 | 
			
		||||
          <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-6 col-sm-6">{{ trans('general.revenue_date') }}</th>
 | 
			
		||||
                  <th class="col-xs-6 col-sm-6">{{ trans('general.created') }}</th>
 | 
			
		||||
                </tr>
 | 
			
		||||
              </thead>
 | 
			
		||||
              <tbody>
 | 
			
		||||
                <tr class="row align-items-center border-top-1 tr-py">
 | 
			
		||||
                  <td class="col-xs-6 col-sm-6">
 | 
			
		||||
                    12.12.2022
 | 
			
		||||
                  </td>
 | 
			
		||||
                  <td class="col-xs-6 col-sm-6">
 | 
			
		||||
                    Created name
 | 
			
		||||
                  </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
              </tbody>
 | 
			
		||||
            </table>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
    <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">
 | 
			
		||||
    <link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
 | 
			
		||||
 | 
			
		||||
<script src="{{ asset('public/js/sales/revenues.js?v=' . version('short')) }}"></script>
 | 
			
		||||
    <x-transactions.script type="expense" />
 | 
			
		||||
@endpush
 | 
			
		||||
@@ -3,178 +3,15 @@
 | 
			
		||||
@section('title', trans('invoices.revenue_made'))
 | 
			
		||||
 | 
			
		||||
@section('new_button')
 | 
			
		||||
@can('create-sales-revenues')
 | 
			
		||||
 | 
			
		||||
<a href="{{ route('revenues.create') }}" class="btn btn-white btn-sm">{{ trans('general.add_new') }}</a>
 | 
			
		||||
@endcan
 | 
			
		||||
    <x-transactions.show.top-buttons type="income" :transaction="$revenue" />
 | 
			
		||||
@endsection
 | 
			
		||||
 | 
			
		||||
@section('content')
 | 
			
		||||
<div id="app">
 | 
			
		||||
  <div class="row mt-3 w-100 mb-3" style="font-size: unset; padding: 0px 15px;">
 | 
			
		||||
    <div class="d-flex w-100" style="padding: 1.5rem;">
 | 
			
		||||
      <div class="row w-100 justify-content-between" style="font-size: unset;">
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans_choice('general.accounts', 1) }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
              Account name
 | 
			
		||||
            </span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans_choice('general.categories', 1) }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
              Category name
 | 
			
		||||
            </span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans_choice('general.customers', 1) }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
              Customer name</span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans('general.amount') }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
            </span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="show-head">
 | 
			
		||||
          {{ trans('general.date') }}
 | 
			
		||||
          <strong><span class="float-left">
 | 
			
		||||
            </span></strong>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="card show-card">
 | 
			
		||||
    <div class="card-body show-card-body">
 | 
			
		||||
      <div class="row border-bottom-1 pt-6 pb-6">
 | 
			
		||||
        <div class="col-16">
 | 
			
		||||
          <div class="text company"><img src="data:image/png;base64,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" alt="Company - Brkcvn"></div>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div class="col-42">
 | 
			
		||||
          <div class="text company lead">
 | 
			
		||||
            <h2 class="mb-1">{{ setting('company.name') }}</h2>
 | 
			
		||||
 | 
			
		||||
            <p class="mb-1">{{ trans('general.tax_number') }}: <strong>{{ setting('company.tax_number') }}</strong></p>
 | 
			
		||||
 | 
			
		||||
            <p class="mb-1"><a href="tel:{{ setting('company.phone') }}">{{ setting('company.phone') }}</a></p>
 | 
			
		||||
 | 
			
		||||
            <p class="mb-1"><a href="mailto:{{ setting('company.email') }}">{{ setting('company.email') }}</a></p>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="row border-bottom-1 w-100 mt-6 pb-6 d-flex flex-column">
 | 
			
		||||
        <h2 class="text-center text-uppercase mb-6">{{ trans('invoices.revenue_made') }}</h2>
 | 
			
		||||
        <div class="d-flex">
 | 
			
		||||
          <div class="d-flex flex-column col-lg-7 pl-0">
 | 
			
		||||
            <div class="d-flex mt-3">
 | 
			
		||||
              <div class="text company show-company col-lg-4 pl-0">
 | 
			
		||||
                <p>{{ trans('general.date') }}:</p>
 | 
			
		||||
 | 
			
		||||
                <p>{{ trans_choice('general.accounts', 1) }}:</p>
 | 
			
		||||
 | 
			
		||||
                <p>{{ trans_choice('general.categories', 1) }}:</p>
 | 
			
		||||
                <p>{{ trans_choice('general.payment_methods', 1) }}:</p>
 | 
			
		||||
                <p>{{ trans('general.reference') }}:</p>
 | 
			
		||||
                <p>{{ trans('general.description') }}:</p>
 | 
			
		||||
              </div>
 | 
			
		||||
              <div class="text company col-lg-8 pr-0 show-company show-company-value">
 | 
			
		||||
                <p class="border-bottom-1"><strong>12.12.2022</strong></p>
 | 
			
		||||
 | 
			
		||||
                <p class="border-bottom-1"><strong>Account One</strong></p>
 | 
			
		||||
                <p class="border-bottom-1"><strong>Data Category</strong></p>
 | 
			
		||||
                <p class="border-bottom-1"><strong>Cash</strong></p>
 | 
			
		||||
                <p class="border-bottom-1"><strong>Lorem Ipsum</strong></p>
 | 
			
		||||
                <p><strong>Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum Lorem Ipsum</strong></p>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
            <div class="text company mt-5">
 | 
			
		||||
              <h2>{{ trans('general.paid_by') }}</h2>
 | 
			
		||||
              <h4 class="mb-1"><a href="">Name</a></h4>
 | 
			
		||||
              <p class="mb-1">Adress</p>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
          <div class="d-flex flex-column align-items-end col-lg-5 pr-0">
 | 
			
		||||
            <div class="card bg-success show-card-bg-success border-0 mt-4 mb-0">
 | 
			
		||||
              <div class="card-body">
 | 
			
		||||
                <div class="row">
 | 
			
		||||
                  <div class="col card-amount-badge text-center mt-3">
 | 
			
		||||
                    <h5 class="text-muted mb-0 text-white">{{ trans('general.amount') }}</h5>
 | 
			
		||||
                    <span class="h2 font-weight-bold mb-0 text-white">₺0,00</span>
 | 
			
		||||
                  </div>
 | 
			
		||||
                </div>
 | 
			
		||||
              </div>
 | 
			
		||||
            </div>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="row mt-3 mb-3">
 | 
			
		||||
        <div class="col-100">
 | 
			
		||||
          <div class="text">
 | 
			
		||||
            <h3>{{ trans('invoices.related_revenue') }}</h3>
 | 
			
		||||
            <table class="table table-flush table-hover mt-3">
 | 
			
		||||
              <thead class="thead-light">
 | 
			
		||||
                <tr class="border-bottom-1">
 | 
			
		||||
                  <th class="item text-left"><span>{{ trans_choice('general.numbers', 1) }}</span></th>
 | 
			
		||||
                  <th class="quantity"> {{ trans_choice('general.customers', 1) }}</th>
 | 
			
		||||
                  <th class="price">{{ trans('invoices.invoice_date') }}</th>
 | 
			
		||||
                  <th class="total">{{ trans('general.amount') }}</th>
 | 
			
		||||
                </tr>
 | 
			
		||||
              </thead>
 | 
			
		||||
              <tbody>
 | 
			
		||||
                <tr class="border-bottom-1">
 | 
			
		||||
                  <td class="item"><a href="">BILL-123</a></td>
 | 
			
		||||
                  <td class="quantity">Vendor name</td>
 | 
			
		||||
                  <td class="price">12.12.2022</td>
 | 
			
		||||
                  <td class="total">₺6.000,00</td>
 | 
			
		||||
                </tr>
 | 
			
		||||
              </tbody>
 | 
			
		||||
            </table>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
      <div class="row mt-3 mb-3 d-none">
 | 
			
		||||
        <p>{{ trans('invoices.overdue_revenue') }}: <strong style="font-weight: bold;">₺6.000,00</strong></p>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
  <div class="col-sm-6 col-md-6 col-lg-6 col-xl-6 pl-0 pr-0">
 | 
			
		||||
    <div class="accordion">
 | 
			
		||||
      <div class="card">
 | 
			
		||||
        <div class="card-header" id="accordion-transactions-header" data-toggle="collapse" data-target="#accordion-transactions-body" aria-expanded="false" aria-controls="accordion-transactions-body">
 | 
			
		||||
          <h4 class="mb-0">{{ trans('invoices.revenue_history') }}</h4>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div id="accordion-transactions-body" class="collapse hide" aria-labelledby="accordion-transactions-header">
 | 
			
		||||
          <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-6 col-sm-6">{{ trans('general.revenue_date') }}</th>
 | 
			
		||||
                  <th class="col-xs-6 col-sm-6">{{ trans('general.created') }}</th>
 | 
			
		||||
                </tr>
 | 
			
		||||
              </thead>
 | 
			
		||||
              <tbody>
 | 
			
		||||
                <tr class="row align-items-center border-top-1 tr-py">
 | 
			
		||||
                  <td class="col-xs-6 col-sm-6">
 | 
			
		||||
                    12.12.2022
 | 
			
		||||
                  </td>
 | 
			
		||||
                  <td class="col-xs-6 col-sm-6">
 | 
			
		||||
                    Created name
 | 
			
		||||
                  </td>
 | 
			
		||||
                </tr>
 | 
			
		||||
              </tbody>
 | 
			
		||||
            </table>
 | 
			
		||||
          </div>
 | 
			
		||||
        </div>
 | 
			
		||||
      </div>
 | 
			
		||||
    </div>
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
    <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">
 | 
			
		||||
    <link rel="stylesheet" href="{{ asset('public/css/print.css?v=' . version('short')) }}" type="text/css">
 | 
			
		||||
 | 
			
		||||
<script src="{{ asset('public/js/sales/revenues.js?v=' . version('short')) }}"></script>
 | 
			
		||||
    <x-transactions.script type="income" />
 | 
			
		||||
@endpush
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
@@ -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');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user