mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 02:24:29 -04:00
Merge pull request #6411 from turbo124/v5-develop
Fixes for missing documents
This commit is contained in:
commit
0e1f17c6ea
@ -29,7 +29,7 @@ class RecurringInvoiceToInvoiceFactory
|
||||
$invoice->public_notes = $recurring_invoice->public_notes;
|
||||
$invoice->private_notes = $recurring_invoice->private_notes;
|
||||
//$invoice->date = now()->format($client->date_format());
|
||||
$invoice->due_date = $recurring_invoice->calculateDueDate(now());
|
||||
//$invoice->due_date = $recurring_invoice->calculateDueDate(now());
|
||||
$invoice->is_deleted = $recurring_invoice->is_deleted;
|
||||
$invoice->line_items = $recurring_invoice->line_items;
|
||||
$invoice->tax_name1 = $recurring_invoice->tax_name1;
|
||||
|
@ -300,7 +300,9 @@ class PreviewController extends BaseController
|
||||
->increment()
|
||||
->batch();
|
||||
}
|
||||
|
||||
|
||||
DB::connection()->getDoctrineConnection()->close();
|
||||
DB::disconnect();
|
||||
|
||||
$response = Response::make($file_path, 200);
|
||||
$response->header('Content-Type', 'application/pdf');
|
||||
|
@ -60,7 +60,8 @@ class SendRecurring implements ShouldQueue
|
||||
$invoice = RecurringInvoiceToInvoiceFactory::create($this->recurring_invoice, $this->recurring_invoice->client);
|
||||
|
||||
$invoice->date = now()->format('Y-m-d');
|
||||
|
||||
$invoice->due_date = $this->recurring_invoice->calculateDueDate(now()->format('Y-m-d'));
|
||||
|
||||
if($invoice->client->getSetting('auto_email_invoice'))
|
||||
{
|
||||
$invoice = $invoice->service()
|
||||
|
@ -1297,7 +1297,8 @@ class Import implements ShouldQueue
|
||||
}
|
||||
|
||||
if(!$entity)
|
||||
throw new Exception("Resource invoice/quote document not available.");
|
||||
continue;
|
||||
// throw new Exception("Resource invoice/quote document not available.");
|
||||
|
||||
|
||||
}
|
||||
|
@ -133,6 +133,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
||||
$data['$email'] = ['value' => isset($this->contact) ? $this->contact->email : 'no contact email on record', 'label' => ctrans('texts.email')];
|
||||
$data['$client_name'] = ['value' => $this->client->present()->name() ?: ' ', 'label' => ctrans('texts.client_name')];
|
||||
$data['$client.name'] = &$data['$client_name'];
|
||||
$data['$client'] = &$data['$client_name'];
|
||||
$data['$client.address1'] = &$data['$address1'];
|
||||
$data['$client.address2'] = &$data['$address2'];
|
||||
$data['$client_address'] = ['value' => $this->client->present()->address() ?: ' ', 'label' => ctrans('texts.address')];
|
||||
@ -164,6 +165,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
||||
$data['$contact.custom2'] = ['value' => isset($this->contact) ? $this->contact->custom_value2 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')];
|
||||
$data['$contact.custom3'] = ['value' => isset($this->contact) ? $this->contact->custom_value3 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')];
|
||||
$data['$contact.custom4'] = ['value' => isset($this->contact) ? $this->contact->custom_value4 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')];
|
||||
$data['$firstName'] = &$data['$contact.first_name'];
|
||||
|
||||
$data['$company.city_state_postal'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')];
|
||||
$data['$company.postal_city_state'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')];
|
||||
@ -191,7 +193,11 @@ class PaymentEmailEngine extends BaseEmailEngine
|
||||
$data['$company4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company4', $this->settings->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company4')];
|
||||
|
||||
$data['$view_link'] = ['value' => '<a class="button" href="'.$this->payment->getLink().'">'.ctrans('texts.view_payment').'</a>', 'label' => ctrans('texts.view_payment')];
|
||||
$data['$paymentLink'] = &$data['$view_link'];
|
||||
$data['$portalButton'] = &$data['$view_link'];
|
||||
|
||||
$data['$view_url'] = ['value' => $this->payment->getLink(), 'label' => ctrans('texts.view_payment')];
|
||||
$data['$signature'] = ['value' => $this->settings->email_signature ?: ' ', 'label' => ''];
|
||||
|
||||
$data['$invoices'] = ['value' => $this->formatInvoices(), 'label' => ctrans('texts.invoices')];
|
||||
|
||||
|
@ -162,7 +162,7 @@ class PaymentRepository extends BaseRepository {
|
||||
|
||||
if ( ! $is_existing_payment && ! $this->import_mode ) {
|
||||
|
||||
if (array_key_exists('email_receipt', $data) && $data['email_receipt'] == true)
|
||||
if (array_key_exists('email_receipt', $data) && $data['email_receipt'] == 'true')
|
||||
$payment->service()->sendEmail();
|
||||
elseif(!array_key_exists('email_receipt', $data) && $payment->client->getSetting('client_manual_payment_notification'))
|
||||
$payment->service()->sendEmail();
|
||||
|
@ -130,6 +130,7 @@ class HtmlEngine
|
||||
$data['$terms'] = &$data['$entity.terms'];
|
||||
$data['$view_link'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_invoice').'</a>', 'label' => ctrans('texts.view_invoice')];
|
||||
$data['$viewLink'] = &$data['$view_link'];
|
||||
$data['$viewButton'] = &$data['$view_link'];
|
||||
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->entity->client->date_format(), $this->entity->client->locale()) ?: ' ', 'label' => ctrans('texts.invoice_date')];
|
||||
|
||||
@ -422,6 +423,10 @@ class HtmlEngine
|
||||
$data['$autoBill'] = ['value' => ctrans('texts.auto_bill_notification_placeholder'), 'label' => ''];
|
||||
$data['$auto_bill'] = &$data['$autoBill'];
|
||||
|
||||
/*Payment Aliases*/
|
||||
$data['$paymentLink'] = ['value' => '<a class="button" href="'.$this->invitation->getLink().'">'.ctrans('texts.view_payment').'</a>', 'label' => ctrans('texts.view_payment')];
|
||||
$data['$portalButton'] = &$data['$paymentLink'];
|
||||
|
||||
$arrKeysLength = array_map('strlen', array_keys($data));
|
||||
array_multisort($arrKeysLength, SORT_DESC, $data);
|
||||
|
||||
|
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use App\Models\PaymentType;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class AddZellePaymentType extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Model::unguard();
|
||||
|
||||
$pt = PaymentType::where('name', 'Zelle')->first();
|
||||
|
||||
if(!$pt){
|
||||
|
||||
$payment_type = new PaymentType();
|
||||
$payment_type->id = 33;
|
||||
$payment_type->name = 'Zelle';
|
||||
$payment_type->save();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -70,6 +70,7 @@ class PaymentTypesSeeder extends Seeder
|
||||
['name' => 'GoCardless', 'gateway_type_id' => self::GATEWAY_TYPE_GOCARDLESS],
|
||||
['name' => 'Crypto', 'gateway_type_id' => self::GATEWAY_TYPE_CRYPTO],
|
||||
['name' => 'Credit', 'gateway_type_id' => self::GATEWAY_TYPE_CREDIT],
|
||||
['name' => 'Zelle'],
|
||||
];
|
||||
|
||||
$x = 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user