mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Fixes for mark paid
This commit is contained in:
parent
7d61b33966
commit
aaa84c9c92
@ -61,7 +61,7 @@ class MobileLocalization extends Command
|
||||
|
||||
private function laravelResources()
|
||||
{
|
||||
$resources = $this->getResources();
|
||||
$resources =(array)$this->getResources();
|
||||
|
||||
if(is_iterable($resources)){
|
||||
foreach ($resources as $key => $val) {
|
||||
|
@ -74,6 +74,7 @@ class EmailPayment implements ShouldQueue
|
||||
|
||||
if($this->settings->payment_email_all_contacts && $this->payment->invoices && $this->payment->invoices->count() >= 1) {
|
||||
$this->emailAllContacts($email_builder);
|
||||
return;
|
||||
}
|
||||
|
||||
$invitation = null;
|
||||
|
@ -388,7 +388,7 @@ class ProcessPostmarkWebhook implements ShouldQueue
|
||||
'delivery_message' => $event->Details->DeliveryMessage ?? $event->Details->Summary ?? '',
|
||||
'server' => $event->Details->DestinationServer ?? '',
|
||||
'server_ip' => $event->Details->DestinationIP ?? '',
|
||||
'date' => \Carbon\Carbon::parse($event->ReceivedAt)->format('Y-m-d H:m:s') ?? '',
|
||||
'date' => \Carbon\Carbon::parse($event->ReceivedAt)->format('Y-m-d H:i:s') ?? '',
|
||||
];
|
||||
|
||||
})->toArray();
|
||||
|
@ -261,10 +261,10 @@ class Task extends BaseModel
|
||||
$parent_entity = $this->client ?? $this->company;
|
||||
|
||||
if($log[0])
|
||||
$log[0] = Carbon::createFromTimestamp($log[0])->format($parent_entity->date_format().' H:m:s');
|
||||
$log[0] = Carbon::createFromTimestamp($log[0])->format($parent_entity->date_format().' H:i:s');
|
||||
|
||||
if($log[1] && $log[1] != 0)
|
||||
$log[1] = Carbon::createFromTimestamp($log[1])->format($parent_entity->date_format().' H:m:s');
|
||||
$log[1] = Carbon::createFromTimestamp($log[1])->format($parent_entity->date_format().' H:i:s');
|
||||
else
|
||||
$log[1] = ctrans('texts.running');
|
||||
|
||||
@ -291,11 +291,11 @@ class Task extends BaseModel
|
||||
|
||||
if($log[0])
|
||||
$logged['start_date_raw'] = $log[0];
|
||||
$logged['start_date'] = Carbon::createFromTimestamp($log[0])->format($parent_entity->date_format().' H:m:s');
|
||||
$logged['start_date'] = Carbon::createFromTimestamp($log[0])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
||||
|
||||
if($log[1] && $log[1] != 0) {
|
||||
$logged['end_date_raw'] = $log[1];
|
||||
$logged['end_date'] = Carbon::createFromTimestamp($log[1])->format($parent_entity->date_format().' H:m:s');
|
||||
$logged['end_date'] = Carbon::createFromTimestamp($log[1])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
||||
}
|
||||
else{
|
||||
$logged['end_date_raw'] = 0;
|
||||
@ -304,7 +304,8 @@ class Task extends BaseModel
|
||||
|
||||
$logged['description'] = $log[2];
|
||||
$logged['billable'] = $log[3];
|
||||
$logged['duration'] = $duration;
|
||||
$logged['duration_raw'] = $duration;
|
||||
$logged['duration'] = gmdate("H:i:s", $duration);
|
||||
|
||||
return $logged;
|
||||
|
||||
|
@ -90,7 +90,7 @@ class MarkPaid extends AbstractService
|
||||
'amount' => $this->payable_balance,
|
||||
]);
|
||||
|
||||
if ($payment->company->getSetting('send_email_on_mark_paid')) {
|
||||
if ($payment->client->getSetting('send_email_on_mark_paid')) {
|
||||
$payment->service()->sendEmail();
|
||||
}
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -11,31 +11,32 @@
|
||||
|
||||
namespace App\Services\Template;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Models\Quote;
|
||||
use App\Utils\Number;
|
||||
use Twig\Error\Error;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Design;
|
||||
use App\Models\Vendor;
|
||||
use App\Models\Company;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use App\Models\Project;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Models\Quote;
|
||||
use App\Models\RecurringInvoice;
|
||||
use App\Models\Vendor;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\HtmlEngine;
|
||||
use App\Utils\Number;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Utils\VendorHtmlEngine;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use App\Models\RecurringInvoice;
|
||||
use App\Utils\PaymentHtmlEngine;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\Traits\Pdf\PdfMaker;
|
||||
use App\Utils\VendorHtmlEngine;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
use Twig\Error\Error;
|
||||
use Twig\Error\LoaderError;
|
||||
use Twig\Error\RuntimeError;
|
||||
use Twig\Error\SyntaxError;
|
||||
use Twig\Extra\Intl\IntlExtension;
|
||||
use Twig\Sandbox\SecurityError;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
class TemplateService
|
||||
{
|
||||
@ -863,6 +864,7 @@ class TemplateService
|
||||
'custom_value3' => $task->custom_value3 ?: '',
|
||||
'custom_value4' => $task->custom_value4 ?: '',
|
||||
'status' => $task->status ? $task->status->name : '',
|
||||
'user' => $this->userInfo($task->user),
|
||||
'client' => $task->client ? [
|
||||
'name' => $task->client->present()->name(),
|
||||
'balance' => $task->client->balance,
|
||||
@ -894,6 +896,14 @@ class TemplateService
|
||||
|
||||
}
|
||||
|
||||
private function userInfo(User $user): array
|
||||
{
|
||||
return [
|
||||
'name' => $user->present()->name(),
|
||||
'email' => $user->email,
|
||||
];
|
||||
}
|
||||
|
||||
private function transformProject(Project $project, bool $nested = false): array
|
||||
{
|
||||
|
||||
@ -921,7 +931,7 @@ class TemplateService
|
||||
'payment_balance' => $project->client->payment_balance,
|
||||
'credit_balance' => $project->client->credit_balance,
|
||||
] : [],
|
||||
|
||||
'user' => $this->userInfo($project->user)
|
||||
];
|
||||
|
||||
}
|
||||
|
@ -5189,6 +5189,29 @@ $LANG = array(
|
||||
'payment_receipt' => 'Payment Receipt # :number',
|
||||
'load_template_description' => 'The template will be applied to following:',
|
||||
'run_template' => 'Run template',
|
||||
'statement_design' => 'Statement Design',
|
||||
'delivery_note_design' => 'Delivery Note Design',
|
||||
'payment_receipt_design' => 'Payment Receipt Design',
|
||||
'payment_refund_design' => 'Payment Refund Design',
|
||||
'task_extension_banner' => 'Add the Chrome extension to manage your tasks',
|
||||
'watch_video' => 'Watch Video',
|
||||
'view_extension' => 'View Extension',
|
||||
'reactivate_email' => 'Reactivate Email',
|
||||
'email_reactivated' => 'Successfully reactivated email',
|
||||
'template_help' => 'Enable using the design as a template',
|
||||
'quarter' => 'Quarter',
|
||||
'item_description' => 'Item Description',
|
||||
'task_item' => 'Task Item',
|
||||
'record_state' => 'Record State',
|
||||
'save_files_to_this_folder' => 'Save files to this folder',
|
||||
'downloads_folder' => 'Downloads Folder',
|
||||
'total_invoiced_quotes' => 'Invoiced Quotes',
|
||||
'total_invoice_paid_quotes' => 'Invoice Paid Quotes',
|
||||
'downloads_folder_does_not_exist' => 'The downloads folder does not exist :value',
|
||||
'user_logged_in_notification' => 'User Logged in Notification',
|
||||
'user_logged_in_notification_help' => 'Send an email when logging in from a new location',
|
||||
'payment_email_all_contacts' => 'Payment Email To All Contacts',
|
||||
'payment_email_all_contacts_help' => 'Sends the payment email to all contacts when enabled',
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
Loading…
Reference in New Issue
Block a user