mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
Templates and reminders for purchase orders
This commit is contained in:
parent
f02cd08d80
commit
ebf88ab693
@ -27,6 +27,7 @@ use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\MakesInvoiceHtml;
|
||||
use App\Utils\Traits\MakesTemplateData;
|
||||
use App\Utils\VendorHtmlEngine;
|
||||
use DB;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Lang;
|
||||
@ -157,7 +158,8 @@ class TemplateEngine
|
||||
}
|
||||
elseif ($this->entity_obj) {
|
||||
$this->entityValues($this->entity_obj->client->primary_contact()->first());
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
$this->fakerValues();
|
||||
}
|
||||
|
||||
@ -184,11 +186,13 @@ class TemplateEngine
|
||||
|
||||
private function entityValues($contact)
|
||||
{
|
||||
$this->labels_and_values = (new HtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
|
||||
if($this->entity == 'purchase_order')
|
||||
$this->labels_and_values = (new VendorHtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
|
||||
else
|
||||
$this->labels_and_values = (new HtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
|
||||
|
||||
$this->body = strtr($this->body, $this->labels_and_values['labels']);
|
||||
$this->body = strtr($this->body, $this->labels_and_values['values']);
|
||||
// $this->body = str_replace("\n", "<br>", $this->body);
|
||||
|
||||
$this->subject = strtr($this->subject, $this->labels_and_values['labels']);
|
||||
$this->subject = strtr($this->subject, $this->labels_and_values['values']);
|
||||
@ -219,6 +223,7 @@ class TemplateEngine
|
||||
$data['whitelabel'] = $this->entity_obj ? $this->entity_obj->company->account->isPaid() : true;
|
||||
$data['company'] = $this->entity_obj ? $this->entity_obj->company : '';
|
||||
$data['settings'] = $this->settings;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -263,6 +268,9 @@ class TemplateEngine
|
||||
|
||||
private function mockEntity()
|
||||
{
|
||||
if(!$this->entity && $this->template && str_contains($this->template, 'purchase_order'))
|
||||
$this->entity = 'purchase_order';
|
||||
|
||||
DB::connection(config('database.default'))->beginTransaction();
|
||||
|
||||
$vendor = false;
|
||||
|
@ -228,59 +228,6 @@ trait MakesTemplateData
|
||||
$data['$vendor.billing_postal_code'] = &$data['$vendor.postal_code'];
|
||||
$data['$vendor.billing_country'] = &$data['$vendor.country'];
|
||||
|
||||
|
||||
|
||||
//$data['$paid_to_date'] = ;
|
||||
// $data['$your_invoice'] = ;
|
||||
// $data['$quote'] = ;
|
||||
// $data['$your_quote'] = ;
|
||||
// $data['$invoice_issued_to'] = ;
|
||||
// $data['$quote_issued_to'] = ;
|
||||
// $data['$rate'] = ;
|
||||
// $data['$hours'] = ;
|
||||
// $data['$from'] = ;
|
||||
// $data['$to'] = ;
|
||||
// $data['$invoice_to'] = ;
|
||||
// $data['$quote_to'] = ;
|
||||
// $data['$details'] = ;
|
||||
// $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
// $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
// $data['custom_label3'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
// $data['custom_label4'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
//$data['$blank'] = ;
|
||||
//$data['$surcharge'] = ;
|
||||
/*
|
||||
$data['$tax_invoice'] =
|
||||
$data['$tax_quote'] =
|
||||
$data['$statement'] = ;
|
||||
$data['$statement_date'] = ;
|
||||
$data['$your_statement'] = ;
|
||||
$data['$statement_issued_to'] = ;
|
||||
$data['$statement_to'] = ;
|
||||
$data['$credit_note'] = ;
|
||||
$data['$credit_date'] = ;
|
||||
$data['$credit_issued_to'] = ;
|
||||
$data['$credit_to'] = ;
|
||||
$data['$your_credit'] = ;
|
||||
$data['$phone'] = ;
|
||||
|
||||
$data['$outstanding'] = ;
|
||||
$data['$invoice_due_date'] = ;
|
||||
$data['$quote_due_date'] = ;
|
||||
$data['$service'] = ;
|
||||
$data['$product_key'] = ;
|
||||
$data['$unit_cost'] = ;
|
||||
$data['$custom_value1'] = ;
|
||||
$data['$custom_value2'] = ;
|
||||
$data['$delivery_note'] = ;
|
||||
$data['$date'] = ;
|
||||
$data['$method'] = ;
|
||||
$data['$payment_date'] = ;
|
||||
$data['$reference'] = ;
|
||||
$data['$amount'] = ;
|
||||
$data['$amount_paid'] =;
|
||||
*/
|
||||
|
||||
$arrKeysLength = array_map('strlen', array_keys($data));
|
||||
array_multisort($arrKeysLength, SORT_DESC, $data);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user