diff --git a/app/Http/Controllers/ClientPortalController.php b/app/Http/Controllers/ClientPortalController.php index 9800a1ed1651..b91794a199c1 100644 --- a/app/Http/Controllers/ClientPortalController.php +++ b/app/Http/Controllers/ClientPortalController.php @@ -651,7 +651,9 @@ class ClientPortalController extends BaseController $documents = $invoice->documents; foreach ($invoice->expenses as $expense) { - $documents = $documents->merge($expense->documents); + if ($expense->invoice_documents) { + $documents = $documents->merge($expense->documents); + } } $documents = $documents->sortBy('size'); @@ -740,7 +742,7 @@ class ClientPortalController extends BaseController $document = Document::scope($publicId, $invitation->account_id)->firstOrFail(); $authorized = false; - if ($document->expense && $document->expense->client_id == $invitation->invoice->client_id) { + if ($document->expense && $document->expense->invoice_documents && $document->expense->client_id == $invitation->invoice->client_id) { $authorized = true; } elseif ($document->invoice && $document->invoice->client_id == $invitation->invoice->client_id) { $authorized = true; diff --git a/app/Models/Expense.php b/app/Models/Expense.php index a14625ea8390..3004e2efa75e 100644 --- a/app/Models/Expense.php +++ b/app/Models/Expense.php @@ -50,6 +50,7 @@ class Expense extends EntityModel 'payment_date', 'payment_type_id', 'transaction_reference', + 'invoice_documents', ]; public static function getImportColumns() diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index eeb845542926..de4cd74ca417 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -1405,6 +1405,22 @@ class Invoice extends EntityModel implements BalanceAffecting $taxes[$key]['paid'] += $paid; } + /** + * @return int + */ + public function countDocuments() + { + $count = count($this->documents); + + foreach ($this->expenses as $expense) { + if ($expense->invoice_documents) { + $count += count($expense->documents); + } + } + + return $count; + } + /** * @return bool */ @@ -1423,7 +1439,7 @@ class Invoice extends EntityModel implements BalanceAffecting public function hasExpenseDocuments() { foreach ($this->expenses as $expense) { - if (count($expense->documents)) { + if ($expense->invoice_documents && count($expense->documents)) { return true; } } diff --git a/database/migrations/2017_04_16_101744_add_custom_contact_fields.php b/database/migrations/2017_04_16_101744_add_custom_contact_fields.php index 89136dbbb6d1..f438dcdc630b 100644 --- a/database/migrations/2017_04_16_101744_add_custom_contact_fields.php +++ b/database/migrations/2017_04_16_101744_add_custom_contact_fields.php @@ -44,6 +44,7 @@ class AddCustomContactFields extends Migration $table->date('payment_date')->nullable(); $table->string('transaction_reference')->nullable(); $table->foreign('payment_type_id')->references('id')->on('payment_types'); + $table->boolean('invoice_documents')->default(true); }); // remove duplicate annual frequency @@ -76,6 +77,7 @@ class AddCustomContactFields extends Migration $table->dropColumn('payment_type_id'); $table->dropColumn('payment_date'); $table->dropColumn('transaction_reference'); + $table->dropColumn('invoice_documents'); }); } } diff --git a/database/setup.sql b/database/setup.sql index feab4ea6a0af..a61948a32833 100644 --- a/database/setup.sql +++ b/database/setup.sql @@ -1,8 +1,8 @@ --- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64) +-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) -- -- Host: localhost Database: ninja -- ------------------------------------------------------ --- Server version 5.7.17-0ubuntu0.16.04.1 +-- Server version 5.7.18-0ubuntu0.16.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -1018,6 +1018,7 @@ CREATE TABLE `expenses` ( `payment_type_id` int(10) unsigned DEFAULT NULL, `payment_date` date DEFAULT NULL, `transaction_reference` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, + `invoice_documents` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`), UNIQUE KEY `expenses_account_id_public_id_unique` (`account_id`,`public_id`), KEY `expenses_user_id_foreign` (`user_id`), @@ -1185,7 +1186,7 @@ CREATE TABLE `gateways` ( LOCK TABLES `gateways` WRITE; /*!40000 ALTER TABLE `gateways` DISABLE KEYS */; -INSERT INTO `gateways` VALUES (1,'2017-04-27 04:38:57','2017-04-27 04:38:57','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-04-27 04:38:57','2017-04-27 04:38:57','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-04-27 04:38:57','2017-04-27 04:38:57','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-04-27 04:38:57','2017-04-27 04:38:57','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-04-27 04:38:57','2017-04-27 04:38:57','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-04-27 04:38:57','2017-04-27 04:38:57','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-04-27 04:38:57','2017-04-27 04:38:57','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-04-27 04:38:57','2017-04-27 04:38:57','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-04-27 04:38:57','2017-04-27 04:38:57','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-04-27 04:38:57','2017-04-27 04:38:57','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-04-27 04:38:57','2017-04-27 04:38:57','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-04-27 04:38:57','2017-04-27 04:38:57','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-04-27 04:38:57','2017-04-27 04:38:57','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-04-27 04:38:57','2017-04-27 04:38:57','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-04-27 04:38:57','2017-04-27 04:38:57','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-04-27 04:38:57','2017-04-27 04:38:57','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-04-27 04:38:57','2017-04-27 04:38:57','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-04-27 04:38:57','2017-04-27 04:38:57','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-04-27 04:38:57','2017-04-27 04:38:57','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-04-27 04:38:57','2017-04-27 04:38:57','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-04-27 04:38:57','2017-04-27 04:38:57','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-04-27 04:38:57','2017-04-27 04:38:57','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-04-27 04:38:57','2017-04-27 04:38:57','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-04-27 04:38:57','2017-04-27 04:38:57','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-04-27 04:38:57','2017-04-27 04:38:57','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-04-27 04:38:57','2017-04-27 04:38:57','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-04-27 04:38:57','2017-04-27 04:38:57','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-04-27 04:38:57','2017-04-27 04:38:57','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-04-27 04:38:57','2017-04-27 04:38:57','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-04-27 04:38:57','2017-04-27 04:38:57','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-04-27 04:38:57','2017-04-27 04:38:57','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-04-27 04:38:57','2017-04-27 04:38:57','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-04-27 04:38:57','2017-04-27 04:38:57','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-04-27 04:38:57','2017-04-27 04:38:57','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-04-27 04:38:57','2017-04-27 04:38:57','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-04-27 04:38:57','2017-04-27 04:38:57','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-04-27 04:38:57','2017-04-27 04:38:57','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-04-27 04:38:57','2017-04-27 04:38:57','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-04-27 04:38:57','2017-04-27 04:38:57','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-04-27 04:38:57','2017-04-27 04:38:57','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-04-27 04:38:57','2017-04-27 04:38:57','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-04-27 04:38:57','2017-04-27 04:38:57','BitPay','BitPay',1,1,6,0,NULL,1,0),(43,'2017-04-27 04:38:57','2017-04-27 04:38:57','Dwolla','Dwolla',1,1,5,0,NULL,1,0),(44,'2017-04-27 04:38:57','2017-04-27 04:38:57','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2017-04-27 04:38:57','2017-04-27 04:38:57','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2017-04-27 04:38:57','2017-04-27 04:38:57','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2017-04-27 04:38:57','2017-04-27 04:38:57','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2017-04-27 04:38:57','2017-04-27 04:38:57','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2017-04-27 04:38:57','2017-04-27 04:38:57','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2017-04-27 04:38:57','2017-04-27 04:38:57','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2017-04-27 04:38:57','2017-04-27 04:38:57','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2017-04-27 04:38:57','2017-04-27 04:38:57','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2017-04-27 04:38:57','2017-04-27 04:38:57','Multicards','Multicards',1,1,10000,0,NULL,0,0),(54,'2017-04-27 04:38:57','2017-04-27 04:38:57','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2017-04-27 04:38:57','2017-04-27 04:38:57','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2017-04-27 04:38:57','2017-04-27 04:38:57','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2017-04-27 04:38:57','2017-04-27 04:38:57','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2017-04-27 04:38:57','2017-04-27 04:38:57','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2017-04-27 04:38:57','2017-04-27 04:38:57','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2017-04-27 04:38:57','2017-04-27 04:38:57','WePay','WePay',1,1,10000,0,NULL,0,0),(61,'2017-04-27 04:38:57','2017-04-27 04:38:57','Braintree','Braintree',1,1,2,0,NULL,0,0),(62,'2017-04-27 04:38:57','2017-04-27 04:38:57','Custom','Custom',1,1,8,0,NULL,1,0); +INSERT INTO `gateways` VALUES (1,'2017-04-28 09:15:42','2017-04-28 09:15:42','Authorize.Net AIM','AuthorizeNet_AIM',1,1,4,0,NULL,0,0),(2,'2017-04-28 09:15:42','2017-04-28 09:15:42','Authorize.Net SIM','AuthorizeNet_SIM',1,2,10000,0,NULL,0,0),(3,'2017-04-28 09:15:42','2017-04-28 09:15:42','CardSave','CardSave',1,1,10000,0,NULL,0,0),(4,'2017-04-28 09:15:42','2017-04-28 09:15:42','Eway Rapid','Eway_RapidShared',1,1,10000,0,NULL,1,0),(5,'2017-04-28 09:15:42','2017-04-28 09:15:42','FirstData Connect','FirstData_Connect',1,1,10000,0,NULL,0,0),(6,'2017-04-28 09:15:42','2017-04-28 09:15:42','GoCardless','GoCardless',1,1,10000,0,NULL,1,0),(7,'2017-04-28 09:15:42','2017-04-28 09:15:42','Migs ThreeParty','Migs_ThreeParty',1,1,10000,0,NULL,0,0),(8,'2017-04-28 09:15:42','2017-04-28 09:15:42','Migs TwoParty','Migs_TwoParty',1,1,10000,0,NULL,0,0),(9,'2017-04-28 09:15:42','2017-04-28 09:15:42','Mollie','Mollie',1,1,7,0,NULL,1,0),(10,'2017-04-28 09:15:42','2017-04-28 09:15:42','MultiSafepay','MultiSafepay',1,1,10000,0,NULL,0,0),(11,'2017-04-28 09:15:42','2017-04-28 09:15:42','Netaxept','Netaxept',1,1,10000,0,NULL,0,0),(12,'2017-04-28 09:15:42','2017-04-28 09:15:42','NetBanx','NetBanx',1,1,10000,0,NULL,0,0),(13,'2017-04-28 09:15:42','2017-04-28 09:15:42','PayFast','PayFast',1,1,10000,0,NULL,1,0),(14,'2017-04-28 09:15:42','2017-04-28 09:15:42','Payflow Pro','Payflow_Pro',1,1,10000,0,NULL,0,0),(15,'2017-04-28 09:15:42','2017-04-28 09:15:42','PaymentExpress PxPay','PaymentExpress_PxPay',1,1,10000,0,NULL,0,0),(16,'2017-04-28 09:15:42','2017-04-28 09:15:42','PaymentExpress PxPost','PaymentExpress_PxPost',1,1,10000,0,NULL,0,0),(17,'2017-04-28 09:15:42','2017-04-28 09:15:42','PayPal Express','PayPal_Express',1,1,3,0,NULL,1,0),(18,'2017-04-28 09:15:42','2017-04-28 09:15:42','PayPal Pro','PayPal_Pro',1,1,10000,0,NULL,0,0),(19,'2017-04-28 09:15:42','2017-04-28 09:15:42','Pin','Pin',1,1,10000,0,NULL,0,0),(20,'2017-04-28 09:15:42','2017-04-28 09:15:42','SagePay Direct','SagePay_Direct',1,1,10000,0,NULL,0,0),(21,'2017-04-28 09:15:42','2017-04-28 09:15:42','SagePay Server','SagePay_Server',1,1,10000,0,NULL,0,0),(22,'2017-04-28 09:15:42','2017-04-28 09:15:42','SecurePay DirectPost','SecurePay_DirectPost',1,1,10000,0,NULL,0,0),(23,'2017-04-28 09:15:42','2017-04-28 09:15:42','Stripe','Stripe',1,1,1,0,NULL,0,0),(24,'2017-04-28 09:15:42','2017-04-28 09:15:42','TargetPay Direct eBanking','TargetPay_Directebanking',1,1,10000,0,NULL,0,0),(25,'2017-04-28 09:15:42','2017-04-28 09:15:42','TargetPay Ideal','TargetPay_Ideal',1,1,10000,0,NULL,0,0),(26,'2017-04-28 09:15:42','2017-04-28 09:15:42','TargetPay Mr Cash','TargetPay_Mrcash',1,1,10000,0,NULL,0,0),(27,'2017-04-28 09:15:42','2017-04-28 09:15:42','TwoCheckout','TwoCheckout',1,1,10000,0,NULL,1,0),(28,'2017-04-28 09:15:42','2017-04-28 09:15:42','WorldPay','WorldPay',1,1,10000,0,NULL,0,0),(29,'2017-04-28 09:15:42','2017-04-28 09:15:42','BeanStream','BeanStream',1,2,10000,0,NULL,0,0),(30,'2017-04-28 09:15:42','2017-04-28 09:15:42','Psigate','Psigate',1,2,10000,0,NULL,0,0),(31,'2017-04-28 09:15:42','2017-04-28 09:15:42','moolah','AuthorizeNet_AIM',1,1,10000,0,NULL,0,0),(32,'2017-04-28 09:15:42','2017-04-28 09:15:42','Alipay','Alipay_Express',1,1,10000,0,NULL,0,0),(33,'2017-04-28 09:15:42','2017-04-28 09:15:42','Buckaroo','Buckaroo_CreditCard',1,1,10000,0,NULL,0,0),(34,'2017-04-28 09:15:42','2017-04-28 09:15:42','Coinbase','Coinbase',1,1,10000,0,NULL,0,0),(35,'2017-04-28 09:15:42','2017-04-28 09:15:42','DataCash','DataCash',1,1,10000,0,NULL,0,0),(36,'2017-04-28 09:15:42','2017-04-28 09:15:42','Neteller','Neteller',1,2,10000,0,NULL,0,0),(37,'2017-04-28 09:15:42','2017-04-28 09:15:42','Pacnet','Pacnet',1,1,10000,0,NULL,0,0),(38,'2017-04-28 09:15:42','2017-04-28 09:15:42','PaymentSense','PaymentSense',1,2,10000,0,NULL,0,0),(39,'2017-04-28 09:15:42','2017-04-28 09:15:42','Realex','Realex_Remote',1,1,10000,0,NULL,0,0),(40,'2017-04-28 09:15:42','2017-04-28 09:15:42','Sisow','Sisow',1,1,10000,0,NULL,0,0),(41,'2017-04-28 09:15:42','2017-04-28 09:15:42','Skrill','Skrill',1,1,10000,0,NULL,1,0),(42,'2017-04-28 09:15:42','2017-04-28 09:15:42','BitPay','BitPay',1,1,6,0,NULL,1,0),(43,'2017-04-28 09:15:42','2017-04-28 09:15:42','Dwolla','Dwolla',1,1,5,0,NULL,1,0),(44,'2017-04-28 09:15:42','2017-04-28 09:15:42','AGMS','Agms',1,1,10000,0,NULL,0,0),(45,'2017-04-28 09:15:42','2017-04-28 09:15:42','Barclays','BarclaysEpdq\\Essential',1,1,10000,0,NULL,0,0),(46,'2017-04-28 09:15:42','2017-04-28 09:15:42','Cardgate','Cardgate',1,1,10000,0,NULL,0,0),(47,'2017-04-28 09:15:42','2017-04-28 09:15:42','Checkout.com','CheckoutCom',1,1,10000,0,NULL,0,0),(48,'2017-04-28 09:15:42','2017-04-28 09:15:42','Creditcall','Creditcall',1,1,10000,0,NULL,0,0),(49,'2017-04-28 09:15:42','2017-04-28 09:15:42','Cybersource','Cybersource',1,1,10000,0,NULL,0,0),(50,'2017-04-28 09:15:42','2017-04-28 09:15:42','ecoPayz','Ecopayz',1,1,10000,0,NULL,0,0),(51,'2017-04-28 09:15:42','2017-04-28 09:15:42','Fasapay','Fasapay',1,1,10000,0,NULL,0,0),(52,'2017-04-28 09:15:42','2017-04-28 09:15:42','Komoju','Komoju',1,1,10000,0,NULL,0,0),(53,'2017-04-28 09:15:42','2017-04-28 09:15:42','Multicards','Multicards',1,1,10000,0,NULL,0,0),(54,'2017-04-28 09:15:42','2017-04-28 09:15:42','Pagar.Me','Pagarme',1,2,10000,0,NULL,0,0),(55,'2017-04-28 09:15:42','2017-04-28 09:15:42','Paysafecard','Paysafecard',1,1,10000,0,NULL,0,0),(56,'2017-04-28 09:15:42','2017-04-28 09:15:42','Paytrace','Paytrace_CreditCard',1,1,10000,0,NULL,0,0),(57,'2017-04-28 09:15:42','2017-04-28 09:15:42','Secure Trading','SecureTrading',1,1,10000,0,NULL,0,0),(58,'2017-04-28 09:15:42','2017-04-28 09:15:42','SecPay','SecPay',1,1,10000,0,NULL,0,0),(59,'2017-04-28 09:15:42','2017-04-28 09:15:42','WeChat Express','WeChat_Express',1,2,10000,0,NULL,0,0),(60,'2017-04-28 09:15:42','2017-04-28 09:15:42','WePay','WePay',1,1,10000,0,NULL,0,0),(61,'2017-04-28 09:15:42','2017-04-28 09:15:42','Braintree','Braintree',1,1,2,0,NULL,0,0),(62,'2017-04-28 09:15:42','2017-04-28 09:15:42','Custom','Custom',1,1,8,0,NULL,1,0); /*!40000 ALTER TABLE `gateways` ENABLE KEYS */; UNLOCK TABLES; @@ -1603,7 +1604,7 @@ CREATE TABLE `payment_libraries` ( LOCK TABLES `payment_libraries` WRITE; /*!40000 ALTER TABLE `payment_libraries` DISABLE KEYS */; -INSERT INTO `payment_libraries` VALUES (1,'2017-04-27 04:38:55','2017-04-27 04:38:55','Omnipay',1),(2,'2017-04-27 04:38:55','2017-04-27 04:38:55','PHP-Payments [Deprecated]',1); +INSERT INTO `payment_libraries` VALUES (1,'2017-04-28 09:15:40','2017-04-28 09:15:40','Omnipay',1),(2,'2017-04-28 09:15:40','2017-04-28 09:15:40','PHP-Payments [Deprecated]',1); /*!40000 ALTER TABLE `payment_libraries` ENABLE KEYS */; UNLOCK TABLES; @@ -1713,7 +1714,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','2017-04-27 04:38:55','2017-04-27 04:38:55',NULL,0,0,1),(2,10,'Net 10','2017-04-27 04:38:55','2017-04-27 04:38:55',NULL,0,0,2),(3,14,'Net 14','2017-04-27 04:38:55','2017-04-27 04:38:55',NULL,0,0,3),(4,15,'Net 15','2017-04-27 04:38:55','2017-04-27 04:38:55',NULL,0,0,4),(5,30,'Net 30','2017-04-27 04:38:55','2017-04-27 04:38:55',NULL,0,0,5),(6,60,'Net 60','2017-04-27 04:38:55','2017-04-27 04:38:55',NULL,0,0,6),(7,90,'Net 90','2017-04-27 04:38:55','2017-04-27 04:38:55',NULL,0,0,7),(8,-1,'Net 0','2017-04-27 04:38:59','2017-04-27 04:38:59',NULL,0,0,0); +INSERT INTO `payment_terms` VALUES (1,7,'Net 7','2017-04-28 09:15:40','2017-04-28 09:15:40',NULL,0,0,1),(2,10,'Net 10','2017-04-28 09:15:40','2017-04-28 09:15:40',NULL,0,0,2),(3,14,'Net 14','2017-04-28 09:15:40','2017-04-28 09:15:40',NULL,0,0,3),(4,15,'Net 15','2017-04-28 09:15:40','2017-04-28 09:15:40',NULL,0,0,4),(5,30,'Net 30','2017-04-28 09:15:40','2017-04-28 09:15:40',NULL,0,0,5),(6,60,'Net 60','2017-04-28 09:15:40','2017-04-28 09:15:40',NULL,0,0,6),(7,90,'Net 90','2017-04-28 09:15:40','2017-04-28 09:15:40',NULL,0,0,7),(8,-1,'Net 0','2017-04-28 09:15:44','2017-04-28 09:15:44',NULL,0,0,0); /*!40000 ALTER TABLE `payment_terms` ENABLE KEYS */; UNLOCK TABLES; @@ -2308,4 +2309,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2017-04-27 10:39:00 +-- Dump completed on 2017-04-28 15:15:45 diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index af1428ffa49e..c56b1335e247 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -2481,7 +2481,7 @@ $LANG = array( 'custom_contact_fields_help' => 'Add a field when creating a contact and display the label and value on the PDF.', 'datatable_info' => 'Showing :start to :end of :total entries', 'credit_total' => 'Credit Total', - 'mark_billable' => 'Mark Billable', + 'mark_billable' => 'Mark billable', 'billed' => 'Billed', 'company_variables' => 'Company Variables', 'client_variables' => 'Client Variables', @@ -2489,6 +2489,8 @@ $LANG = array( 'navigation_variables' => 'Navigation Variables', 'custom_variables' => 'Custom Variables', 'invalid_file' => 'Invalid file type', + 'add_documents_to_invoice' => 'Add documents to invoice', + 'mark_expense_paid' => 'Mark paid', ); diff --git a/resources/views/expenses/edit.blade.php b/resources/views/expenses/edit.blade.php index 05ced57c9404..2be683e8234a 100644 --- a/resources/views/expenses/edit.blade.php +++ b/resources/views/expenses/edit.blade.php @@ -89,7 +89,7 @@ @if (! $expense || ! $expense->isPaid()) {!! Former::checkbox('mark_paid') ->data_bind('checked: mark_paid') - ->text(trans('texts.mark_paid')) + ->text(trans('texts.mark_expense_paid')) ->label(' ') ->value(1) !!} @endif @@ -181,6 +181,15 @@ @endif + @if ($account->hasFeature(FEATURE_DOCUMENTS)) + {!! Former::checkbox('invoice_documents') + ->text(trans('texts.add_documents_to_invoice')) + ->onchange('onInvoiceDocumentsChange()') + ->data_bind('checked: invoice_documents') + ->label(' ') + ->value(1) !!} + @endif +