1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

bug fixes

This commit is contained in:
Hillel Coren 2014-01-09 21:38:18 +00:00
parent 1e5634c305
commit a57a4fcfc1
7 changed files with 16 additions and 7 deletions

View File

@ -170,6 +170,9 @@ class AccountController extends \BaseController {
$payments = Payment::where('account_id','=',Auth::user()->account_id)->get();
AccountController::exportData($output, $payments->toArray());
$credits = Credit::where('account_id','=',Auth::user()->account_id)->get();
AccountController::exportData($output, $credits->toArray());
fclose($output);
exit;
}

View File

@ -41,7 +41,7 @@ class Utils
public static function formatPhoneNumber($phoneNumber)
{
$phoneNumber = preg_replace('/[^0-9]/','',$phoneNumber);
$phoneNumber = preg_replace('/[^0-9a-zA-Z]/','',$phoneNumber);
if (!$phoneNumber) {
return '';

View File

@ -117,9 +117,9 @@ class Client extends EntityModel
{
$str = '';
if ($this->notes)
if ($this->private_notes)
{
$str .= '<i>' . $this->notes . '</i>';
$str .= '<i>' . $this->private_notes . '</i>';
}
return $str;

View File

@ -9,17 +9,20 @@ class AccountRepository
{
$clients = \DB::table('clients')
->where('clients.deleted_at', '=', null)
->where('clients.account_id', '=', \Auth::user()->account_id)
->whereRaw("clients.name <> ''")
->select(\DB::raw("'Clients' as type, clients.public_id, clients.name, '' as token"));
$contacts = \DB::table('clients')
->join('contacts', 'contacts.client_id', '=', 'clients.id')
->where('clients.deleted_at', '=', null)
->where('clients.account_id', '=', \Auth::user()->account_id)
->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"));
$invoices = \DB::table('clients')
->join('invoices', 'invoices.client_id', '=', 'clients.id')
->where('clients.account_id', '=', \Auth::user()->account_id)
->where('clients.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"));

View File

@ -343,6 +343,9 @@
local: data[type]
});
}
if (datasets.length == 0) {
return;
}
$('#search').typeahead(datasets).on('typeahead:selected', function(element, datum, name) {
var type = name == 'Contacts' ? 'clients' : name.toLowerCase();
window.location = '{{ URL::to('/') }}' + '/' + type + '/' + datum.public_id;

View File

@ -149,7 +149,7 @@
{{ Former::textarea('terms')->data_bind("value: wrapped_terms, valueUpdate: 'afterkeydown'")
->label(false)->placeholder('Invoice terms')->style('width: 520px; resize: none')
->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
</label>
</td>
@ -457,7 +457,7 @@
refreshPDF();
}); //.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();
});

View File

@ -25,7 +25,7 @@ function generatePDF(invoice, checkMath) {
var tableTop = 240;
var tableLeft = 60;
var descriptionLeft = 140;
var descriptionLeft = 150;
var unitCostRight = 400;
var qtyRight = 470;
var taxRight = 470;
@ -179,7 +179,7 @@ function generatePDF(invoice, checkMath) {
for (var i=0; i<invoice.invoice_items.length; i++) {
var item = invoice.invoice_items[i];
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 productKey = item.product_key;
var tax = 0;