From d1d3d75915991c3c9c1b35082b2921e2b4d91f21 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 14 Jan 2014 11:52:56 +0000 Subject: [PATCH] bug fixes --- app/controllers/AccountController.php | 2 +- app/controllers/CreditController.php | 6 +- app/controllers/PaymentController.php | 11 +- app/lang/en/validation.php | 2 + app/libraries/utils.php | 8 +- app/models/Activity.php | 248 +++++++++++++++---- app/models/Credit.php | 10 + app/models/Payment.php | 10 + app/models/User.php | 4 +- app/ninja/repositories/CreditRepository.php | 2 +- app/ninja/repositories/InvoiceRepository.php | 20 +- app/ninja/repositories/PaymentRepository.php | 2 +- app/ninja/repositories/TaxRateRepository.php | 5 +- app/routes.php | 10 +- app/views/invoices/edit.blade.php | 10 +- app/views/invoices/view.blade.php | 1 + app/views/list.blade.php | 6 +- public/css/style.css | 8 + public/js/script.js | 2 +- 19 files changed, 289 insertions(+), 78 deletions(-) diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 44d4a49c8f..73d905c957 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -53,7 +53,7 @@ class AccountController extends \BaseController { Auth::login($user, true); Event::fire('user.login'); - + return Redirect::to('invoices/create'); } diff --git a/app/controllers/CreditController.php b/app/controllers/CreditController.php index 42483b8514..cf77da9da3 100755 --- a/app/controllers/CreditController.php +++ b/app/controllers/CreditController.php @@ -60,8 +60,8 @@ class CreditController extends \BaseController { public function create($clientPublicId = 0, $invoicePublicId = 0) { $data = array( - 'clientPublicId' => $clientPublicId, - 'invoicePublicId' => $invoicePublicId, + 'clientPublicId' => Input::old('client') ? Input::old('client') : $clientPublicId, + 'invoicePublicId' => Input::old('invoice') ? Input::old('invoice') : $invoicePublicId, 'credit' => null, 'method' => 'POST', 'url' => 'credits', @@ -103,7 +103,7 @@ class CreditController extends \BaseController { { $rules = array( 'client' => 'required', - 'amount' => 'required', + 'amount' => 'required|positive', ); $validator = Validator::make(Input::all(), $rules); diff --git a/app/controllers/PaymentController.php b/app/controllers/PaymentController.php index ce98574d1f..f6fe155e85 100755 --- a/app/controllers/PaymentController.php +++ b/app/controllers/PaymentController.php @@ -59,13 +59,13 @@ class PaymentController extends \BaseController public function create($clientPublicId = 0, $invoicePublicId = 0) { $data = array( - 'clientPublicId' => $clientPublicId, - 'invoicePublicId' => $invoicePublicId, + 'clientPublicId' => Input::old('client') ? Input::old('client') : $clientPublicId, + 'invoicePublicId' => Input::old('invoice') ? Input::old('invoice') : $invoicePublicId, 'invoice' => null, 'invoices' => Invoice::scope()->with('client', 'invoice_status')->where('balance','>',0)->orderBy('invoice_number')->get(), 'payment' => null, 'method' => 'POST', - 'url' => 'payments', + 'url' => "payments", 'title' => '- New Payment', 'currencies' => Currency::remember(DEFAULT_QUERY_CACHE)->orderBy('name')->get(), 'paymentTypes' => PaymentType::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), @@ -107,7 +107,8 @@ class PaymentController extends \BaseController { $rules = array( 'client' => 'required', - 'amount' => 'required' + 'invoice' => 'required', + 'amount' => 'required|positive' ); $validator = Validator::make(Input::all(), $rules); @@ -136,7 +137,7 @@ class PaymentController extends \BaseController if ($count > 0) { - $message = Utils::pluralize('Successfully '.$action.'d ? payment', count($payments)); + $message = Utils::pluralize('Successfully '.$action.'d ? payment', $count); Session::flash('message', $message); } diff --git a/app/lang/en/validation.php b/app/lang/en/validation.php index 5a24a40c0e..9e1e7b0330 100755 --- a/app/lang/en/validation.php +++ b/app/lang/en/validation.php @@ -68,6 +68,8 @@ return array( ), "unique" => "The :attribute has already been taken.", "url" => "The :attribute format is invalid.", + + "positive" => "The :attribute must be greater than zero.", /* |-------------------------------------------------------------------------- diff --git a/app/libraries/utils.php b/app/libraries/utils.php index 9bae76a191..8b15f9b2c2 100755 --- a/app/libraries/utils.php +++ b/app/libraries/utils.php @@ -39,6 +39,12 @@ class Utils */ } + public static function parseFloat($value) + { + $value = preg_replace('/[^0-9\.\-]/', '', $value); + return floatval($value); + } + public static function formatPhoneNumber($phoneNumber) { $phoneNumber = preg_replace('/[^0-9a-zA-Z]/','',$phoneNumber); @@ -144,7 +150,7 @@ class Utils $timezone = Session::get(SESSION_TIMEZONE); $format = Session::get(SESSION_DATE_FORMAT); - return DateTime::createFromFormat($format, $date, new DateTimeZone($timezone)); + return DateTime::createFromFormat($format, $date, new DateTimeZone($timezone))->format('Y-m-d'); } public static function fromSqlDate($date) diff --git a/app/models/Activity.php b/app/models/Activity.php index e342dd82f0..86e9f16f76 100755 --- a/app/models/Activity.php +++ b/app/models/Activity.php @@ -4,18 +4,23 @@ define("ACTIVITY_TYPE_CREATE_CLIENT", 1); define("ACTIVITY_TYPE_ARCHIVE_CLIENT", 2); define("ACTIVITY_TYPE_DELETE_CLIENT", 3); + define("ACTIVITY_TYPE_CREATE_INVOICE", 4); define("ACTIVITY_TYPE_UPDATE_INVOICE", 5); define("ACTIVITY_TYPE_EMAIL_INVOICE", 6); define("ACTIVITY_TYPE_VIEW_INVOICE", 7); define("ACTIVITY_TYPE_ARCHIVE_INVOICE", 8); define("ACTIVITY_TYPE_DELETE_INVOICE", 9); + define("ACTIVITY_TYPE_CREATE_PAYMENT", 10); -define("ACTIVITY_TYPE_ARCHIVE_PAYMENT", 11); -define("ACTIVITY_TYPE_DELETE_PAYMENT", 12); -define("ACTIVITY_TYPE_CREATE_CREDIT", 13); -define("ACTIVITY_TYPE_ARCHIVE_CREDIT", 14); -define("ACTIVITY_TYPE_DELETE_CREDIT", 15); +define("ACTIVITY_TYPE_UPDATE_PAYMENT", 11); +define("ACTIVITY_TYPE_ARCHIVE_PAYMENT", 12); +define("ACTIVITY_TYPE_DELETE_PAYMENT", 13); + +define("ACTIVITY_TYPE_CREATE_CREDIT", 14); +define("ACTIVITY_TYPE_UPDATE_CREDIT", 15); +define("ACTIVITY_TYPE_ARCHIVE_CREDIT", 16); +define("ACTIVITY_TYPE_DELETE_CREDIT", 17); class Activity extends Eloquent @@ -37,13 +42,18 @@ class Activity extends Eloquent { $activity = new Activity; - if ($entity) { + if ($entity) + { $activity->user_id = $entity->user_id; $activity->account_id = $entity->account_id; - } else if (Auth::check()) { + } + else if (Auth::check()) + { $activity->user_id = Auth::user()->id; $activity->account_id = Auth::user()->account_id; - } else { + } + else + { Utils::fatalError(); } @@ -208,6 +218,46 @@ class Activity extends Eloquent } } + public static function viewInvoice($invitation) + { + if (Session::get($invitation->invitation_key)) + { + return; + } + + Session::put($invitation->invitation_key, true); + $invoice = $invitation->invoice; + + if (!$invoice->isViewed()) + { + $invoice->invoice_status_id = INVOICE_STATUS_VIEWED; + $invoice->save(); + } + + $now = Carbon::now()->toDateTimeString(); + + $invitation->viewed_date = $now; + $invitation->save(); + + $client = $invoice->client; + $client->last_login = $now; + $client->save(); + + $activity = new Activity; + $activity->user_id = $invitation->user_id; + $activity->account_id = $invitation->user->account_id; + $activity->client_id = $invitation->invoice->client_id; + $activity->invitation_id = $invitation->id; + $activity->contact_id = $invitation->contact_id; + $activity->invoice_id = $invitation->invoice_id; + $activity->activity_type_id = ACTIVITY_TYPE_VIEW_INVOICE; + $activity->message = Utils::encodeActivity($invitation->contact, 'viewed', $invitation->invoice); + $activity->balance = $invitation->invoice->client->balance; + $activity->save(); + } + + + public static function createPayment($payment) { $client = $payment->client; @@ -246,6 +296,82 @@ class Activity extends Eloquent $activity->save(); } + public static function updatePayment($payment) + { + if ($payment->is_deleted && !$payment->getOriginal('is_deleted')) + { + $client = $payment->client; + $client->balance = $client->balance + $payment->amount; + $client->paid_to_date = $client->paid_to_date - $payment->amount; + $client->save(); + + $invoice = $payment->invoice; + $invoice->balance = $invoice->balance + $payment->amount; + $invoice->save(); + + $activity = Activity::getBlank(); + $activity->client_id = $invoice->client_id; + $activity->invoice_id = $invoice->id; + $activity->activity_type_id = ACTIVITY_TYPE_DELETE_PAYMENT; + $activity->message = Utils::encodeActivity(Auth::user(), 'deleted payment'); + $activity->balance = $client->balance; + $activity->adjustment = $payment->amount; + $activity->save(); + } + else + { + /* + $diff = floatval($invoice->amount) - floatval($invoice->getOriginal('amount')); + + if ($diff == 0) + { + return; + } + + $client = $invoice->client; + $client->balance = $client->balance + $diff; + $client->save(); + + $activity = Activity::getBlank($invoice); + $activity->client_id = $invoice->client_id; + $activity->invoice_id = $invoice->id; + $activity->activity_type_id = ACTIVITY_TYPE_UPDATE_INVOICE; + $activity->message = Utils::encodeActivity(Auth::user(), 'updated', $invoice); + $activity->balance = $client->balance; + $activity->adjustment = $diff; + $activity->json_backup = $backupInvoice->hidePrivateFields()->toJSON(); + $activity->save(); + */ + } + } + + public static function archivePayment($payment) + { + if ($payment->is_deleted) + { + return; + } + + $client = $payment->client; + $client->balance = $client->balance + $payment->amount; + $client->paid_to_date = $client->paid_to_date - $payment->amount; + $client->save(); + + $invoice = $payment->invoice; + $invoice->balance = $invoice->balance + $payment->amount; + $invoice->save(); + + $activity = Activity::getBlank(); + $activity->invoice_id = $invoice->id; + $activity->client_id = $client->id; + $activity->activity_type_id = ACTIVITY_TYPE_ARCHIVE_PAYMENT; + $activity->message = Utils::encodeActivity(Auth::user(), 'archived payment'); + $activity->balance = $client->balance; + $activity->adjustment = $payment->amount; + $activity->save(); + } + + public static function createCredit($credit) { $client = $credit->client; @@ -273,52 +399,82 @@ class Activity extends Eloquent $activity->save(); } - public static function archivePayment($payment) + public static function updateCredit($credit) { - $activity = Activity::getBlank(); - $activity->invoice_id = $invoice->id; - $activity->client_id = $invoice->client_id; - $activity->activity_type_id = ACTIVITY_TYPE_ARCHIVE_PAYMENT; - $activity->message = Utils::encodeActivity(Auth::user(), 'archived payment'); - $activity->balance = $payment->client->balance; - $activity->save(); - } + if ($credit->is_deleted && !$credit->getOriginal('is_deleted')) + { + $client = $credit->client; + $client->balance = $client->balance + $credit->amount; + $client->save(); - public static function viewInvoice($invitation) + if ($credit->invoice) + { + $invoice = $credit->invoice; + $invoice->balance = $invoice->balance + $credit->amount; + $invoice->save(); + } + + $activity = Activity::getBlank(); + $activity->client_id = $invoice->client_id; + $activity->invoice_id = $credit->invoice ? $credit->invoice->id : null; + $activity->activity_type_id = ACTIVITY_TYPE_DELETE_CREDIT; + $activity->message = Utils::encodeActivity(Auth::user(), 'deleted credit'); + $activity->balance = $client->balance; + $activity->adjustment = $credit->amount; + $activity->save(); + } + else + { + /* + $diff = floatval($invoice->amount) - floatval($invoice->getOriginal('amount')); + + if ($diff == 0) + { + return; + } + + $client = $invoice->client; + $client->balance = $client->balance + $diff; + $client->save(); + + $activity = Activity::getBlank($invoice); + $activity->client_id = $invoice->client_id; + $activity->invoice_id = $invoice->id; + $activity->activity_type_id = ACTIVITY_TYPE_UPDATE_INVOICE; + $activity->message = Utils::encodeActivity(Auth::user(), 'updated', $invoice); + $activity->balance = $client->balance; + $activity->adjustment = $diff; + $activity->json_backup = $backupInvoice->hidePrivateFields()->toJSON(); + $activity->save(); + */ + } + } + + public static function archiveCredit($credit) { - if (Session::get($invitation->invitation_key)) + if ($credit->is_deleted) { return; } - Session::put($invitation->invitation_key, true); - - $invoice = $invitation->invoice; - - if (!$invoice->isViewed()) - { - $invoice->invoice_status_id = INVOICE_STATUS_VIEWED; - $invoice->save(); - } - - $now = Carbon::now()->toDateTimeString(); - - $invitation->viewed_date = $now; - $invitation->save(); - - $client = $invoice->client; - $client->last_login = $now; + + $client = $credit->client; + $client->balance = $client->balance + $credit->amount; $client->save(); - $activity = new Activity; - $activity->user_id = $invitation->user_id; - $activity->account_id = $invitation->user->account_id; - $activity->client_id = $invitation->invoice->client_id; - $activity->invitation_id = $invitation->id; - $activity->contact_id = $invitation->contact_id; - $activity->invoice_id = $invitation->invoice_id; - $activity->activity_type_id = ACTIVITY_TYPE_VIEW_INVOICE; - $activity->message = Utils::encodeActivity($invitation->contact, 'viewed', $invitation->invoice); - $activity->balance = $invitation->invoice->client->balance; + if ($credit->invoice) + { + $invoice = $credit->invoice; + $invoice->balance = $invoice->balance + $credit->amount; + $invoice->save(); + } + + $activity = Activity::getBlank(); + $activity->invoice_id = $credit->invoice ? $credit->invoice->id : null; + $activity->client_id = $client->id; + $activity->activity_type_id = ACTIVITY_TYPE_ARCHIVE_CREDIT; + $activity->message = Utils::encodeActivity(Auth::user(), 'archived credit'); + $activity->balance = $client->balance; + $activity->adjustment = $credit->amount; $activity->save(); } } \ No newline at end of file diff --git a/app/models/Credit.php b/app/models/Credit.php index 05be6923c0..878ccd1491 100755 --- a/app/models/Credit.php +++ b/app/models/Credit.php @@ -26,4 +26,14 @@ class Credit extends EntityModel Credit::created(function($credit) { Activity::createCredit($credit); +}); + +Credit::updating(function($credit) +{ + Activity::updateCredit($credit); +}); + +Credit::deleting(function($credit) +{ + Activity::archiveCredit($credit); }); \ No newline at end of file diff --git a/app/models/Payment.php b/app/models/Payment.php index b9544af3ed..0756cab952 100755 --- a/app/models/Payment.php +++ b/app/models/Payment.php @@ -32,4 +32,14 @@ class Payment extends EntityModel Payment::created(function($payment) { Activity::createPayment($payment); +}); + +Payment::updating(function($payment) +{ + Activity::updatePayment($payment); +}); + +Payment::deleting(function($payment) +{ + Activity::archivePayment($payment); }); \ No newline at end of file diff --git a/app/models/User.php b/app/models/User.php index 15ac32c2ad..41bf96c354 100755 --- a/app/models/User.php +++ b/app/models/User.php @@ -13,8 +13,8 @@ class User extends ConfideUser implements UserInterface, RemindableInterface 'username' => 'required|email|unique:users', 'email' => 'required|email|unique:users', */ - 'password' => 'required|between:6,20|confirmed', - 'password_confirmation' => 'between:6,20', + 'password' => 'required|between:6,32|confirmed', + 'password_confirmation' => 'between:6,32', ); /** diff --git a/app/ninja/repositories/CreditRepository.php b/app/ninja/repositories/CreditRepository.php index 68309316cd..5d28078d23 100755 --- a/app/ninja/repositories/CreditRepository.php +++ b/app/ninja/repositories/CreditRepository.php @@ -48,7 +48,7 @@ class CreditRepository $credit->client_id = Client::getPrivateId($input['client']); $credit->credit_date = Utils::toSqlDate($input['credit_date']); $credit->invoice_id = isset($input['invoice']) && $input['invoice'] != "-1" ? Invoice::getPrivateId($input['invoice']) : null; - $credit->amount = floatval($input['amount']); + $credit->amount = Utils::parseFloat($input['amount']); $credit->currency_id = $input['currency_id'] ? $input['currency_id'] : null; $credit->save(); diff --git a/app/ninja/repositories/InvoiceRepository.php b/app/ninja/repositories/InvoiceRepository.php index 88d29c9b61..6a6421cb0e 100755 --- a/app/ninja/repositories/InvoiceRepository.php +++ b/app/ninja/repositories/InvoiceRepository.php @@ -82,6 +82,12 @@ class InvoiceRepository $invoice = (array) $input; $invoiceId = isset($invoice['public_id']) && $invoice['public_id'] ? Invoice::getPrivateId($invoice['public_id']) : null; $rules = ['invoice_number' => 'unique:invoices,invoice_number,' . $invoiceId . ',id,account_id,' . \Auth::user()->account_id]; + + if ($invoice['is_recurring'] && $invoice['start_date'] && $invoice['end_date']) + { + $rules['end_date'] = 'after:' . $invoice['start_date']; + } + $validator = \Validator::make($invoice, $rules); if ($validator->fails()) @@ -104,7 +110,7 @@ class InvoiceRepository } $invoice->client_id = $data['client_id']; - $invoice->discount = floatval($data['discount']); + $invoice->discount = Utils::parseFloat($data['discount']); $invoice->invoice_number = trim($data['invoice_number']); $invoice->invoice_date = Utils::toSqlDate($data['invoice_date']); $invoice->due_date = Utils::toSqlDate($data['due_date']); @@ -118,9 +124,9 @@ class InvoiceRepository $invoice->po_number = trim($data['po_number']); $invoice->currency_id = $data['currency_id']; - if (isset($data['tax_rate']) && floatval($data['tax_rate']) > 0) + if (isset($data['tax_rate']) && Utils::parseFloat($data['tax_rate']) > 0) { - $invoice->tax_rate = floatval($data['tax_rate']); + $invoice->tax_rate = Utils::parseFloat($data['tax_rate']); $invoice->tax_name = trim($data['tax_name']); } else @@ -164,13 +170,13 @@ class InvoiceRepository $invoiceItem->product_id = isset($product) ? $product->id : null; $invoiceItem->product_key = trim($item->product_key); $invoiceItem->notes = trim($item->notes); - $invoiceItem->cost = floatval($item->cost); - $invoiceItem->qty = floatval($item->qty); + $invoiceItem->cost = Utils::parseFloat($item->cost); + $invoiceItem->qty = Utils::parseFloat($item->qty); $invoiceItem->tax_rate = 0; - if (isset($item->tax_rate) && floatval($item->tax_rate) > 0) + if (isset($item->tax_rate) && Utils::parseFloat($item->tax_rate) > 0) { - $invoiceItem->tax_rate = floatval($item->tax_rate); + $invoiceItem->tax_rate = Utils::parseFloat($item->tax_rate); $invoiceItem->tax_name = trim($item->tax_name); } diff --git a/app/ninja/repositories/PaymentRepository.php b/app/ninja/repositories/PaymentRepository.php index 13df777024..5d733b7fe3 100755 --- a/app/ninja/repositories/PaymentRepository.php +++ b/app/ninja/repositories/PaymentRepository.php @@ -51,7 +51,7 @@ class PaymentRepository $payment->currency_id = $input['currency_id'] ? $input['currency_id'] : null; $payment->payment_type_id = $input['payment_type_id'] ? $input['payment_type_id'] : null; $payment->payment_date = Utils::toSqlDate($input['payment_date']); - $payment->amount = floatval($input['amount']); + $payment->amount = Utils::parseFloat($input['amount']); $payment->save(); return $payment; diff --git a/app/ninja/repositories/TaxRateRepository.php b/app/ninja/repositories/TaxRateRepository.php index 97957ba698..b7a7e4f9eb 100755 --- a/app/ninja/repositories/TaxRateRepository.php +++ b/app/ninja/repositories/TaxRateRepository.php @@ -1,6 +1,7 @@ rate) || !trim($record->name)) + if (!Utils::parseFloat($record->rate) || !trim($record->name)) { continue; } @@ -29,7 +30,7 @@ class TaxRateRepository $taxRate = TaxRate::createNew(); } - $taxRate->rate = floatval($record->rate); + $taxRate->rate = Utils::parseFloat($record->rate); $taxRate->name = trim($record->name); $taxRate->save(); diff --git a/app/routes.php b/app/routes.php index 45846c571e..3439ed3931 100755 --- a/app/routes.php +++ b/app/routes.php @@ -22,7 +22,6 @@ //Log::error('test'); -/* Event::listen('illuminate.query', function($query, $bindings, $time, $name) { $data = compact('bindings', 'time', 'name'); @@ -46,7 +45,6 @@ Event::listen('illuminate.query', function($query, $bindings, $time, $name) Log::info($query, $data); }); -*/ /* @@ -215,4 +213,10 @@ define('DEFAULT_QUERY_CACHE', 120); if (Auth::check() && !Session::has(SESSION_TIMEZONE)) { Event::fire('user.refresh'); -} \ No newline at end of file +} + + +Validator::extend('positive', function($attribute, $value, $parameters) +{ + return Utils::parseFloat($value) > 0; +}); \ No newline at end of file diff --git a/app/views/invoices/edit.blade.php b/app/views/invoices/edit.blade.php index bc1d76b6f9..d44f3a8b02 100755 --- a/app/views/invoices/edit.blade.php +++ b/app/views/invoices/edit.blade.php @@ -79,7 +79,7 @@
- {{ Former::text('po_number')->label('PO number')->data_bind("value: po_number, valueUpdate: 'afterkeydown'") }} + {{ Former::text('po_number')->label('PO #')->data_bind("value: po_number, valueUpdate: 'afterkeydown'") }} {{ Former::text('discount')->data_bind("value: discount, valueUpdate: 'afterkeydown'") }} {{ Former::select('currency_id')->label('Currency')->addOption('', '')->fromQuery($currencies, 'name', 'id')->data_bind("value: currency_id") }} @@ -561,14 +561,21 @@ } */ + var isRefreshing = false; function refreshPDF() { var invoice = createInvoiceModel(); var doc = generatePDF(invoice); + if (!doc) return; var string = doc.output('datauristring'); if (isFirefox || isChrome) { $('#theFrame').attr('src', string).show(); } else { + if (isRefreshing) { + return; + } + isRefreshing = true; + var pdfAsArray = convertDataURIToBinary(string); PDFJS.getDocument(pdfAsArray).then(function getPdfHelloWorld(pdf) { @@ -583,6 +590,7 @@ page.render({canvasContext: context, viewport: viewport}); $('#theCanvas').show(); + isRefreshing = false; }); }); } diff --git a/app/views/invoices/view.blade.php b/app/views/invoices/view.blade.php index 2a06beacc3..9b13dee2ab 100755 --- a/app/views/invoices/view.blade.php +++ b/app/views/invoices/view.blade.php @@ -35,6 +35,7 @@ invoice.imageHeight = {{ $invoice->client->account->getLogoHeight() }}; @endif var doc = generatePDF(invoice, true); + if (!doc) return; var string = doc.output('datauristring'); if (isFirefox || isChrome) { diff --git a/app/views/list.blade.php b/app/views/list.blade.php index 7836b2e13f..9308629793 100755 --- a/app/views/list.blade.php +++ b/app/views/list.blade.php @@ -53,10 +53,8 @@ } function deleteEntity(id) { - if (confirm("Are you sure?")) { - $('#id').val(id); - submitForm('delete'); - } + $('#id').val(id); + submitForm('delete'); } function archiveEntity(id) { diff --git a/public/css/style.css b/public/css/style.css index 217abdc648..3d07e1013c 100755 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,3 +1,7 @@ +div { + word-break: break-word; +} + div.required > label { font-weight: bold !important; } @@ -35,6 +39,10 @@ table.table thead > tr > th { border-bottom-width: 0px; } +table td { + max-width: 250px; +} + /* table.dataTable tr.odd { background-color: white; } table.dataTable tr.even { background-color: #f9f9f9; } diff --git a/public/js/script.js b/public/js/script.js index 25f7e25908..390586b634 100755 --- a/public/js/script.js +++ b/public/js/script.js @@ -127,7 +127,7 @@ function generatePDF(invoice, checkMath) { } var headerY = headerTop; - doc.text(headerLeft, headerY, 'Invoice #'); + doc.text(headerLeft, headerY, 'Invoice Number'); doc.text(invoiceNumberX, headerY, invoiceNumber); if (invoice.po_number) {