mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Bug fixes
This commit is contained in:
parent
1ae35b853a
commit
c3d43ab480
@ -524,6 +524,11 @@ class PaymentController extends BaseController
|
|||||||
return Redirect::to($invitation->getLink());
|
return Redirect::to($invitation->getLink());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PayFast transaction referencce
|
||||||
|
if ($accountGateway->isGateway(GATEWAY_PAYFAST) && Request::has('pt')) {
|
||||||
|
$token = Request::query('pt');
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (method_exists($gateway, 'completePurchase') && !$accountGateway->isGateway(GATEWAY_TWO_CHECKOUT)) {
|
if (method_exists($gateway, 'completePurchase') && !$accountGateway->isGateway(GATEWAY_TWO_CHECKOUT)) {
|
||||||
$details = $this->paymentService->getPaymentDetails($invitation, $accountGateway);
|
$details = $this->paymentService->getPaymentDetails($invitation, $accountGateway);
|
||||||
@ -592,19 +597,11 @@ class PaymentController extends BaseController
|
|||||||
|
|
||||||
private function error($type, $error, $accountGateway, $exception = false)
|
private function error($type, $error, $accountGateway, $exception = false)
|
||||||
{
|
{
|
||||||
if (!$error) {
|
|
||||||
if ($exception) {
|
|
||||||
$error = $exception->getMessage();
|
|
||||||
} else {
|
|
||||||
$error = trans('texts.payment_error');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$message = '';
|
$message = '';
|
||||||
if ($accountGateway && $accountGateway->gateway) {
|
if ($accountGateway && $accountGateway->gateway) {
|
||||||
$message = $accountGateway->gateway->name . ': ';
|
$message = $accountGateway->gateway->name . ': ';
|
||||||
}
|
}
|
||||||
$message .= $error;
|
$message .= $error ?: trans('texts.payment_error');
|
||||||
|
|
||||||
Session::flash('error', $message);
|
Session::flash('error', $message);
|
||||||
Utils::logError("Payment Error [{$type}]: " . ($exception ? Utils::getErrorString($exception) : $message));
|
Utils::logError("Payment Error [{$type}]: " . ($exception ? Utils::getErrorString($exception) : $message));
|
||||||
|
@ -235,6 +235,9 @@ class InvoiceRepository extends BaseRepository
|
|||||||
$entityType = ENTITY_QUOTE;
|
$entityType = ENTITY_QUOTE;
|
||||||
}
|
}
|
||||||
$invoice = $account->createInvoice($entityType, $data['client_id']);
|
$invoice = $account->createInvoice($entityType, $data['client_id']);
|
||||||
|
if (isset($data['has_tasks']) && $data['has_tasks']) {
|
||||||
|
$invoice->has_tasks = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$invoice = Invoice::scope($publicId)->firstOrFail();
|
$invoice = Invoice::scope($publicId)->firstOrFail();
|
||||||
}
|
}
|
||||||
@ -258,8 +261,7 @@ class InvoiceRepository extends BaseRepository
|
|||||||
$invoice->is_amount_discount = $data['is_amount_discount'] ? true : false;
|
$invoice->is_amount_discount = $data['is_amount_discount'] ? true : false;
|
||||||
$invoice->partial = round(Utils::parseFloat($data['partial']), 2);
|
$invoice->partial = round(Utils::parseFloat($data['partial']), 2);
|
||||||
$invoice->invoice_date = isset($data['invoice_date_sql']) ? $data['invoice_date_sql'] : Utils::toSqlDate($data['invoice_date']);
|
$invoice->invoice_date = isset($data['invoice_date_sql']) ? $data['invoice_date_sql'] : Utils::toSqlDate($data['invoice_date']);
|
||||||
$invoice->has_tasks = isset($data['has_tasks']) ? ($data['has_tasks'] ? true : false) : false;
|
|
||||||
|
|
||||||
if ($invoice->is_recurring) {
|
if ($invoice->is_recurring) {
|
||||||
if ($invoice->start_date && $invoice->start_date != Utils::toSqlDate($data['start_date'])) {
|
if ($invoice->start_date && $invoice->start_date != Utils::toSqlDate($data['start_date'])) {
|
||||||
$invoice->last_sent_date = null;
|
$invoice->last_sent_date = null;
|
||||||
|
@ -31627,6 +31627,12 @@ function GetPdfMake(invoice, javascript, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (key === 'footer') {
|
||||||
|
return function(page, pages) {
|
||||||
|
return page === pages ? val : '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check for markdown
|
// check for markdown
|
||||||
if (key === 'text') {
|
if (key === 'text') {
|
||||||
val = NINJA.parseMarkdownText(val, true);
|
val = NINJA.parseMarkdownText(val, true);
|
||||||
|
@ -54,6 +54,13 @@ function GetPdfMake(invoice, javascript, callback) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only show the footer on the last page
|
||||||
|
if (key === 'footer') {
|
||||||
|
return function(page, pages) {
|
||||||
|
return page === pages ? val : '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// check for markdown
|
// check for markdown
|
||||||
if (key === 'text') {
|
if (key === 'text') {
|
||||||
val = NINJA.parseMarkdownText(val, true);
|
val = NINJA.parseMarkdownText(val, true);
|
||||||
|
@ -760,7 +760,7 @@
|
|||||||
@endif
|
@endif
|
||||||
|
|
||||||
$('#clientModal').on('shown.bs.modal', function () {
|
$('#clientModal').on('shown.bs.modal', function () {
|
||||||
$('#name').focus();
|
$('#client\\[name\\]').focus();
|
||||||
}).on('hidden.bs.modal', function () {
|
}).on('hidden.bs.modal', function () {
|
||||||
if (model.clientBackup) {
|
if (model.clientBackup) {
|
||||||
model.loadClient(model.clientBackup);
|
model.loadClient(model.clientBackup);
|
||||||
|
@ -118,8 +118,8 @@ function ViewModel(data) {
|
|||||||
trackEvent('/activity', '/view_client_form');
|
trackEvent('/activity', '/view_client_form');
|
||||||
self.clientBackup = ko.mapping.toJS(self.invoice().client);
|
self.clientBackup = ko.mapping.toJS(self.invoice().client);
|
||||||
|
|
||||||
$('#emailError').css( "display", "none" );
|
$('#emailError').css( "display", "none" );
|
||||||
$('#clientModal').modal('show');
|
$('#clientModal').modal('show');
|
||||||
}
|
}
|
||||||
|
|
||||||
self.clientFormComplete = function() {
|
self.clientFormComplete = function() {
|
||||||
@ -228,7 +228,7 @@ function InvoiceModel(data) {
|
|||||||
self.balance = ko.observable(0);
|
self.balance = ko.observable(0);
|
||||||
self.invoice_design_id = ko.observable(1);
|
self.invoice_design_id = ko.observable(1);
|
||||||
self.partial = ko.observable(0);
|
self.partial = ko.observable(0);
|
||||||
self.has_tasks = ko.observable(false);
|
self.has_tasks = ko.observable();
|
||||||
|
|
||||||
self.custom_value1 = ko.observable(0);
|
self.custom_value1 = ko.observable(0);
|
||||||
self.custom_value2 = ko.observable(0);
|
self.custom_value2 = ko.observable(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user