mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Refactor invoice emails (#3625)
This commit is contained in:
parent
f118f3bfda
commit
2ad84d4b76
@ -515,27 +515,9 @@ class CreditController extends BaseController
|
||||
$credit = CloneCreditFactory::create($credit, auth()->user()->id);
|
||||
return $this->itemResponse($credit);
|
||||
break;
|
||||
case 'clone_to_quote':
|
||||
$quote = CloneCreditToQuoteFactory::create($credit, auth()->user()->id);
|
||||
// todo build the quote transformer and return response here
|
||||
break;
|
||||
case 'history':
|
||||
# code...
|
||||
break;
|
||||
case 'delivery_note':
|
||||
# code...
|
||||
break;
|
||||
case 'mark_paid':
|
||||
if ($credit->balance < 0 || $credit->status_id == Credit::STATUS_PAID || $credit->is_deleted === true) {
|
||||
return $this->errorResponse(['message' => 'Credit cannot be marked as paid'], 400);
|
||||
}
|
||||
//@todo fix and replace
|
||||
$credit = MarkInvoicePaid::dispatchNow($credit, $credit->company);
|
||||
|
||||
if (!$bulk) {
|
||||
return $this->itemResponse($credit);
|
||||
}
|
||||
break;
|
||||
case 'mark_sent':
|
||||
$credit->service()->markSent()->save();
|
||||
|
||||
|
@ -31,9 +31,9 @@ class EmailInvoice implements ShouldQueue
|
||||
public $company;
|
||||
/**
|
||||
*
|
||||
* EmailQuote constructor.
|
||||
* EmailInvoice constructor.
|
||||
* @param BuildEmail $email_builder
|
||||
* @param QuoteInvitation $quote_invitation
|
||||
* @param InvoiceInvitation $quote_invitation
|
||||
*/
|
||||
|
||||
public function __construct(InvoiceEmail $email_builder, InvoiceInvitation $invoice_invitation, Company $company)
|
||||
|
@ -59,7 +59,7 @@ trait MakesInvoiceHtml
|
||||
|
||||
$html = $this->parseLabelsAndValues($labels, $values, $html);
|
||||
|
||||
info($html);
|
||||
// info($html);
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
@ -732,7 +732,12 @@ trait MakesInvoiceValues
|
||||
return rtrim(config('ninja.app_url'), "/");
|
||||
}
|
||||
|
||||
public function generateCustomCSS()
|
||||
/**
|
||||
* Builds CSS to assist with the generation
|
||||
* of Repeating headers and footers on the PDF
|
||||
* @return string The css string
|
||||
*/
|
||||
public function generateCustomCSS() :string
|
||||
{
|
||||
$settings = $this->client->getMergedSettings();
|
||||
|
||||
@ -800,9 +805,6 @@ trait MakesInvoiceValues
|
||||
}';
|
||||
$css = '';
|
||||
|
||||
\Log::error($settings->all_pages_header);
|
||||
\Log::error($settings->all_pages_footer);
|
||||
|
||||
if($settings->all_pages_header && $settings->all_pages_footer)
|
||||
$css .= $header_and_footer;
|
||||
elseif($settings->all_pages_header && !$settings->all_pages_footer)
|
||||
@ -822,8 +824,8 @@ trait MakesInvoiceValues
|
||||
html {
|
||||
';
|
||||
|
||||
// $css .= 'font-size:' . $settings->font_size . 'px;';
|
||||
$css .= 'font-size:14px;';
|
||||
$css .= 'font-size:' . $settings->font_size . 'px;';
|
||||
// $css .= 'font-size:14px;';
|
||||
|
||||
$css .= '}';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user