1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Updates for invoice status resolution

This commit is contained in:
David Bomba 2023-08-28 20:24:48 +10:00
parent 19f400252b
commit 873c373097
2 changed files with 4 additions and 2 deletions

View File

@ -126,6 +126,7 @@ class InvoiceExport extends BaseExport
private function decorateAdvancedFields(Invoice $invoice, array $entity) :array private function decorateAdvancedFields(Invoice $invoice, array $entity) :array
{ {
nlog($entity);
if (in_array('invoice.country_id', $this->input['report_keys'])) { if (in_array('invoice.country_id', $this->input['report_keys'])) {
$entity['invoice.country_id'] = $invoice->client->country ? ctrans("texts.country_{$invoice->client->country->name}") : ''; $entity['invoice.country_id'] = $invoice->client->country ? ctrans("texts.country_{$invoice->client->country->name}") : '';
} }
@ -135,11 +136,11 @@ class InvoiceExport extends BaseExport
} }
if (in_array('invoice.client_id', $this->input['report_keys'])) { if (in_array('invoice.client_id', $this->input['report_keys'])) {
$entity['invoice.clientstatus_id'] = $invoice->client->present()->name(); $entity['invoice.client_id'] = $invoice->client->present()->name();
} }
if (in_array('invoice.status', $this->input['report_keys'])) { if (in_array('invoice.status', $this->input['report_keys'])) {
$entity['invoice.status_id'] = $invoice->stringStatus($invoice->status_id); $entity['invoice.status'] = $invoice->stringStatus($invoice->status_id);
} }
return $entity; return $entity;

View File

@ -159,6 +159,7 @@ class PaymentEmailEngine extends BaseEmailEngine
$data['$entity'] = ['value' => '', 'label' => ctrans('texts.payment')]; $data['$entity'] = ['value' => '', 'label' => ctrans('texts.payment')];
$data['$payment.amount'] = ['value' => Number::formatMoney($this->payment->amount, $this->client) ?: ' ', 'label' => ctrans('texts.amount')]; $data['$payment.amount'] = ['value' => Number::formatMoney($this->payment->amount, $this->client) ?: ' ', 'label' => ctrans('texts.amount')];
$data['$payment.refunded'] = ['value' => Number::formatMoney($this->payment->refunded, $this->client) ?: ' ', 'label' => ctrans('texts.refund')]; $data['$payment.refunded'] = ['value' => Number::formatMoney($this->payment->refunded, $this->client) ?: ' ', 'label' => ctrans('texts.refund')];
$data['$payment.unapplied'] = ['value' => Number::formatMoney(($this->payment->amount - $this->payment->refunded - $this->payment->applied), $this->client) ?: ' ', 'label' => ctrans('texts.refund')];
$data['$amount'] = &$data['$payment.amount']; $data['$amount'] = &$data['$payment.amount'];
$data['$payment.date'] = ['value' => $this->translateDate($this->payment->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.payment_date')]; $data['$payment.date'] = ['value' => $this->translateDate($this->payment->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.payment_date')];
$data['$transaction_reference'] = ['value' => $this->payment->transaction_reference, 'label' => ctrans('texts.transaction_reference')]; $data['$transaction_reference'] = ['value' => $this->payment->transaction_reference, 'label' => ctrans('texts.transaction_reference')];