From 651a1a6cbeb376aa4655b8045050792f32c628e3 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 26 Oct 2020 13:06:24 +1100 Subject: [PATCH] Add credit gateway type id --- app/Services/Invoice/AutoBillInvoice.php | 1 + database/seeders/GatewayTypesSeeder.php | 1 + database/seeders/PaymentTypesSeeder.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Services/Invoice/AutoBillInvoice.php b/app/Services/Invoice/AutoBillInvoice.php index 36b296c065..582f4f60fb 100644 --- a/app/Services/Invoice/AutoBillInvoice.php +++ b/app/Services/Invoice/AutoBillInvoice.php @@ -116,6 +116,7 @@ class AutoBillInvoice extends AbstractService $payment->currency_id = $this->invoice->client->getSetting('currency_id'); $payment->date = now(); $payment->status_id = Payment::STATUS_COMPLETED; + $payment->type_id = PaymentType::CREDIT; $payment->service()->applyNumber()->save(); $payment->invoices()->attach($this->invoice->id, ['amount' => $amount]); diff --git a/database/seeders/GatewayTypesSeeder.php b/database/seeders/GatewayTypesSeeder.php index 25a814132b..8faed88b24 100644 --- a/database/seeders/GatewayTypesSeeder.php +++ b/database/seeders/GatewayTypesSeeder.php @@ -35,6 +35,7 @@ class GatewayTypesSeeder extends Seeder ['id' => 11, 'alias' => 'apple_pay', 'name' => 'Apple Pay'], ['id' => 12, 'alias' => 'custom2', 'name' => 'Custom'], ['id' => 13, 'alias' => 'custom3', 'name' => 'Custom'], + ['id' => 14, 'alias' => 'credit', 'name' => 'Credit'], ]; foreach ($gateway_types as $gateway_type) { diff --git a/database/seeders/PaymentTypesSeeder.php b/database/seeders/PaymentTypesSeeder.php index c2756cf52b..eaae804a78 100644 --- a/database/seeders/PaymentTypesSeeder.php +++ b/database/seeders/PaymentTypesSeeder.php @@ -31,7 +31,7 @@ class PaymentTypesSeeder extends Seeder const GATEWAY_TYPE_APPLE_PAY = 11; const GATEWAY_TYPE_CUSTOM2 = 12; const GATEWAY_TYPE_CUSTOM3 = 13; - const GATEWAY_TYPE_CREDIT = 13; + const GATEWAY_TYPE_CREDIT = 14; public function run() {