diff --git a/.gitignore b/.gitignore index dd49935a1d..d50f41640c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ /public/build /public/packages /public/vendor +/storage /bootstrap/compiled.php /bootstrap/environment.php /vendor diff --git a/app/Http/Controllers/ActivityController.php b/app/Http/Controllers/ActivityController.php index 95883aa68d..bf37d1cb9a 100644 --- a/app/Http/Controllers/ActivityController.php +++ b/app/Http/Controllers/ActivityController.php @@ -4,6 +4,7 @@ use Auth; use DB; use Datatable; use Utils; +use View; class ActivityController extends BaseController { @@ -19,7 +20,14 @@ class ActivityController extends BaseController ->addColumn('id', function ($model) { return Utils::timestampToDateTimeString(strtotime($model->created_at)); }) ->addColumn('message', function ($model) { return Utils::decodeActivity($model->message); }) ->addColumn('balance', function ($model) { return Utils::formatMoney($model->balance, $model->currency_id); }) - ->addColumn('adjustment', function ($model) { return $model->adjustment != 0 ? Utils::formatMoney($model->adjustment, $model->currency_id) : ''; }) + ->addColumn('adjustment', function ($model) { return $model->adjustment != 0 ? self::wrapAdjustment($model->adjustment, $model->currency_id) : ''; }) ->make(); } + + private function wrapAdjustment($adjustment, $currencyId) + { + $class = $adjustment <= 0 ? 'success' : 'default'; + $adjustment = Utils::formatMoney($adjustment, $currencyId); + return "
- {!! Former::hidden('data')->data_bind("value: ko.mapping.toJSON(model)") !!} -
- {!! Former::text('product_key')->useDatalist($products->toArray(), 'product_key')->onkeyup('onItemChange()') - ->raw()->data_bind("value: product_key, valueUpdate: 'afterkeydown'")->addClass('datalist') !!} + {!! Former::text('product_key')->useDatalist($products->toArray(), 'product_key')->onkeyup('onItemChange()') + ->raw()->data_bind("value: product_key, valueUpdate: 'afterkeydown'")->addClass('datalist') !!} |
@@ -299,6 +297,8 @@
{!! Former::populateField('entityType', $entityType) !!}
{!! Former::text('entityType') !!}
{!! Former::text('action') !!}
+ {!! Former::text('data')->data_bind("value: ko.mapping.toJSON(model)") !!}
+ {!! Former::text('pdfupload') !!}
@if ($invoice && $invoice->id)
{!! Former::populateField('id', $invoice->public_id) !!}
@@ -308,9 +308,9 @@
@if (!Utils::isPro() || \App\Models\InvoiceDesign::count() == COUNT_FREE_DESIGNS)
- {!! Former::select('invoice_design_id')->style('display:inline;width:150px;background-color:white !important')->raw()->fromQuery($invoiceDesigns, 'name', 'id')->data_bind("value: invoice_design_id")->addOption(trans('texts.more_designs') . '...', '-1') !!}
+ {!! Former::select('invoice_design_id')->style('display:'.($account->utf8_invoices ? 'none' : 'inline').';width:150px;background-color:white !important')->raw()->fromQuery($invoiceDesigns, 'name', 'id')->data_bind("value: invoice_design_id")->addOption(trans('texts.more_designs') . '...', '-1') !!}
@else
- {!! Former::select('invoice_design_id')->style('display:inline;width:150px;background-color:white !important')->raw()->fromQuery($invoiceDesigns, 'name', 'id')->data_bind("value: invoice_design_id") !!}
+ {!! Former::select('invoice_design_id')->style('display:'.($account->utf8_invoices ? 'none' : 'inline').';width:150px;background-color:white !important')->raw()->fromQuery($invoiceDesigns, 'name', 'id')->data_bind("value: invoice_design_id") !!}
@endif
{!! Button::primary(trans('texts.download_pdf'))->withAttributes(array('onclick' => 'onDownloadClick()'))->appendIcon(Icon::create('download-alt')) !!}
@@ -674,7 +674,7 @@
});
@if (Auth::user()->account->fill_products)
- $('.datalist').on('input', function() {
+ $('.datalist').on('change', function() {
var key = $(this).val();
for (var i=0; i |