1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Merge remote-tracking branch 'upstream/master'

This commit is contained in:
David Bomba 2015-11-03 19:09:40 +11:00
commit 9b54113b9b
6 changed files with 27 additions and 15 deletions

View File

@ -524,6 +524,11 @@ class PaymentController extends BaseController
return Redirect::to($invitation->getLink());
}
// PayFast transaction referencce
if ($accountGateway->isGateway(GATEWAY_PAYFAST) && Request::has('pt')) {
$token = Request::query('pt');
}
try {
if (method_exists($gateway, 'completePurchase') && !$accountGateway->isGateway(GATEWAY_TWO_CHECKOUT)) {
$details = $this->paymentService->getPaymentDetails($invitation, $accountGateway);
@ -592,19 +597,11 @@ class PaymentController extends BaseController
private function error($type, $error, $accountGateway, $exception = false)
{
if (!$error) {
if ($exception) {
$error = $exception->getMessage();
} else {
$error = trans('texts.payment_error');
}
}
$message = '';
if ($accountGateway && $accountGateway->gateway) {
$message = $accountGateway->gateway->name . ': ';
}
$message .= $error;
$message .= $error ?: trans('texts.payment_error');
Session::flash('error', $message);
Utils::logError("Payment Error [{$type}]: " . ($exception ? Utils::getErrorString($exception) : $message));

View File

@ -235,6 +235,9 @@ class InvoiceRepository extends BaseRepository
$entityType = ENTITY_QUOTE;
}
$invoice = $account->createInvoice($entityType, $data['client_id']);
if (isset($data['has_tasks']) && $data['has_tasks']) {
$invoice->has_tasks = true;
}
} else {
$invoice = Invoice::scope($publicId)->firstOrFail();
}
@ -258,8 +261,7 @@ class InvoiceRepository extends BaseRepository
$invoice->is_amount_discount = $data['is_amount_discount'] ? true : false;
$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->has_tasks = isset($data['has_tasks']) ? ($data['has_tasks'] ? true : false) : false;
if ($invoice->is_recurring) {
if ($invoice->start_date && $invoice->start_date != Utils::toSqlDate($data['start_date'])) {
$invoice->last_sent_date = null;

View File

@ -31627,6 +31627,12 @@ function GetPdfMake(invoice, javascript, callback) {
}
}
if (key === 'footer') {
return function(page, pages) {
return page === pages ? val : '';
}
}
// check for markdown
if (key === 'text') {
val = NINJA.parseMarkdownText(val, true);

View File

@ -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
if (key === 'text') {
val = NINJA.parseMarkdownText(val, true);

View File

@ -760,7 +760,7 @@
@endif
$('#clientModal').on('shown.bs.modal', function () {
$('#name').focus();
$('#client\\[name\\]').focus();
}).on('hidden.bs.modal', function () {
if (model.clientBackup) {
model.loadClient(model.clientBackup);

View File

@ -118,8 +118,8 @@ function ViewModel(data) {
trackEvent('/activity', '/view_client_form');
self.clientBackup = ko.mapping.toJS(self.invoice().client);
$('#emailError').css( "display", "none" );
$('#clientModal').modal('show');
$('#emailError').css( "display", "none" );
$('#clientModal').modal('show');
}
self.clientFormComplete = function() {
@ -228,7 +228,7 @@ function InvoiceModel(data) {
self.balance = ko.observable(0);
self.invoice_design_id = ko.observable(1);
self.partial = ko.observable(0);
self.has_tasks = ko.observable(false);
self.has_tasks = ko.observable();
self.custom_value1 = ko.observable(0);
self.custom_value2 = ko.observable(0);