Bug fixes

This commit is contained in:
Hillel Coren 2015-12-22 14:06:53 +02:00
parent 8739a1b46b
commit 9341ea0c87
13 changed files with 38 additions and 11 deletions

View File

@ -115,7 +115,7 @@ class DashboardController extends BaseController
->where('contacts.deleted_at', '=', null)
->where('contacts.is_primary', '=', true)
->select(['payments.payment_date', 'payments.amount', 'invoices.public_id', 'invoices.invoice_number', 'clients.name as client_name', 'contacts.email', 'contacts.first_name', 'contacts.last_name', 'clients.currency_id', 'clients.public_id as client_public_id'])
->orderBy('payments.id', 'desc')
->orderBy('payments.payment_date', 'desc')
->take(50)
->get();

View File

@ -26,6 +26,7 @@ class InvoiceTransformer extends BaseTransformer
'invoice_date_sql' => isset($data->invoice_date) ? $data->invoice_date : null,
'invoice_items' => [
[
'product_key' => '',
'notes' => isset($data->notes) ? $data->notes : null,
'cost' => isset($data->amount) ? (float) $data->amount : null,
'qty' => 1,

View File

@ -26,6 +26,7 @@ class InvoiceTransformer extends BaseTransformer
'invoice_date_sql' => $data->create_date,
'invoice_items' => [
[
'product_key' => '',
'notes' => $data->notes,
'cost' => (float) $data->amount,
'qty' => 1,

View File

@ -24,6 +24,7 @@ class InvoiceTransformer extends BaseTransformer
'invoice_date_sql' => $this->getDate($data->issue_date, 'm/d/Y'),
'invoice_items' => [
[
'product_key' => '',
'notes' => $data->subject,
'cost' => (float) $data->invoice_amount,
'qty' => 1,

View File

@ -24,6 +24,7 @@ class InvoiceTransformer extends BaseTransformer
'due_date_sql' => $this->getDate($data->due_date),
'invoice_items' => [
[
'product_key' => '',
'notes' => $data->summary,
'cost' => (float) $data->billed_total,
'qty' => 1,

View File

@ -26,6 +26,7 @@ class InvoiceTransformer extends BaseTransformer
'paid' => (float) $data->paid,
'invoice_items' => [
[
'product_key' => '',
'notes' => $data->description,
'cost' => (float) $data->total,
'qty' => 1,

View File

@ -27,6 +27,7 @@ class InvoiceTransformer extends BaseTransformer
'due_date_sql' => $this->getDate($data->due_date),
'invoice_items' => [
[
'product_key' => '',
'notes' => $data->description,
'cost' => (float) $data->total,
'qty' => 1,

View File

@ -25,6 +25,7 @@ class InvoiceTransformer extends BaseTransformer
'due_date_sql' => $data->date_due,
'invoice_items' => [
[
'product_key' => '',
'notes' => $data->line_item,
'cost' => (float) $data->total,
'qty' => 1,

View File

@ -25,6 +25,7 @@ class InvoiceTransformer extends BaseTransformer
'invoice_date_sql' => $data->invoice_date,
'invoice_items' => [
[
'product_key' => '',
'notes' => $data->item_desc,
'cost' => (float) $data->total,
'qty' => 1,

View File

@ -387,7 +387,7 @@ class InvoiceRepository extends BaseRepository
$task->save();
}
if (isset($item['product_key']) && $item['product_key']) {
if ($item['product_key']) {
if (!\Auth::user()->account->update_products) {
continue;
}

View File

@ -52,7 +52,6 @@ class AuthService
if ($result === true) {
if (!$isRegistered) {
event(new UserSignedUp());
Session::flash('warning', trans('texts.success_message'));
Session::flash('onReady', 'handleSignedUp();');
} else {

View File

@ -73,9 +73,10 @@
function saveEditor(data)
{
setTimeout(function() {
customDesign[editorSection] = editor.get();
refreshPDF();
}, 100)
customDesign[editorSection] = editor.get();
clearError();
refreshPDF();
}, 100)
}
function onSelectChange()
@ -89,16 +90,34 @@
}
loadEditor(editorSection);
refreshPDF(true);
clearError();
refreshPDF(true);
}
function submitForm()
{
if (!NINJA.isPDFValid) {
return;
}
$('#custom_design').val(JSON.stringify(customDesign));
$('form.warn-on-exit').submit();
}
$(function() {
window.onerror = function(e) {
$('#pdf-error').html(e.message ? e.message : e).show();
$('button.save-button').prop('disabled', true);
NINJA.isPDFValid = false;
}
function clearError() {
NINJA.isPDFValid = true;
$('#pdf-error').hide();
$('button.save-button').prop('disabled', false);
}
$(function() {
clearError();
refreshPDF(true);
var container = document.getElementById("jsoneditor");
@ -109,14 +128,14 @@
saveEditor();
}
};
window.editor = new JSONEditor(container, options);
window.editor = new JSONEditor(container, options);
loadEditor('content');
$('a[data-toggle="tab"]').on('shown.bs.tab', function (e) {
var target = $(e.target).attr("href") // activated tab
target = target.substring(1); // strip leading #
loadEditor(target);
});
});
});
</script>
@ -195,6 +214,7 @@
</div>
<div class="col-md-6">
<div id="pdf-error" class="alert alert-danger" style="display:none"></div>
@include('invoices.pdf', ['account' => Auth::user()->account, 'pdfHeight' => 800])

View File

@ -355,7 +355,7 @@
</tr>
@endif
<tr>
<tr style="font-size:1.05em">
<td class="hide-border" colspan="3"/>
<td class="hide-border" style="display:none" data-bind="visible: $root.invoice_item_taxes.show"/>
<td class="hide-border" colspan="{{ $account->hide_quantity ? 1 : 2 }}"><b>{{ trans($entityType == ENTITY_INVOICE ? 'texts.balance_due' : 'texts.total') }}</b></td>