1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00

Merge pull request #6774 from turbo124/v5-develop

Fixes for auto bill
This commit is contained in:
David Bomba 2021-10-05 11:47:29 +11:00 committed by GitHub
commit 35d4834333
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -28,9 +28,9 @@ class CloneQuoteToInvoiceFactory
unset($quote_array['invoice_id']);
unset($quote_array['id']);
unset($quote_array['invitations']);
unset($quote_array['terms']);
// unset($quote_array['public_notes']);
unset($quote_array['footer']);
//unset($quote_array['terms']);
//unset($quote_array['public_notes']);
//unset($quote_array['footer']);
unset($quote_array['design_id']);
foreach ($quote_array as $key => $value) {

View File

@ -312,7 +312,7 @@ class AutoBillInvoice extends AbstractService
$company_gateway = $gateway_token->gateway;
//check if fees and limits are set
if (isset($company_gateway->fees_and_limits) && property_exists($company_gateway->fees_and_limits, $gateway_token->gateway_type_id))
if (isset($company_gateway->fees_and_limits) && !is_array($company_gateway->fees_and_limits) && property_exists($company_gateway->fees_and_limits, $gateway_token->gateway_type_id))
{
//if valid we keep this gateway_token
if ($this->invoice->client->validGatewayForAmount($company_gateway->fees_and_limits->{$gateway_token->gateway_type_id}, $amount))

View File

@ -39,7 +39,7 @@ class ConvertQuote
{
$invoice = CloneQuoteToInvoiceFactory::create($quote, $quote->user_id);
$invoice->design_id = $this->decodePrimaryKey($this->client->getSetting('invoice_design_id'));
$invoice = $this->invoice_repo->save([], $invoice);
$invoice = $this->invoice_repo->save($invoice->toArray(), $invoice);
$invoice->fresh();