diff --git a/app/Http/Controllers/ClientPortalController.php b/app/Http/Controllers/ClientPortalController.php index 6b3896a84a..aa27130315 100644 --- a/app/Http/Controllers/ClientPortalController.php +++ b/app/Http/Controllers/ClientPortalController.php @@ -16,7 +16,6 @@ use App\Ninja\Repositories\DocumentRepository; use App\Ninja\Repositories\InvoiceRepository; use App\Ninja\Repositories\PaymentRepository; use App\Ninja\Repositories\TaskRepository; -use App\Ninja\Repositories\ProposalRepository; use App\Services\PaymentService; use Auth; use Barracuda\ArchiveStream\ZipArchive; @@ -38,7 +37,6 @@ class ClientPortalController extends BaseController private $invoiceRepo; private $paymentRepo; private $documentRepo; - private $propoosalRepo; public function __construct( InvoiceRepository $invoiceRepo, @@ -47,8 +45,7 @@ class ClientPortalController extends BaseController DocumentRepository $documentRepo, PaymentService $paymentService, CreditRepository $creditRepo, - TaskRepository $taskRepo, - ProposalRepository $propoosalRepo) + TaskRepository $taskRepo) { $this->invoiceRepo = $invoiceRepo; $this->paymentRepo = $paymentRepo; @@ -57,42 +54,6 @@ class ClientPortalController extends BaseController $this->paymentService = $paymentService; $this->creditRepo = $creditRepo; $this->taskRepo = $taskRepo; - $this->propoosalRepo = $propoosalRepo; - } - - public function viewProposal($invitationKey) - { - if (! $invitation = $this->propoosalRepo->findInvitationByKey($invitationKey)) { - return $this->returnError(trans('texts.proposal_not_found')); - } - - $account = $invitation->account; - $proposal = $invitation->proposal; - $invoiceInvitation = Invitation::whereContactId($invitation->contact_id) - ->whereInvoiceId($proposal->invoice_id) - ->firstOrFail(); - - $data = [ - 'proposal' => $proposal, - 'account' => $account, - 'invoiceInvitation' => $invoiceInvitation, - 'proposalInvitation' => $invitation, - ]; - - return view('invited.proposal', $data); - } - - public function downloadProposal($invitationKey) - { - if (! $invitation = $this->propoosalRepo->findInvitationByKey($invitationKey)) { - return $this->returnError(trans('texts.proposal_not_found')); - } - - $proposal = $invitation->proposal; - - $mpdf = new \mPDF(); - $mpdf->WriteHTML($proposal->present()->htmlDocument); - $mpdf->Output($proposal->present()->filename, 'D'); } public function viewInvoice($invitationKey) @@ -836,16 +797,6 @@ class ClientPortalController extends BaseController }, 200); } - /* - public function getProposalDocument($accountKey, $publicId) - { - $account = Account::whereAccountKey($accountKey)->firstOrFail(); - $document = Document::whereAccountId($account->id)->wherePublicId($publicId)->firstOrFail(); - - return DocumentController::getDownloadResponse($document); - } - */ - public function getDocument($invitationKey, $publicId) { if (! $invitation = $this->invoiceRepo->findInvoiceByInvitation($invitationKey)) { diff --git a/app/Http/Controllers/ClientPortalProposalController.php b/app/Http/Controllers/ClientPortalProposalController.php new file mode 100644 index 0000000000..1dd19ab9fc --- /dev/null +++ b/app/Http/Controllers/ClientPortalProposalController.php @@ -0,0 +1,70 @@ +propoosalRepo = $propoosalRepo; + } + + public function viewProposal($invitationKey) + { + if (! $invitation = $this->propoosalRepo->findInvitationByKey($invitationKey)) { + return $this->returnError(trans('texts.proposal_not_found')); + } + + $account = $invitation->account; + $proposal = $invitation->proposal; + $invoiceInvitation = Invitation::whereContactId($invitation->contact_id) + ->whereInvoiceId($proposal->invoice_id) + ->firstOrFail(); + + $data = [ + 'proposal' => $proposal, + 'account' => $account, + 'invoiceInvitation' => $invoiceInvitation, + 'proposalInvitation' => $invitation, + ]; + + return view('invited.proposal', $data); + } + + public function downloadProposal($invitationKey) + { + if (! $invitation = $this->propoosalRepo->findInvitationByKey($invitationKey)) { + return $this->returnError(trans('texts.proposal_not_found')); + } + + $proposal = $invitation->proposal; + + $mpdf = new mPDF(); + $mpdf->WriteHTML($proposal->present()->htmlDocument); + $mpdf->Output($proposal->present()->filename, 'D'); + } + + public function getProposalImage($accountKey, $documentKey) + { + $account = Account::whereAccountKey($accountKey) + ->firstOrFail(); + + $document = Document::whereAccountId($account->id) + ->whereDocumentKey($documentKey) + ->whereIsProposal(true) + ->firstOrFail(); + + return DocumentController::getDownloadResponse($document); + } +} diff --git a/app/Http/Controllers/DocumentController.php b/app/Http/Controllers/DocumentController.php index a84cd8ee74..4ed2ea0c09 100644 --- a/app/Http/Controllers/DocumentController.php +++ b/app/Http/Controllers/DocumentController.php @@ -108,7 +108,7 @@ class DocumentController extends BaseController if ($request->grapesjs) { $response = [ 'data' => [ - $result->getUrl() + $result->getProposalUrl() ] ]; } else { diff --git a/app/Http/ViewComposers/ProposalComposer.php b/app/Http/ViewComposers/ProposalComposer.php index 2bcd1944a9..e491b52d65 100644 --- a/app/Http/ViewComposers/ProposalComposer.php +++ b/app/Http/ViewComposers/ProposalComposer.php @@ -38,7 +38,7 @@ class ProposalComposer $data = []; foreach ($documents as $document) { $data[] = [ - 'src' => $document->getUrl(), + 'src' => $document->getProposalUrl(), 'public_id' => $document->public_id, ]; } diff --git a/app/Models/Document.php b/app/Models/Document.php index 90de300f5b..a1d03ee355 100644 --- a/app/Models/Document.php +++ b/app/Models/Document.php @@ -272,6 +272,15 @@ class Document extends EntityModel return url('client/documents/'.$invitation->invitation_key.'/'.$this->public_id.'/'.$this->name); } + public function getProposalUrl() + { + if (! $this->is_proposal || ! $this->document_key) { + return ''; + } + + return url('proposal/image/'. $this->account->account_key . '/' . $this->document_key . '/' . $this->name); + } + /** * @return bool */ diff --git a/app/Ninja/Repositories/DocumentRepository.php b/app/Ninja/Repositories/DocumentRepository.php index 9c50ee88ff..e470348a3a 100644 --- a/app/Ninja/Repositories/DocumentRepository.php +++ b/app/Ninja/Repositories/DocumentRepository.php @@ -54,11 +54,14 @@ class DocumentRepository extends BaseRepository public function upload($data, &$doc_array = null) { - if (! empty($data['files']) && is_array($data['files'])) { + if (! empty($data['grapesjs']) && $data['grapesjs']) { + $isProposal = true; $uploaded = $data['files'][0]; } else { + $isProposal = false; $uploaded = $data['file']; } + $extension = strtolower($uploaded->getClientOriginalExtension()); if (empty(Document::$types[$extension]) && ! empty(Document::$extraExtensions[$extension])) { $documentType = Document::$extraExtensions[$extension]; @@ -91,6 +94,11 @@ class DocumentRepository extends BaseRepository $document = Document::createNew(); $document->fill($data); + if ($isProposal) { + $document->is_proposal = true; + $document->document_key = strtolower(str_random(RANDOM_KEY_LENGTH)); + } + $disk = $document->getDisk(); if (! $disk->exists($filename)) {// Have we already stored the same file $stream = fopen($filePath, 'r'); diff --git a/database/setup.sql b/database/setup.sql index 0ced118eff..6ab2f24735 100644 --- a/database/setup.sql +++ b/database/setup.sql @@ -973,8 +973,11 @@ CREATE TABLE `documents` ( `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `is_default` tinyint(1) DEFAULT '0', + `is_proposal` tinyint(1) NOT NULL DEFAULT '0', + `document_key` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `documents_account_id_public_id_unique` (`account_id`,`public_id`), + UNIQUE KEY `documents_document_key_unique` (`document_key`), KEY `documents_user_id_foreign` (`user_id`), KEY `documents_invoice_id_foreign` (`invoice_id`), KEY `documents_expense_id_foreign` (`expense_id`), @@ -1230,7 +1233,7 @@ CREATE TABLE `gateways` ( LOCK TABLES `gateways` WRITE; /*!40000 ALTER TABLE `gateways` DISABLE KEYS */; -INSERT INTO `gateways` VALUES (1,'2018-02-12 06:39:32','2018-02-12 06:39:32','Authorize.Net AIM','AuthorizeNet_AIM',1,1,5,0,NULL,0,0),(2,'2018-02-12 06:39:32','2018-02-12 06:39:32','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2018-02-12 06:39:32','2018-02-12 06:39:32','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2018-02-12 06:39:32','2018-02-12 06:39:32','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2018-02-12 06:39:32','2018-02-12 06:39:32','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2018-02-12 06:39:32','2018-02-12 06:39:32','GoCardless','GoCardless',1,2,10000,0,NULL,1,0),(7,'2018-02-12 06:39:32','2018-02-12 06:39:32','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2018-02-12 06:39:32','2018-02-12 06:39:32','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2018-02-12 06:39:32','2018-02-12 06:39:32','Mollie','Mollie',1,1,8,0,NULL,1,0),(10,'2018-02-12 06:39:32','2018-02-12 06:39:32','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2018-02-12 06:39:32','2018-02-12 06:39:32','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2018-02-12 06:39:32','2018-02-12 06:39:32','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2018-02-12 06:39:32','2018-02-12 06:39:32','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2018-02-12 06:39:32','2018-02-12 06:39:32','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2018-02-12 06:39:32','2018-02-12 06:39:32','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2018-02-12 06:39:32','2018-02-12 06:39:32','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2018-02-12 06:39:32','2018-02-12 06:39:32','PayPal Express','PayPal_Express',1,1,4,0,NULL,1,0),(18,'2018-02-12 06:39:32','2018-02-12 06:39:32','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2018-02-12 06:39:32','2018-02-12 06:39:32','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2018-02-12 06:39:32','2018-02-12 06:39:32','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2018-02-12 06:39:32','2018-02-12 06:39:32','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2018-02-12 06:39:32','2018-02-12 06:39:32','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2018-02-12 06:39:32','2018-02-12 06:39:32','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2018-02-12 06:39:32','2018-02-12 06:39:32','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2018-02-12 06:39:32','2018-02-12 06:39:32','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2018-02-12 06:39:32','2018-02-12 06:39:32','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2018-02-12 06:39:32','2018-02-12 06:39:32','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2018-02-12 06:39:32','2018-02-12 06:39:32','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2018-02-12 06:39:32','2018-02-12 06:39:32','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2018-02-12 06:39:32','2018-02-12 06:39:32','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2018-02-12 06:39:32','2018-02-12 06:39:32','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2018-02-12 06:39:32','2018-02-12 06:39:32','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2018-02-12 06:39:32','2018-02-12 06:39:32','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2018-02-12 06:39:32','2018-02-12 06:39:32','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2018-02-12 06:39:32','2018-02-12 06:39:32','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2018-02-12 06:39:32','2018-02-12 06:39:32','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2018-02-12 06:39:32','2018-02-12 06:39:32','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2018-02-12 06:39:32','2018-02-12 06:39:32','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2018-02-12 06:39:32','2018-02-12 06:39:32','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2018-02-12 06:39:32','2018-02-12 06:39:32','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2018-02-12 06:39:32','2018-02-12 06:39:32','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2018-02-12 06:39:32','2018-02-12 06:39:32','BitPay','BitPay',1,1,7,0,NULL,1,0),(43,'2018-02-12 06:39:32','2018-02-12 06:39:32','Dwolla','Dwolla',1,1,6,0,NULL,1,0),(44,'2018-02-12 06:39:32','2018-02-12 06:39:32','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2018-02-12 06:39:32','2018-02-12 06:39:32','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2018-02-12 06:39:32','2018-02-12 06:39:32','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2018-02-12 06:39:32','2018-02-12 06:39:32','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2018-02-12 06:39:32','2018-02-12 06:39:32','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2018-02-12 06:39:32','2018-02-12 06:39:32','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2018-02-12 06:39:32','2018-02-12 06:39:32','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2018-02-12 06:39:32','2018-02-12 06:39:32','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2018-02-12 06:39:32','2018-02-12 06:39:32','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2018-02-12 06:39:32','2018-02-12 06:39:32','Multicards','Multicards',1,2,10000,0,NULL,0,0),(54,'2018-02-12 06:39:32','2018-02-12 06:39:32','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2018-02-12 06:39:32','2018-02-12 06:39:32','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2018-02-12 06:39:32','2018-02-12 06:39:32','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2018-02-12 06:39:32','2018-02-12 06:39:32','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2018-02-12 06:39:32','2018-02-12 06:39:32','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2018-02-12 06:39:32','2018-02-12 06:39:32','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2018-02-12 06:39:32','2018-02-12 06:39:32','WePay','WePay',1,1,3,0,NULL,0,0),(61,'2018-02-12 06:39:32','2018-02-12 06:39:32','Braintree','Braintree',1,1,3,0,NULL,0,0),(62,'2018-02-12 06:39:32','2018-02-12 06:39:32','Custom','Custom',1,1,20,0,NULL,1,0),(63,'2018-02-12 06:39:32','2018-02-12 06:39:32','FirstData Payeezy','FirstData_Payeezy',1,1,10000,0,NULL,0,0),(64,'2018-02-12 06:39:32','2018-02-12 06:39:32','GoCardless','GoCardlessV2\\Redirect',1,1,9,0,NULL,1,0),(65,'2018-02-12 06:39:32','2018-02-12 06:39:32','PagSeguro','PagSeguro',1,1,10000,0,NULL,0,0); +INSERT INTO `gateways` VALUES (1,'2018-02-13 08:05:27','2018-02-13 08:05:27','Authorize.Net AIM','AuthorizeNet_AIM',1,1,5,0,NULL,0,0),(2,'2018-02-13 08:05:27','2018-02-13 08:05:27','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2018-02-13 08:05:27','2018-02-13 08:05:27','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2018-02-13 08:05:27','2018-02-13 08:05:27','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2018-02-13 08:05:27','2018-02-13 08:05:27','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2018-02-13 08:05:27','2018-02-13 08:05:27','GoCardless','GoCardless',1,2,10000,0,NULL,1,0),(7,'2018-02-13 08:05:27','2018-02-13 08:05:27','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2018-02-13 08:05:27','2018-02-13 08:05:27','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2018-02-13 08:05:27','2018-02-13 08:05:27','Mollie','Mollie',1,1,8,0,NULL,1,0),(10,'2018-02-13 08:05:27','2018-02-13 08:05:27','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2018-02-13 08:05:27','2018-02-13 08:05:27','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2018-02-13 08:05:27','2018-02-13 08:05:27','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2018-02-13 08:05:27','2018-02-13 08:05:27','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2018-02-13 08:05:27','2018-02-13 08:05:27','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2018-02-13 08:05:27','2018-02-13 08:05:27','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2018-02-13 08:05:27','2018-02-13 08:05:27','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2018-02-13 08:05:27','2018-02-13 08:05:27','PayPal Express','PayPal_Express',1,1,4,0,NULL,1,0),(18,'2018-02-13 08:05:27','2018-02-13 08:05:27','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2018-02-13 08:05:27','2018-02-13 08:05:27','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2018-02-13 08:05:27','2018-02-13 08:05:27','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2018-02-13 08:05:27','2018-02-13 08:05:27','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2018-02-13 08:05:27','2018-02-13 08:05:27','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2018-02-13 08:05:27','2018-02-13 08:05:27','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2018-02-13 08:05:27','2018-02-13 08:05:27','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2018-02-13 08:05:27','2018-02-13 08:05:27','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2018-02-13 08:05:27','2018-02-13 08:05:27','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2018-02-13 08:05:27','2018-02-13 08:05:27','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2018-02-13 08:05:27','2018-02-13 08:05:27','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2018-02-13 08:05:27','2018-02-13 08:05:27','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2018-02-13 08:05:27','2018-02-13 08:05:27','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2018-02-13 08:05:27','2018-02-13 08:05:27','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2018-02-13 08:05:27','2018-02-13 08:05:27','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2018-02-13 08:05:27','2018-02-13 08:05:27','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2018-02-13 08:05:27','2018-02-13 08:05:27','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2018-02-13 08:05:27','2018-02-13 08:05:27','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2018-02-13 08:05:27','2018-02-13 08:05:27','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2018-02-13 08:05:27','2018-02-13 08:05:27','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2018-02-13 08:05:27','2018-02-13 08:05:27','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2018-02-13 08:05:27','2018-02-13 08:05:27','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2018-02-13 08:05:27','2018-02-13 08:05:27','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2018-02-13 08:05:27','2018-02-13 08:05:27','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2018-02-13 08:05:27','2018-02-13 08:05:27','BitPay','BitPay',1,1,7,0,NULL,1,0),(43,'2018-02-13 08:05:27','2018-02-13 08:05:27','Dwolla','Dwolla',1,1,6,0,NULL,1,0),(44,'2018-02-13 08:05:27','2018-02-13 08:05:27','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2018-02-13 08:05:27','2018-02-13 08:05:27','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2018-02-13 08:05:27','2018-02-13 08:05:27','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2018-02-13 08:05:28','2018-02-13 08:05:28','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2018-02-13 08:05:28','2018-02-13 08:05:28','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2018-02-13 08:05:28','2018-02-13 08:05:28','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2018-02-13 08:05:28','2018-02-13 08:05:28','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2018-02-13 08:05:28','2018-02-13 08:05:28','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2018-02-13 08:05:28','2018-02-13 08:05:28','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2018-02-13 08:05:28','2018-02-13 08:05:28','Multicards','Multicards',1,2,10000,0,NULL,0,0),(54,'2018-02-13 08:05:28','2018-02-13 08:05:28','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2018-02-13 08:05:28','2018-02-13 08:05:28','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2018-02-13 08:05:28','2018-02-13 08:05:28','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2018-02-13 08:05:28','2018-02-13 08:05:28','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2018-02-13 08:05:28','2018-02-13 08:05:28','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2018-02-13 08:05:28','2018-02-13 08:05:28','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2018-02-13 08:05:28','2018-02-13 08:05:28','WePay','WePay',1,1,3,0,NULL,0,0),(61,'2018-02-13 08:05:28','2018-02-13 08:05:28','Braintree','Braintree',1,1,3,0,NULL,0,0),(62,'2018-02-13 08:05:28','2018-02-13 08:05:28','Custom','Custom',1,1,20,0,NULL,1,0),(63,'2018-02-13 08:05:28','2018-02-13 08:05:28','FirstData Payeezy','FirstData_Payeezy',1,1,10000,0,NULL,0,0),(64,'2018-02-13 08:05:28','2018-02-13 08:05:28','GoCardless','GoCardlessV2\\Redirect',1,1,9,0,NULL,1,0),(65,'2018-02-13 08:05:28','2018-02-13 08:05:28','PagSeguro','PagSeguro',1,1,10000,0,NULL,0,0); /*!40000 ALTER TABLE `gateways` ENABLE KEYS */; UNLOCK TABLES; @@ -1838,7 +1841,7 @@ CREATE TABLE `payment_libraries` ( LOCK TABLES `payment_libraries` WRITE; /*!40000 ALTER TABLE `payment_libraries` DISABLE KEYS */; -INSERT INTO `payment_libraries` VALUES (1,'2018-02-12 06:39:31','2018-02-12 06:39:31','Omnipay',1),(2,'2018-02-12 06:39:31','2018-02-12 06:39:31','PHP-Payments [Deprecated]',1); +INSERT INTO `payment_libraries` VALUES (1,'2018-02-13 08:05:25','2018-02-13 08:05:25','Omnipay',1),(2,'2018-02-13 08:05:25','2018-02-13 08:05:25','PHP-Payments [Deprecated]',1); /*!40000 ALTER TABLE `payment_libraries` ENABLE KEYS */; UNLOCK TABLES; @@ -1945,7 +1948,7 @@ CREATE TABLE `payment_terms` ( LOCK TABLES `payment_terms` WRITE; /*!40000 ALTER TABLE `payment_terms` DISABLE KEYS */; -INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2018-02-12 06:39:31','2018-02-12 06:39:31',NULL,0,0,1),(2,10,'Net 10','2018-02-12 06:39:31','2018-02-12 06:39:31',NULL,0,0,2),(3,14,'Net 14','2018-02-12 06:39:31','2018-02-12 06:39:31',NULL,0,0,3),(4,15,'Net 15','2018-02-12 06:39:31','2018-02-12 06:39:31',NULL,0,0,4),(5,30,'Net 30','2018-02-12 06:39:31','2018-02-12 06:39:31',NULL,0,0,5),(6,60,'Net 60','2018-02-12 06:39:31','2018-02-12 06:39:31',NULL,0,0,6),(7,90,'Net 90','2018-02-12 06:39:31','2018-02-12 06:39:31',NULL,0,0,7); +INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2018-02-13 08:05:25','2018-02-13 08:05:25',NULL,0,0,1),(2,10,'Net 10','2018-02-13 08:05:25','2018-02-13 08:05:25',NULL,0,0,2),(3,14,'Net 14','2018-02-13 08:05:25','2018-02-13 08:05:25',NULL,0,0,3),(4,15,'Net 15','2018-02-13 08:05:25','2018-02-13 08:05:25',NULL,0,0,4),(5,30,'Net 30','2018-02-13 08:05:25','2018-02-13 08:05:25',NULL,0,0,5),(6,60,'Net 60','2018-02-13 08:05:25','2018-02-13 08:05:25',NULL,0,0,6),(7,90,'Net 90','2018-02-13 08:05:25','2018-02-13 08:05:25',NULL,0,0,7); /*!40000 ALTER TABLE `payment_terms` ENABLE KEYS */; UNLOCK TABLES; @@ -2868,4 +2871,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2018-02-12 10:39:35 +-- Dump completed on 2018-02-13 12:05:31 diff --git a/routes/web.php b/routes/web.php index ef6de62652..aced6b9f96 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,9 +16,8 @@ Route::post('/get_started', 'AccountController@getStarted'); // Client visible pages Route::group(['middleware' => ['lookup:contact', 'auth:client']], function () { Route::get('view/{invitation_key}', 'ClientPortalController@viewInvoice'); - Route::get('proposal/{proposal_invitation_key}/download', 'ClientPortalController@downloadProposal'); - Route::get('proposal/{proposal_invitation_key}', 'ClientPortalController@viewProposal'); - //Route::get('proposal/document/{account_key}/{public_id}/{filename?}', 'ClientPortalController@getProposalDocument'); + Route::get('proposal/{proposal_invitation_key}/download', 'ClientPortalProposalController@downloadProposal'); + Route::get('proposal/{proposal_invitation_key}', 'ClientPortalProposalController@viewProposal'); Route::get('download/{invitation_key}', 'ClientPortalController@download'); Route::put('sign/{invitation_key}', 'ClientPortalController@sign'); Route::get('view', 'HomeController@viewLogo'); @@ -107,6 +106,7 @@ Route::group(['middleware' => ['lookup:contact']], function () { Route::post('/client/login', ['as' => 'login', 'uses' => 'ClientAuth\LoginController@login']); Route::post('/client/recover_password', ['as' => 'forgot', 'uses' => 'ClientAuth\ForgotPasswordController@sendResetLinkEmail']); Route::post('/client/password/reset', ['as' => 'forgot', 'uses' => 'ClientAuth\ResetPasswordController@reset']); + Route::get('/proposal/image/{account_key}/{document_key}/{filename?}', 'ClientPortalProposalController@getProposalImage'); }); if (Utils::isReseller()) {