diff --git a/app/Console/Commands/S3Cleanup.php b/app/Console/Commands/S3Cleanup.php index 6aa4d2d3b1..d20362c8f3 100644 --- a/app/Console/Commands/S3Cleanup.php +++ b/app/Console/Commands/S3Cleanup.php @@ -15,6 +15,8 @@ class S3Cleanup extends Command */ protected $signature = 'ninja:s3-cleanup'; + protected $log = ''; + /** * The console command description. * diff --git a/app/Http/Controllers/ClientPortal/NinjaPlanController.php b/app/Http/Controllers/ClientPortal/NinjaPlanController.php index 433663923f..70b66f0877 100644 --- a/app/Http/Controllers/ClientPortal/NinjaPlanController.php +++ b/app/Http/Controllers/ClientPortal/NinjaPlanController.php @@ -18,10 +18,10 @@ use App\Libraries\MultiDB; use App\Models\ClientContact; use App\Models\Company; use App\Utils\Ninja; -use Auth; use Illuminate\Contracts\Routing\ResponseFactory; use Illuminate\Http\Request; use Illuminate\Http\Response; +use Illuminate\Support\Facades\Auth; class NinjaPlanController extends Controller { diff --git a/app/Mail/SupportMessageSent.php b/app/Mail/SupportMessageSent.php index e882513890..7ea23586ef 100644 --- a/app/Mail/SupportMessageSent.php +++ b/app/Mail/SupportMessageSent.php @@ -62,9 +62,10 @@ class SupportMessageSent extends Mailable $company = auth()->user()->company(); $user = auth()->user(); $db = str_replace("db-ninja-", "", $company->db); - + $is_large = $company->is_large ? "L" : ""; + if(Ninja::isHosted()) - $subject = "{$priority}Hosted-{$db}-[{$company->is_large}] :: {$plan} :: ".date('M jS, g:ia'); + $subject = "{$priority}Hosted-{$db}{$is_large} :: {$plan} :: ".date('M jS, g:ia'); else $subject = "{$priority}Self Hosted :: {$plan} :: ".date('M jS, g:ia'); diff --git a/app/Mail/TemplateEmail.php b/app/Mail/TemplateEmail.php index bbfabebc09..222d767d0c 100644 --- a/app/Mail/TemplateEmail.php +++ b/app/Mail/TemplateEmail.php @@ -126,7 +126,11 @@ class TemplateEmail extends Mailable if($this->invitation->invoice && $settings->ubl_email_attachment && $this->company->account->hasFeature(Account::FEATURE_DOCUMENTS)){ $ubl_string = CreateUbl::dispatchNow($this->invitation->invoice); - $this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); + + nlog($ubl_string); + + if($ubl_string) + $this->attachData($ubl_string, $this->invitation->invoice->getFileName('xml')); } diff --git a/app/Models/ClientGatewayToken.php b/app/Models/ClientGatewayToken.php index a3928ce4bf..2aed46bf9e 100644 --- a/app/Models/ClientGatewayToken.php +++ b/app/Models/ClientGatewayToken.php @@ -13,10 +13,12 @@ namespace App\Models; use App\Utils\Traits\MakesDates; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\SoftDeletes; class ClientGatewayToken extends BaseModel { use MakesDates; + use SoftDeletes; protected $casts = [ 'meta' => 'object', diff --git a/app/Notifications/BaseNotification.php b/app/Notifications/BaseNotification.php index edf6d94bf4..d873855251 100644 --- a/app/Notifications/BaseNotification.php +++ b/app/Notifications/BaseNotification.php @@ -11,6 +11,8 @@ namespace App\Notifications; +use App\Jobs\Invoice\CreateUbl; +use App\Models\Invoice; use App\Utils\TempFile; use App\Utils\Traits\MakesInvoiceHtml; use Illuminate\Bus\Queueable; diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index 45cd0b1c3e..be410cf113 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -205,7 +205,6 @@ class BaseDriver extends AbstractPaymentDriver $invoices->each(function ($invoice) use ($payment) { event(new InvoiceWasPaid($invoice, $payment, $payment->company, Ninja::eventVars())); - $invoice->service()->workFlow(); }); return $payment->service()->applyNumber()->save(); diff --git a/app/PaymentDrivers/WePay/CreditCard.php b/app/PaymentDrivers/WePay/CreditCard.php index 5cb3567976..8209c71c35 100644 --- a/app/PaymentDrivers/WePay/CreditCard.php +++ b/app/PaymentDrivers/WePay/CreditCard.php @@ -60,12 +60,18 @@ use WePayCommon; 'method' => '1', */ - $response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array( - 'client_id' => config('ninja.wepay.client_id'), - 'client_secret' => config('ninja.wepay.client_secret'), - 'credit_card_id' => (int)$data['credit_card_id'], - )); + try { + + $response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array( + 'client_id' => config('ninja.wepay.client_id'), + 'client_secret' => config('ninja.wepay.client_secret'), + 'credit_card_id' => (int)$data['credit_card_id'], + )); + } + catch(\Exception $e){ + return $this->wepay_payment_driver->processInternallyFailedPayment($this->wepay_payment_driver, $e); + } // display the response // nlog($response); @@ -116,11 +122,16 @@ use WePayCommon; { nlog("authorize the card first!"); - $response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array( - 'client_id' => config('ninja.wepay.client_id'), - 'client_secret' => config('ninja.wepay.client_secret'), - 'credit_card_id' => (int)$request->input('credit_card_id'), - )); + try { + $response = $this->wepay_payment_driver->wepay->request('credit_card/authorize', array( + 'client_id' => config('ninja.wepay.client_id'), + 'client_secret' => config('ninja.wepay.client_secret'), + 'credit_card_id' => (int)$request->input('credit_card_id'), + )); + } + catch(\Exception $e){ + return $this->wepay_payment_driver->processInternallyFailedPayment($this->wepay_payment_driver, $e); + } $credit_card_id = (int)$response->credit_card_id; diff --git a/app/Services/Invoice/TriggeredActions.php b/app/Services/Invoice/TriggeredActions.php index 2516a59999..2169a63df6 100644 --- a/app/Services/Invoice/TriggeredActions.php +++ b/app/Services/Invoice/TriggeredActions.php @@ -63,8 +63,8 @@ class TriggeredActions extends AbstractService private function sendEmail() { - //$reminder_template = $this->invoice->calculateTemplate('invoice'); - $reminder_template = 'payment'; + $reminder_template = $this->invoice->calculateTemplate('invoice'); + //$reminder_template = 'payment'; $this->invoice->invitations->load('contact.client.country', 'invoice.client.country', 'invoice.company')->each(function ($invitation) use ($reminder_template) { EmailEntity::dispatch($invitation, $this->invoice->company, $reminder_template); diff --git a/app/Services/Payment/UpdateInvoicePayment.php b/app/Services/Payment/UpdateInvoicePayment.php index e344050cfa..88aa818568 100644 --- a/app/Services/Payment/UpdateInvoicePayment.php +++ b/app/Services/Payment/UpdateInvoicePayment.php @@ -83,6 +83,7 @@ class UpdateInvoicePayment ->updatePaidToDate($paid_amount) ->updateStatus() ->deletePdf() + ->workFlow() ->save(); event(new InvoiceWasUpdated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); diff --git a/database/migrations/2021_09_02_115919_update_designs.php b/database/migrations/2021_09_08_115919_update_designs.php similarity index 100% rename from database/migrations/2021_09_02_115919_update_designs.php rename to database/migrations/2021_09_08_115919_update_designs.php diff --git a/resources/views/pdf-designs/bold.html b/resources/views/pdf-designs/bold.html index 81f9d580fe..689c6cbb06 100644 --- a/resources/views/pdf-designs/bold.html +++ b/resources/views/pdf-designs/bold.html @@ -36,7 +36,8 @@ } .company-logo { - max-width: 55%; + height: 100%; + padding-right: 120px; } #company-details, @@ -251,6 +252,10 @@ [data-ref*=".line_total-td"] { white-space: nowrap; } + + .logo-container { + max-height: 160px; + } /** Useful snippets, uncomment to enable. **/ @@ -288,7 +293,9 @@