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
1e5634c305
commit
a57a4fcfc1
@ -170,6 +170,9 @@ class AccountController extends \BaseController {
|
|||||||
$payments = Payment::where('account_id','=',Auth::user()->account_id)->get();
|
$payments = Payment::where('account_id','=',Auth::user()->account_id)->get();
|
||||||
AccountController::exportData($output, $payments->toArray());
|
AccountController::exportData($output, $payments->toArray());
|
||||||
|
|
||||||
|
$credits = Credit::where('account_id','=',Auth::user()->account_id)->get();
|
||||||
|
AccountController::exportData($output, $credits->toArray());
|
||||||
|
|
||||||
fclose($output);
|
fclose($output);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ class Utils
|
|||||||
|
|
||||||
public static function formatPhoneNumber($phoneNumber)
|
public static function formatPhoneNumber($phoneNumber)
|
||||||
{
|
{
|
||||||
$phoneNumber = preg_replace('/[^0-9]/','',$phoneNumber);
|
$phoneNumber = preg_replace('/[^0-9a-zA-Z]/','',$phoneNumber);
|
||||||
|
|
||||||
if (!$phoneNumber) {
|
if (!$phoneNumber) {
|
||||||
return '';
|
return '';
|
||||||
|
@ -117,9 +117,9 @@ class Client extends EntityModel
|
|||||||
{
|
{
|
||||||
$str = '';
|
$str = '';
|
||||||
|
|
||||||
if ($this->notes)
|
if ($this->private_notes)
|
||||||
{
|
{
|
||||||
$str .= '<i>' . $this->notes . '</i>';
|
$str .= '<i>' . $this->private_notes . '</i>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $str;
|
return $str;
|
||||||
|
@ -9,17 +9,20 @@ class AccountRepository
|
|||||||
{
|
{
|
||||||
$clients = \DB::table('clients')
|
$clients = \DB::table('clients')
|
||||||
->where('clients.deleted_at', '=', null)
|
->where('clients.deleted_at', '=', null)
|
||||||
|
->where('clients.account_id', '=', \Auth::user()->account_id)
|
||||||
->whereRaw("clients.name <> ''")
|
->whereRaw("clients.name <> ''")
|
||||||
->select(\DB::raw("'Clients' as type, clients.public_id, clients.name, '' as token"));
|
->select(\DB::raw("'Clients' as type, clients.public_id, clients.name, '' as token"));
|
||||||
|
|
||||||
$contacts = \DB::table('clients')
|
$contacts = \DB::table('clients')
|
||||||
->join('contacts', 'contacts.client_id', '=', 'clients.id')
|
->join('contacts', 'contacts.client_id', '=', 'clients.id')
|
||||||
->where('clients.deleted_at', '=', null)
|
->where('clients.deleted_at', '=', null)
|
||||||
|
->where('clients.account_id', '=', \Auth::user()->account_id)
|
||||||
->whereRaw("CONCAT(contacts.first_name, contacts.last_name, contacts.email) <> ''")
|
->whereRaw("CONCAT(contacts.first_name, contacts.last_name, contacts.email) <> ''")
|
||||||
->select(\DB::raw("'Contacts' as type, clients.public_id, CONCAT(contacts.first_name, ' ', contacts.last_name, ' ', contacts.email) as name, '' as token"));
|
->select(\DB::raw("'Contacts' as type, clients.public_id, CONCAT(contacts.first_name, ' ', contacts.last_name, ' ', contacts.email) as name, '' as token"));
|
||||||
|
|
||||||
$invoices = \DB::table('clients')
|
$invoices = \DB::table('clients')
|
||||||
->join('invoices', 'invoices.client_id', '=', 'clients.id')
|
->join('invoices', 'invoices.client_id', '=', 'clients.id')
|
||||||
|
->where('clients.account_id', '=', \Auth::user()->account_id)
|
||||||
->where('clients.deleted_at', '=', null)
|
->where('clients.deleted_at', '=', null)
|
||||||
->where('invoices.deleted_at', '=', null)
|
->where('invoices.deleted_at', '=', null)
|
||||||
->select(\DB::raw("'Invoices' as type, invoices.public_id, CONCAT(invoices.invoice_number, ': ', clients.name) as name, invoices.invoice_number as token"));
|
->select(\DB::raw("'Invoices' as type, invoices.public_id, CONCAT(invoices.invoice_number, ': ', clients.name) as name, invoices.invoice_number as token"));
|
||||||
|
@ -343,6 +343,9 @@
|
|||||||
local: data[type]
|
local: data[type]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (datasets.length == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$('#search').typeahead(datasets).on('typeahead:selected', function(element, datum, name) {
|
$('#search').typeahead(datasets).on('typeahead:selected', function(element, datum, name) {
|
||||||
var type = name == 'Contacts' ? 'clients' : name.toLowerCase();
|
var type = name == 'Contacts' ? 'clients' : name.toLowerCase();
|
||||||
window.location = '{{ URL::to('/') }}' + '/' + type + '/' + datum.public_id;
|
window.location = '{{ URL::to('/') }}' + '/' + type + '/' + datum.public_id;
|
||||||
|
@ -149,7 +149,7 @@
|
|||||||
{{ Former::textarea('terms')->data_bind("value: wrapped_terms, valueUpdate: 'afterkeydown'")
|
{{ Former::textarea('terms')->data_bind("value: wrapped_terms, valueUpdate: 'afterkeydown'")
|
||||||
->label(false)->placeholder('Invoice terms')->style('width: 520px; resize: none')
|
->label(false)->placeholder('Invoice terms')->style('width: 520px; resize: none')
|
||||||
->addGroupClass('less-space-bottom') }}
|
->addGroupClass('less-space-bottom') }}
|
||||||
<label class="checkbox">
|
<label class="checkbox" style="width: 200px">
|
||||||
<input type="checkbox" style="width: 24px" data-bind="checked: set_default_terms"/>Save as default terms
|
<input type="checkbox" style="width: 24px" data-bind="checked: set_default_terms"/>Save as default terms
|
||||||
</label>
|
</label>
|
||||||
</td>
|
</td>
|
||||||
@ -457,7 +457,7 @@
|
|||||||
refreshPDF();
|
refreshPDF();
|
||||||
}); //.trigger('change');
|
}); //.trigger('change');
|
||||||
|
|
||||||
$('#terms, #public_notes, #invoice_number, #invoice_date, #due_date, #po_number, #discout, #currency_id').change(function() {
|
$('#terms, #public_notes, #invoice_number, #invoice_date, #due_date, #po_number, #discount, #currency_id').change(function() {
|
||||||
refreshPDF();
|
refreshPDF();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ function generatePDF(invoice, checkMath) {
|
|||||||
|
|
||||||
var tableTop = 240;
|
var tableTop = 240;
|
||||||
var tableLeft = 60;
|
var tableLeft = 60;
|
||||||
var descriptionLeft = 140;
|
var descriptionLeft = 150;
|
||||||
var unitCostRight = 400;
|
var unitCostRight = 400;
|
||||||
var qtyRight = 470;
|
var qtyRight = 470;
|
||||||
var taxRight = 470;
|
var taxRight = 470;
|
||||||
@ -179,7 +179,7 @@ function generatePDF(invoice, checkMath) {
|
|||||||
for (var i=0; i<invoice.invoice_items.length; i++) {
|
for (var i=0; i<invoice.invoice_items.length; i++) {
|
||||||
var item = invoice.invoice_items[i];
|
var item = invoice.invoice_items[i];
|
||||||
var cost = formatMoney(item.cost, currencyId, true);
|
var cost = formatMoney(item.cost, currencyId, true);
|
||||||
var qty = item.qty ? parseFloat(item.qty) + '' : '';
|
var qty = parseFloat(item.qty) ? parseFloat(item.qty) + '' : '';
|
||||||
var notes = item.notes;
|
var notes = item.notes;
|
||||||
var productKey = item.product_key;
|
var productKey = item.product_key;
|
||||||
var tax = 0;
|
var tax = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user