diff --git a/app/Jobs/RecurringInvoice/SendRecurring.php b/app/Jobs/RecurringInvoice/SendRecurring.php index 7945c4217185..9ee37c268b14 100644 --- a/app/Jobs/RecurringInvoice/SendRecurring.php +++ b/app/Jobs/RecurringInvoice/SendRecurring.php @@ -132,7 +132,6 @@ class SendRecurring implements ShouldQueue }); if ($invoice->client->getSetting('auto_bill_date') == 'on_send_date' && $invoice->auto_bill_enabled) { - nlog("attempting to autobill {$invoice->number}"); $invoice->service()->autoBill()->save(); diff --git a/app/PaymentDrivers/BraintreePaymentDriver.php b/app/PaymentDrivers/BraintreePaymentDriver.php index f1d0858284cf..2c5cc40a507b 100644 --- a/app/PaymentDrivers/BraintreePaymentDriver.php +++ b/app/PaymentDrivers/BraintreePaymentDriver.php @@ -119,6 +119,15 @@ class BraintreePaymentDriver extends BaseDriver ]); if ($result->success) { + + $address = $this->gateway->address()->create([ + 'customerId' => $result->customer->id, + 'firstName' => $this->client->present()->name, + 'streetAddress' => $this->client->address1, + 'postalCode' => $this->client->postal_code, + 'countryCodeAlpha2' => $this->client->country ? $this->client->country->iso_3166_2 : '', + ]); + return $result->customer; } } diff --git a/database/migrations/2021_09_29_190258_add_required_client_registration_fields.php b/database/migrations/2021_09_29_190258_add_required_client_registration_fields.php index 436f503b0142..4ae9eba8400a 100644 --- a/database/migrations/2021_09_29_190258_add_required_client_registration_fields.php +++ b/database/migrations/2021_09_29_190258_add_required_client_registration_fields.php @@ -1,5 +1,9 @@ mediumText('client_registration_fields')->nullable(); }); + + Company::all()->each(function ($company){ + $company->update(['client_registration_fields' => ClientRegistrationFields::generate()]); + }); + + + Model::unguard(); + + + $currencies = [ +['id' => 111, 'name' => 'Cuban Peso','code' => 'CUP', 'symbol' => '₱', 'precision' => '2','thousand_separator' => ',','decimal_separator' => '.'], + + ]; + + foreach ($currencies as $currency) { + $record = Currency::whereCode($currency['code'])->first(); + if ($record) { + $record->name = $currency['name']; + $record->symbol = $currency['symbol']; + $record->precision = $currency['precision']; + $record->thousand_separator = $currency['thousand_separator']; + $record->decimal_separator = $currency['decimal_separator']; + if (isset($currency['swap_currency_symbol'])) { + $record->swap_currency_symbol = $currency['swap_currency_symbol']; + } + $record->save(); + } else { + Currency::create($currency); + } + } + } /**