mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'master' of github.com:invoiceninja/invoiceninja
This commit is contained in:
commit
fa5cb690ba
@ -9,10 +9,9 @@ use App\Models\Payment;
|
|||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
use App\Models\TaxRate;
|
use App\Models\TaxRate;
|
||||||
use App\Libraries\Utils;
|
use App\Libraries\Utils;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
|
use App\Models\Document;
|
||||||
|
|
||||||
class StepsController extends BaseController
|
class StepsController extends BaseController
|
||||||
{
|
{
|
||||||
@ -65,6 +64,7 @@ class StepsController extends BaseController
|
|||||||
'quotes' => $this->getQuotes(),
|
'quotes' => $this->getQuotes(),
|
||||||
'payments' => array_merge($this->getPayments(), $this->getCredits()),
|
'payments' => array_merge($this->getPayments(), $this->getCredits()),
|
||||||
'credits' => $this->getCreditsNotes(),
|
'credits' => $this->getCreditsNotes(),
|
||||||
|
'documents' => $this->getDocuments(),
|
||||||
];
|
];
|
||||||
|
|
||||||
$file = storage_path("{$fileName}.zip");
|
$file = storage_path("{$fileName}.zip");
|
||||||
@ -110,6 +110,85 @@ class StepsController extends BaseController
|
|||||||
'custom_fields' => $this->account->custom_fields,
|
'custom_fields' => $this->account->custom_fields,
|
||||||
'created_at' => $this->account->created_at ? $this->account->created_at->toDateString() : null,
|
'created_at' => $this->account->created_at ? $this->account->created_at->toDateString() : null,
|
||||||
'updated_at' => $this->account->updated_at ? $this->account->updated_at->toDateString() : null,
|
'updated_at' => $this->account->updated_at ? $this->account->updated_at->toDateString() : null,
|
||||||
|
'settings' => $this->getCompanySettings(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCompanySettings()
|
||||||
|
{
|
||||||
|
// In v1: custom_invoice_taxes1 & custom_invoice_taxes2, v2: 'invoice_taxes'. What do to with this?
|
||||||
|
// V1: invoice_number_prefix, v2: invoice_number_pattern.. same with quote_number, client_number,
|
||||||
|
|
||||||
|
return [
|
||||||
|
'timezone_id' => $this->account->timezone_id,
|
||||||
|
'date_format_id' => $this->account->date_format_id,
|
||||||
|
'currency_id' => $this->account->currency_id,
|
||||||
|
'name' => $this->account->name,
|
||||||
|
'address1' => $this->account->address1,
|
||||||
|
'address2' => $this->account->address2,
|
||||||
|
'city' => $this->account->city,
|
||||||
|
'state' => $this->account->state,
|
||||||
|
'postal_code' => $this->account->postal_code,
|
||||||
|
'country_id' => $this->account->country_id,
|
||||||
|
'invoice_terms' => $this->account->invoice_terms,
|
||||||
|
'enabled_item_tax_rates' => $this->account->invoice_item_taxes,
|
||||||
|
'invoice_design_id' => $this->account->invoice_design_id,
|
||||||
|
'phone' => $this->account->work_phone,
|
||||||
|
'email' => $this->account->work_email,
|
||||||
|
'language_id' => $this->account->language_id,
|
||||||
|
'custom_value1' => $this->account->custom_value1,
|
||||||
|
'custom_value2' => $this->account->custom_value2,
|
||||||
|
'hide_paid_to_date' => $this->account->hide_paid_to_date,
|
||||||
|
'vat_number' => $this->account->vat_number,
|
||||||
|
'shared_invoice_quote_counter' => $this->account->share_counter, // @verify,
|
||||||
|
'id_number' => $this->account->id_number,
|
||||||
|
'invoice_footer' => $this->account->invoice_footer,
|
||||||
|
'pdf_email_attachment' => $this->account->pdf_email_attachment,
|
||||||
|
'font_size' => $this->account->font_size,
|
||||||
|
'invoice_labels' => $this->account->invoice_labels,
|
||||||
|
'military_time' => $this->account->military_time,
|
||||||
|
'invoice_number_pattern' => $this->account->invoice_number_pattern,
|
||||||
|
'quote_number_pattern' => $this->account->quote_number_pattern,
|
||||||
|
'quote_terms' => $this->account->quote_terms,
|
||||||
|
'website' => $this->account->website,
|
||||||
|
'auto_convert_quote' => $this->account->auto_convert_quote,
|
||||||
|
'all_pages_footer' => $this->account->all_pages_footer,
|
||||||
|
'all_pages_header' => $this->account->all_pages_header,
|
||||||
|
'show_currency_code' => $this->account->show_currency_code,
|
||||||
|
'enable_client_portal_password' => $this->account->enable_portal_password,
|
||||||
|
'send_portal_password' => $this->account->send_portal_password,
|
||||||
|
'recurring_number_prefix' => $this->account->recurring_invoice_number_prefix, // @verify
|
||||||
|
'enable_client_portal' => $this->account->enable_client_portal,
|
||||||
|
'invoice_fields' => $this->account->invoice_fields,
|
||||||
|
'company_logo' => $this->account->logo,
|
||||||
|
'embed_documents' => $this->account->invoice_embed_documents,
|
||||||
|
'document_email_attachment' => $this->account->document_email_attachment,
|
||||||
|
'enable_client_portal_dashboard' => $this->account->enable_client_portal_dashboard,
|
||||||
|
'page_size' => $this->account->page_size,
|
||||||
|
'show_accept_invoice_terms' => $this->account->show_accept_invoice_terms,
|
||||||
|
'show_accept_quote_terms' => $this->account->show_accept_quote_terms,
|
||||||
|
'require_invoice_signature' => $this->account->require_invoice_signature,
|
||||||
|
'require_quote_signature' => $this->account->require_quote_signature,
|
||||||
|
'client_number_counter' => $this->account->client_number_counter,
|
||||||
|
'client_number_pattern' => $this->account->client_number_pattern,
|
||||||
|
'payment_terms' => $this->account->payment_terms,
|
||||||
|
'reset_counter_frequency_id' => $this->account->reset_counter_frequency_id,
|
||||||
|
'payment_type_id' => $this->account->payment_type_id,
|
||||||
|
'reset_counter_date' => $this->account->reset_counter_date,
|
||||||
|
'tax_name1' => $this->account->tax_name1,
|
||||||
|
'tax_rate1' => $this->account->tax_rate1,
|
||||||
|
'tax_name2' => $this->account->tax_name2,
|
||||||
|
'tax_rate2' => $this->account->tax_rate2,
|
||||||
|
'quote_design_id' => $this->account->quote_design_id,
|
||||||
|
'credit_number_counter' => $this->account->credit_number_counter,
|
||||||
|
'credit_number_pattern' => $this->account->credit_number_pattern,
|
||||||
|
'default_task_rate' => $this->account->task_rate,
|
||||||
|
'inclusive_taxes' => $this->account->inclusive_taxes,
|
||||||
|
'signature_on_pdf' => $this->account->signature_on_pdf,
|
||||||
|
'ubl_email_attachment' => $this->account->ubl_email_attachment,
|
||||||
|
'auto_archive_invoice' => $this->account->auto_archive_invoice,
|
||||||
|
'auto_archive_quote' => $this->account->auto_archive_quote,
|
||||||
|
'auto_email_invoice' => $this->account->auto_email_invoice,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -530,4 +609,37 @@ class StepsController extends BaseController
|
|||||||
|
|
||||||
return $transformed;
|
return $transformed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function getDocuments()
|
||||||
|
{
|
||||||
|
$documents = Document::where('account_id', $this->account->id)->get();
|
||||||
|
|
||||||
|
$transformed = [];
|
||||||
|
|
||||||
|
foreach ($documents as $document) {
|
||||||
|
$transformed[] = [
|
||||||
|
'id' => $document->id,
|
||||||
|
'user_id' => $document->user_id,
|
||||||
|
'company_id' => $this->account->id,
|
||||||
|
'invoice_id' => $document->invoice_id,
|
||||||
|
'expense_id' => $document->expense_id,
|
||||||
|
'path' => $document->path,
|
||||||
|
'preview' => $document->preview,
|
||||||
|
'name' => $document->name,
|
||||||
|
'type' => $document->type,
|
||||||
|
'disk' => $document->disk,
|
||||||
|
'hash' => $document->hash,
|
||||||
|
'size' => $document->size,
|
||||||
|
'width' => $document->width,
|
||||||
|
'height' => $document->height,
|
||||||
|
'created_at' => $document->created_at ? $document->created_at->toDateString() : null,
|
||||||
|
'updated_at' => $document->updated_at ? $document->updated_at->toDateString() : null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $transformed;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,24 @@ class CheckoutComPaymentDriver extends BasePaymentDriver
|
|||||||
{
|
{
|
||||||
public function createTransactionToken()
|
public function createTransactionToken()
|
||||||
{
|
{
|
||||||
|
if( $this->invoice()->getCurrencyCode() == 'BHD')
|
||||||
|
{
|
||||||
|
$amount = $this->invoice()->getRequestedAmount()/10;
|
||||||
|
}
|
||||||
|
elseif($this->invoice()->getCurrencyCode() == 'KWD')
|
||||||
|
{
|
||||||
|
$amount = $this->invoice()->getRequestedAmount()*10;
|
||||||
|
|
||||||
|
}
|
||||||
|
elseif($this->invoice()->getCurrencyCode() == 'OMR')
|
||||||
|
{
|
||||||
|
$amount = $this->invoice()->getRequestedAmount();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$amount = $this->invoice()->getRequestedAmount();
|
||||||
|
|
||||||
$response = $this->gateway()->purchase([
|
$response = $this->gateway()->purchase([
|
||||||
'amount' => $this->invoice()->getRequestedAmount(),
|
'amount' => $amount,
|
||||||
'currency' => $this->client()->getCurrencyCode(),
|
'currency' => $this->client()->getCurrencyCode(),
|
||||||
])->send();
|
])->send();
|
||||||
|
|
||||||
|
@ -12,7 +12,11 @@
|
|||||||
paymentToken: '{{ $transactionToken }}',
|
paymentToken: '{{ $transactionToken }}',
|
||||||
customerEmail: '{{ $contact->email }}',
|
customerEmail: '{{ $contact->email }}',
|
||||||
customerName: '{{ $contact->getFullName() }}',
|
customerName: '{{ $contact->getFullName() }}',
|
||||||
|
@if( $invoice->getCurrencyCode() == 'BHD' || $invoice->getCurrencyCode() == 'KWD' || $invoice->getCurrencyCode() == 'OMR')
|
||||||
|
value: {{ $invoice->getRequestedAmount() * 1000 }},
|
||||||
|
@else
|
||||||
value: {{ $invoice->getRequestedAmount() * 100 }},
|
value: {{ $invoice->getRequestedAmount() * 100 }},
|
||||||
|
@endif
|
||||||
currency: '{{ $invoice->getCurrencyCode() }}',
|
currency: '{{ $invoice->getCurrencyCode() }}',
|
||||||
widgetContainerSelector: '.payment-form',
|
widgetContainerSelector: '.payment-form',
|
||||||
widgetColor: '#333',
|
widgetColor: '#333',
|
||||||
|
@ -632,7 +632,7 @@
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
<center>
|
<center>
|
||||||
@if (isset($invitation))
|
@if (isset($invitation))
|
||||||
{!! Button::normal(strtoupper(trans('texts.cancel')))->large()->asLinkTo($invitation->getLink()) !!}
|
{!! Button::normal(strtoupper(trans('texts.cancel')))->large()->asLinkTo(HTMLUtils::previousUrl('/')) !!}
|
||||||
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user