Adjustments for payment templates

This commit is contained in:
David Bomba 2023-06-22 11:03:25 +10:00
parent 67a73d6cea
commit ae09df0cfd
2 changed files with 7 additions and 1 deletions

View File

@ -102,7 +102,11 @@ class TemplateEngine
} elseif (stripos($this->template, 'purchase') !== false && $purchase_order = PurchaseOrder::whereHas('invitations')->withTrashed()->company()->first()) {
$this->entity = 'purchase_order';
$this->entity_obj = $purchase_order;
} elseif ($invoice = Invoice::whereHas('invitations')->withTrashed()->company()->first()) {
}elseif (stripos($this->template, 'payment') !== false && $payment = Payment::withTrashed()->company()->first()) {
$this->entity = 'payment';
$this->entity_obj = $payment;
}
elseif ($invoice = Invoice::whereHas('invitations')->withTrashed()->company()->first()) {
$this->entity_obj = $invoice;
} else {
$this->mockEntity();

View File

@ -116,6 +116,8 @@ trait MakesTemplateData
$data['$quote_total'] = ['value' => '$20.00', 'label' => ctrans('texts.quote_total')];
$data['$credit_amount'] = ['value' => '$15.00', 'label' => ctrans('texts.credit_amount')];
$data['$credit_balance'] = ['value' => '$12.00', 'label' => ctrans('texts.credit_balance')];
$data['$invoice_references'] = ['value' => 'Invoice #2222', 'label' => ctrans('texts.invoices')];
$data['$invoice_references_subject'] = ['value' => 'Invoice #2222', 'label' => ctrans('texts.invoices')];
$data['$credit_number'] = &$data['$number'];
$data['$credit_no'] = &$data['$number'];