diff --git a/app/Console/Commands/DemoMode.php b/app/Console/Commands/DemoMode.php index 6e62da7eff..15093de718 100644 --- a/app/Console/Commands/DemoMode.php +++ b/app/Console/Commands/DemoMode.php @@ -100,7 +100,7 @@ class DemoMode extends Command $company = factory(\App\Models\Company::class)->create([ 'account_id' => $account->id, 'slack_webhook_url' => config('ninja.notification.slack'), - 'enabled_modules' => 4095, + 'enabled_modules' => 8191, ]); $settings = $company->settings; diff --git a/app/Factory/CompanyFactory.php b/app/Factory/CompanyFactory.php index d5a1649231..da387a0efa 100644 --- a/app/Factory/CompanyFactory.php +++ b/app/Factory/CompanyFactory.php @@ -34,7 +34,7 @@ class CompanyFactory //$company->custom_fields = (object) ['invoice1' => '1', 'invoice2' => '2', 'client1'=>'3']; $company->custom_fields = (object) []; $company->subdomain = ''; - $company->enabled_modules = 4095; //16383 + $company->enabled_modules = 8191; //4095 return $company; } diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index a0cb64afc8..a7ff06bea7 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -373,6 +373,7 @@ class Import implements ShouldQueue $modified['company_id'] = $this->company->id; $modified['user_id'] = $this->processUserId($resource); $modified['balance'] = $modified['balance'] ?: 0; + $modified['paid_to_date'] = $modified['paid_to_date'] ?: 0; unset($modified['id']); unset($modified['contacts']); diff --git a/app/Repositories/Migration/PaymentMigrationRepository.php b/app/Repositories/Migration/PaymentMigrationRepository.php index 2141646269..8c6c3197af 100644 --- a/app/Repositories/Migration/PaymentMigrationRepository.php +++ b/app/Repositories/Migration/PaymentMigrationRepository.php @@ -23,6 +23,7 @@ use App\Models\Payment; use App\Repositories\ActivityRepository; use App\Repositories\BaseRepository; use App\Repositories\CreditRepository; +use App\Utils\Ninja; use App\Utils\Traits\MakesHash; use App\Utils\Traits\SavesDocuments; use Illuminate\Http\Request; @@ -128,7 +129,7 @@ class PaymentMigrationRepository extends BaseRepository foreach ($payment->invoices as $invoice) { $fields->invoice_id = $invoice->id; - $this->activity_repo->save($fields, $invoice); + $this->activity_repo->save($fields, $invoice, Ninja::eventVars()); } if (count($invoices) == 0) { diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index 560ceb08bb..bb020019bd 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -21,6 +21,7 @@ use App\Models\Credit; use App\Models\Invoice; use App\Models\Payment; use App\Repositories\ActivityRepository; +use App\Utils\Ninja; class RefundPayment { @@ -114,10 +115,10 @@ class RefundPayment if (isset($this->refund_data['invoices'])) { foreach ($this->refund_data['invoices'] as $invoice) { $fields->invoice_id = $invoice['invoice_id']; - $activity_repo->save($fields, $this->payment); + $activity_repo->save($fields, $this->payment, Ninja::eventVars()); } } else { - $activity_repo->save($fields, $this->payment); + $activity_repo->save($fields, $this->payment, Ninja::eventVars()); } return $this; diff --git a/app/Utils/Traits/Payment/Refundable.php b/app/Utils/Traits/Payment/Refundable.php index df54f35d04..c31f83ea7f 100644 --- a/app/Utils/Traits/Payment/Refundable.php +++ b/app/Utils/Traits/Payment/Refundable.php @@ -20,6 +20,7 @@ use App\Models\Credit; use App\Models\Invoice; use App\Models\Payment; use App\Repositories\ActivityRepository; +use App\Utils\Ninja; trait Refundable { @@ -209,10 +210,10 @@ trait Refundable foreach ($data['invoices'] as $invoice) { $fields->invoice_id = $invoice->id; - $activity_repo->save($fields, $this); + $activity_repo->save($fields, $this, Ninja::eventVars()); } } else { - $activity_repo->save($fields, $this); + $activity_repo->save($fields, $this, Ninja::eventVars()); } }