Fix late fee translation

This commit is contained in:
Hillel Coren 2017-12-04 23:21:59 +02:00
parent 869ba58fdc
commit 65369399bb
2 changed files with 3 additions and 1 deletions

View File

@ -101,7 +101,9 @@ class SendReminders extends Command
foreach ($invoices as $invoice) { foreach ($invoices as $invoice) {
if ($reminder = $account->getInvoiceReminder($invoice, false)) { if ($reminder = $account->getInvoiceReminder($invoice, false)) {
$this->info('Charge fee: ' . $invoice->id); $this->info('Charge fee: ' . $invoice->id);
$account->loadLocalizationSettings($invoice->client); // support trans to add fee line item
$number = preg_replace('/[^0-9]/', '', $reminder); $number = preg_replace('/[^0-9]/', '', $reminder);
$amount = $account->account_email_settings->{"late_fee{$number}_amount"}; $amount = $account->account_email_settings->{"late_fee{$number}_amount"};
$percent = $account->account_email_settings->{"late_fee{$number}_percent"}; $percent = $account->account_email_settings->{"late_fee{$number}_percent"};
$this->invoiceRepo->setLateFee($invoice, $amount, $percent); $this->invoiceRepo->setLateFee($invoice, $amount, $percent);

View File

@ -1171,7 +1171,7 @@ class InvoiceRepository extends BaseRepository
$sql = implode(' OR ', $dates); $sql = implode(' OR ', $dates);
$invoices = Invoice::invoiceType(INVOICE_TYPE_STANDARD) $invoices = Invoice::invoiceType(INVOICE_TYPE_STANDARD)
->with('invoice_items') ->with('client', 'invoice_items')
->whereHas('client', function ($query) { ->whereHas('client', function ($query) {
$query->whereSendReminders(true); $query->whereSendReminders(true);
}) })