mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for preview and pdf labelling
This commit is contained in:
parent
03dcb72a06
commit
050ebb8141
@ -174,12 +174,7 @@ class PreviewController extends BaseController
|
||||
|
||||
MultiDB::setDb($company->db);
|
||||
|
||||
if($request->input('entity') == 'invoice'){
|
||||
$repo = new InvoiceRepository();
|
||||
$entity_obj = InvoiceFactory::create($company->id, auth()->user()->id);
|
||||
$class = Invoice::class;
|
||||
}
|
||||
elseif($request->input('entity') == 'quote'){
|
||||
if($request->input('entity') == 'quote'){
|
||||
$repo = new QuoteRepository();
|
||||
$entity_obj = QuoteFactory::create($company->id, auth()->user()->id);
|
||||
$class = Quote::class;
|
||||
@ -195,7 +190,11 @@ class PreviewController extends BaseController
|
||||
$entity_obj = RecurringInvoiceFactory::create($company->id, auth()->user()->id);
|
||||
$class = RecurringInvoice::class;
|
||||
}
|
||||
|
||||
else { //assume it is either an invoice or a null object
|
||||
$repo = new InvoiceRepository();
|
||||
$entity_obj = InvoiceFactory::create($company->id, auth()->user()->id);
|
||||
$class = Invoice::class;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
|
@ -69,7 +69,7 @@ class ClientPaymentFailureObject
|
||||
/* Set customized translations _NOW_ */
|
||||
$t->replace(Ninja::transformTranslations($this->company->settings));
|
||||
|
||||
$this->invoices = Invoice::whereIn('id', $this->transformKeys(array_column($this->payment_hash->invoices(), 'invoice_id')))->get();
|
||||
$this->invoices = Invoice::withTrashed()->whereIn('id', $this->transformKeys(array_column($this->payment_hash->invoices(), 'invoice_id')))->get();
|
||||
|
||||
$mail_obj = new stdClass;
|
||||
$mail_obj->amount = $this->getAmount();
|
||||
@ -101,8 +101,13 @@ class ClientPaymentFailureObject
|
||||
|
||||
private function getData()
|
||||
{
|
||||
$invitation = $this->invoices->first()->invitations->first();
|
||||
|
||||
if(!$invitation)
|
||||
throw new \Exception('Unable to find invitation for reference');
|
||||
|
||||
$signature = $this->client->getSetting('email_signature');
|
||||
$html_variables = (new HtmlEngine($this->invoices->first()->invitations->first()))->makeValues();
|
||||
$html_variables = (new HtmlEngine($invitation))->makeValues();
|
||||
$signature = str_replace(array_keys($html_variables), array_values($html_variables), $signature);
|
||||
|
||||
$data = [
|
||||
|
@ -195,7 +195,7 @@ class BaseModel extends Model
|
||||
// Remove any runs of periods (thanks falstro!)
|
||||
$formatted_number = mb_ereg_replace("([\.]{2,})", '', $formatted_number);
|
||||
|
||||
$formatted_number = str_replace(" ", "", $formatted_number);
|
||||
$formatted_number = str_replace(" ", "_", $formatted_number);
|
||||
|
||||
return $formatted_number;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user