transfer = $transfer; $this->transferTemplate = $this->getTransferTemplate($transferTemplate); $this->payment_methods = ($payment_methods) ?: Modules::getPaymentMethods('all'); $this->date_format = $this->getCompanyDateFormat(); // Navbar Hide $this->hideButtonAddNew = $hideButtonAddNew; $this->hideButtonMoreActions = $hideButtonMoreActions; $this->hideButtonEdit = $hideButtonEdit; $this->hideButtonDuplicate = $hideButtonDuplicate; $this->hideButtonPrint = $hideButtonPrint; $this->hideButtonShare = $hideButtonShare; $this->hideButtonEmail = $hideButtonEmail; $this->hideButtonPdf = $hideButtonPdf; $this->hideButtonTemplate = $hideButtonTemplate; $this->hideButtonDelete = $hideButtonDelete; $this->hideButtonGroupDivider1 = $hideButtonGroupDivider1; $this->hideButtonGroupDivider2 = $hideButtonGroupDivider2; $this->hideButtonGroupDivider3 = $hideButtonGroupDivider3; // Navbar Permission $this->permissionCreate = $this->getPermissionCreate($permissionCreate); $this->permissionUpdate = $this->getPermissionUpdate($permissionUpdate); $this->permissionDelete = $this->getPermissionDelete($permissionDelete); // Navbar route $this->routeButtonAddNew = $this->getRouteButtonAddNew($routeButtonAddNew); $this->routeButtonEdit = $this->getRouteButtonEdit($routeButtonEdit); $this->routeButtonDuplicate = $this->getRouteButtonDuplicate($routeButtonDuplicate); $this->routeButtonPrint = $this->getRouteButtonPrint($routeButtonPrint); $this->signedUrl = $this->getSignedUrl($signedUrl); $this->routeButtonEmail = $this->getRouteButtonEmail($routeButtonEmail); $this->routeButtonPdf = $this->getRouteButtonPdf($routeButtonPdf); $this->routeButtonDelete = $this->getRouteButtonDelete($routeButtonDelete); // Navbar Text $this->textDeleteModal = $textDeleteModal; // Header Hide $this->hideHeader = $hideHeader; $this->hideHeaderFromAccount = $hideHeaderFromAccount; $this->hideHeaderToAccount = $hideHeaderToAccount; $this->hideHeaderToAccount = $hideHeaderToAccount; $this->hideHeaderAmount = $hideHeaderAmount; $this->hideHeaderPaidAt = $hideHeaderPaidAt; // Header Text $this->textHeaderFromAccount = $this->getTextHeaderFromAccount($textHeaderFromAccount); $this->textHeaderToAccount = $this->getTextHeaderToAccount($textHeaderToAccount); $this->textHeaderAmount = $this->getTextHeaderAmount($textHeaderAmount); $this->textHeaderPaidAt = $this->gettextHeaderPaidAt($textHeaderPaidAt); // Header Class $this->classHeaderFromAccount = $this->getclassHeaderFromAccount($classHeaderFromAccount); $this->classHeaderToAccount = $this->getClassHeaderToAccount($classHeaderToAccount); $this->classHeaderAmount = $this->getClassHeaderAmount($classHeaderAmount); $this->classHeaderPaidAt = $this->getclassHeaderPaidAt($classHeaderPaidAt); // From account Hide $this->hideFromAccount = $hideFromAccount; $this->hideFromAccountTitle = $hideFromAccountTitle; $this->hideFromAccountName = $hideFromAccountName; $this->hideFromAccountNumber = $hideFromAccountNumber; $this->hideFromAccountBankName = $hideFromAccountBankName; $this->hideFromAccountBankPhone = $hideFromAccountBankPhone; $this->hideFromAccountBankAddress = $hideFromAccountBankAddress; // From account text $this->textFromAccountTitle = $this->getTextFromAccountTitle($textFromAccountTitle); $this->textFromAccountNumber = $this->getTextFromAccountNumber($textFromAccountNumber); // To account Hide $this->hideToAccount = $hideToAccount; $this->hideToAccountTitle = $hideToAccountTitle; $this->hideToAccountName = $hideToAccountName; $this->hideToAccountNumber = $hideToAccountNumber; $this->hideToAccountBankName = $hideToAccountBankName; $this->hideToAccountBankPhone = $hideToAccountBankPhone; $this->hideToAccountBankAddress = $hideToAccountBankAddress; // To account text $this->textToAccountTitle = $this->getTextToAccountTitle($textToAccountTitle); $this->textToAccountNumber = $this->getTextToAccountNumber($textToAccountNumber); // Detail Information Hide checker $this->hideDetails = $hideDetails; $this->hideDetailTitle = $hideDetailTitle; $this->hideDetailDate = $hideDetailDate; $this->hideDetailPaymentMethod = $hideDetailPaymentMethod; $this->hideDetailReference = $hideDetailReference; $this->hideDetailDescription = $hideDetailDescription; $this->hideDetailAmount = $hideDetailAmount; // Releated Information Text $this->textDetailTitle = $this->getTextDetailTitle($textDetailTitle); $this->textDetailDate = $this->getTextDetailDate($textDetailDate); $this->textDetailPaymentMethod = $this->getTextDetailPaymentMethod($textDetailPaymentMethod); $this->textDetailReference = $this->getTextDetailReference($textDetailReference); $this->textDetailDescription = $this->getTextDetailDescription($textDetailDescription); $this->textDetailAmount = $this->getTextDetailAmount($textDetailAmount); // Hide Attachment $this->hideAttachment = $hideAttachment; // Attachment data.. $this->attachment = ''; if (!empty($attachment)) { $this->attachment = $attachment; } else if (!empty($transfer)) { $this->attachment = $transfer->attachment; } // Histories Hide $this->hideFooter = $hideFooter; $this->hideFooterHistories = $hideFooterHistories; // Histories $this->histories = $this->getHistories($histories); $this->textHistories = $this->getTextHistories($textHistories); $this->classFooterHistories = $this->getClassFooterHistories($classFooterHistories); } protected function getTransferTemplate($transferTemplate) { if (!empty($transferTemplate)) { return $transferTemplate; } return setting('transfer.template'); } protected function getRouteButtonAddNew($routeButtonAddNew) { if (!empty($routeButtonAddNew)) { return $routeButtonAddNew; } return 'transfers.create'; } protected function getRouteButtonEdit($routeButtonEdit) { if (!empty($routeButtonEdit)) { return $routeButtonEdit; } return 'transfers.edit'; } protected function getRouteButtonDuplicate($routeButtonDuplicate) { if (!empty($routeButtonDuplicate)) { return $routeButtonDuplicate; } return 'transfers.duplicate'; } protected function getRouteButtonPrint($routeButtonPrint) { if (!empty($routeButtonPrint)) { return $routeButtonPrint; } return 'transfers.print'; } protected function getSignedUrl($signedUrl) { if (!empty($signedUrl)) { return $signedUrl; } try { $signedUrl = URL::signedRoute('signed.transfer.show', [$this->transfer->id]); } catch (\Exception $e) { $signedUrl = false; } return $signedUrl; } protected function getRouteButtonEmail($routeButtonEmail) { if (!empty($routeButtonEmail)) { return $routeButtonEmail; } return 'transfers.email'; } protected function getRouteButtonPdf($routeButtonPdf) { if (!empty($routeButtonPdf)) { return $routeButtonPdf; } return 'transfers.pdf'; } protected function getRouteButtonDelete($routeButtonDelete) { if (!empty($routeButtonDelete)) { return $routeButtonDelete; } return 'transfers.destroy'; } protected function getPermissionCreate($permissionCreate) { if (!empty($permissionCreate)) { return $permissionCreate; } return 'create-banking-transfers'; } protected function getPermissionUpdate($permissionUpdate) { if (!empty($permissionUpdate)) { return $permissionUpdate; } return 'update-banking-transfers'; } protected function getPermissionDelete($permissionDelete) { if (!empty($permissionDelete)) { return $permissionDelete; } return 'delete-banking-transfers'; } protected function getTextHeaderFromAccount($textHeaderFromAccount) { if (!empty($textHeaderFromAccount)) { return $textHeaderFromAccount; } return 'transfers.from_account'; } protected function getTextHeaderToAccount($textHeaderToAccount) { if (!empty($textHeaderToAccount)) { return $textHeaderToAccount; } return 'transfers.to_account'; } protected function getTextHeaderAmount($textHeaderAmount) { if (!empty($textHeaderAmount)) { return $textHeaderAmount; } return 'general.amount'; } protected function getTextHeaderPaidAt($textHeaderPaidAt) { if (!empty($textHeaderPaidAt)) { return $textHeaderPaidAt; } return 'general.date'; } protected function getClassHeaderFromAccount($classHeaderFromAccount) { if (!empty($classHeaderFromAccount)) { return $classHeaderFromAccount; } return 'col-4 col-lg-2'; } protected function getClassHeaderToAccount($classHeaderToAccount) { if (!empty($classHeaderToAccount)) { return $classHeaderToAccount; } return 'col-4 col-lg-6'; } protected function getClassHeaderAmount($classHeaderAmount) { if (!empty($classHeaderAmount)) { return $classHeaderAmount; } return 'col-4 col-lg-2 float-right'; } protected function getClassHeaderPaidAt($classHeaderPaidAt) { if (!empty($classHeaderPaidAt)) { return $classHeaderPaidAt; } return 'col-4 col-lg-2'; } protected function getTextFromAccountTitle($textToAccountTitle) { if (!empty($textToAccountTitle)) { return $textToAccountTitle; } return 'transfers.from_account'; } protected function getTextFromAccountNumber($textFromAccountNumber) { if (!empty($textFromAccountNumber)) { return $textFromAccountNumber; } return 'accounts.number'; } protected function getTextToAccountTitle($textFromAccountTitle) { if (!empty($textFromAccountTitle)) { return $textFromAccountTitle; } return 'transfers.to_account'; } protected function getTextToAccountNumber($textToAccountNumber) { if (!empty($textToAccountNumber)) { return $textToAccountNumber; } return 'accounts.number'; } protected function getTextDetailTitle($textDetailTitle) { if (!empty($textDetailTitle)) { return $textDetailTitle; } return 'transfers.details'; } protected function getTextDetailDate($textDetailDate) { if (!empty($textDetailDate)) { return $textDetailDate; } return 'general.date'; } protected function getTextDetailPaymentMethod($textDetailPaymentMethod) { if (!empty($textDetailPaymentMethod)) { return $textDetailPaymentMethod; } return 'general.payment_methods'; } protected function getTextDetailReference($textDetailReference) { if (!empty($textDetailReference)) { return $textDetailReference; } return 'general.reference'; } protected function getTextDetailDescription($textDetailDescription) { if (!empty($textDetailDescription)) { return $textDetailDescription; } return 'general.description'; } protected function getTextDetailAmount($textDetailAmount) { if (!empty($textDetailAmount)) { return $textDetailAmount; } return 'general.amount'; } protected function getHistories($histories) { if (!empty($histories)) { return $histories; } $histories[] = $this->transfer; return $histories; } protected function getTextHistories($textHistories) { if (!empty($textHistories)) { return $textHistories; } return 'invoices.histories'; } protected function getClassFooterHistories($classFooterHistories) { if (!empty($classFooterHistories)) { return $classFooterHistories; } return 'col-sm-6 col-md-6 col-lg-6 col-xl-6'; } }