mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:24:31 -04:00
bug fixes
This commit is contained in:
parent
2b56c8a299
commit
4f8d5d7890
@ -67,7 +67,7 @@ class CreditController extends \BaseController {
|
||||
'url' => 'credits',
|
||||
'title' => '- New Credit',
|
||||
'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(),
|
||||
'invoices' => Invoice::scope()->with('client')->where('balance','>',0)->orderBy('invoice_number')->get(),
|
||||
'invoices' => Invoice::scope()->with('client', 'invoice_status')->where('balance','>',0)->orderBy('invoice_number')->get(),
|
||||
'clients' => Client::scope()->with('contacts')->orderBy('name')->get());
|
||||
|
||||
return View::make('credits.edit', $data);
|
||||
|
@ -62,7 +62,7 @@ class PaymentController extends \BaseController
|
||||
'clientPublicId' => $clientPublicId,
|
||||
'invoicePublicId' => $invoicePublicId,
|
||||
'invoice' => null,
|
||||
'invoices' => Invoice::scope()->with('client')->where('balance','>',0)->orderBy('invoice_number')->get(),
|
||||
'invoices' => Invoice::scope()->with('client', 'invoice_status')->where('balance','>',0)->orderBy('invoice_number')->get(),
|
||||
'payment' => null,
|
||||
'method' => 'POST',
|
||||
'url' => 'payments',
|
||||
@ -81,7 +81,7 @@ class PaymentController extends \BaseController
|
||||
$data = array(
|
||||
'client' => null,
|
||||
'invoice' => null,
|
||||
'invoices' => Invoice::scope()->with('client')->orderBy('invoice_number')->get(array('public_id','invoice_number')),
|
||||
'invoices' => Invoice::scope()->with('client', 'invoice_status')->orderBy('invoice_number')->get(array('public_id','invoice_number')),
|
||||
'payment' => $payment,
|
||||
'method' => 'PUT',
|
||||
'url' => 'payments/' . $publicId,
|
||||
|
@ -1198,7 +1198,7 @@
|
||||
|
||||
this.prettyQty = ko.computed({
|
||||
read: function () {
|
||||
return this.qty() ? parseFloat(this.qty()) : '';
|
||||
return parseFloat(this.qty()) ? parseFloat(this.qty()) : '';
|
||||
},
|
||||
write: function (value) {
|
||||
this.qty(value);
|
||||
|
@ -830,7 +830,7 @@ function populateInvoiceComboboxes(clientId, invoiceId) {
|
||||
for (var i=0; i<list.length; i++) {
|
||||
var invoice = list[i];
|
||||
var client = clientMap[invoice.client.public_id];
|
||||
$invoiceCombobox.append(new Option(invoice.invoice_number + ' - ' + getClientDisplayName(client) + ' - ' + formatMoney(invoice.balance, invoice.currency_id), invoice.public_id));
|
||||
$invoiceCombobox.append(new Option(invoice.invoice_number + ' - ' + invoice.invoice_status.name + ' - ' + getClientDisplayName(client) + ' - ' + formatMoney(invoice.amount, invoice.currency_id) + ' | ' + formatMoney(invoice.balance, invoice.currency_id), invoice.public_id));
|
||||
}
|
||||
$('select#invoice').combobox('refresh');
|
||||
});
|
||||
@ -853,7 +853,8 @@ function populateInvoiceComboboxes(clientId, invoiceId) {
|
||||
if (invoiceId) {
|
||||
var invoice = invoiceMap[invoiceId];
|
||||
var client = clientMap[invoice.client.public_id];
|
||||
setComboboxValue($('.invoice-select'), invoice.public_id, (invoice.invoice_number + ' - ' + getClientDisplayName(client) + ' - ' + formatMoney(invoice.balance, invoice.currency_id)));
|
||||
console.log(invoice);
|
||||
setComboboxValue($('.invoice-select'), invoice.public_id, (invoice.invoice_number + ' - ' + invoice.invoice_status.name + ' - ' + getClientDisplayName(client) + ' - ' + formatMoney(invoice.amount, invoice.currency_id) + ' | ' + formatMoney(invoice.balance, invoice.currency_id)));
|
||||
$invoiceSelect.trigger('change');
|
||||
} else if (clientId) {
|
||||
var client = clientMap[clientId];
|
||||
|
Loading…
x
Reference in New Issue
Block a user