Ejemplo n.º 1
0
 protected function getDatatableActions($entityType)
 {
     return [[trans('texts.edit_task'), function ($model) {
         return URL::to('tasks/' . $model->public_id . '/edit');
     }, function ($model) {
         return (!$model->deleted_at || $model->deleted_at == '0000-00-00') && Task::canEditItem($model);
     }], [trans('texts.view_invoice'), function ($model) {
         return URL::to("/invoices/{$model->invoice_public_id}/edit");
     }, function ($model) {
         return $model->invoice_number && Invoice::canEditItemByOwner($model->invoice_user_id);
     }], [trans('texts.stop_task'), function ($model) {
         return "javascript:stopTask({$model->public_id})";
     }, function ($model) {
         return $model->is_running && Task::canEditItem($model);
     }], [trans('texts.invoice_task'), function ($model) {
         return "javascript:invoiceEntity({$model->public_id})";
     }, function ($model) {
         return !$model->invoice_number && (!$model->deleted_at || $model->deleted_at == '0000-00-00') && Invoice::canCreate();
     }]];
 }
Ejemplo n.º 2
0
 protected function getDatatableColumns($entityType, $hideClient)
 {
     return [['invoice_number', function ($model) {
         if (!Invoice::canEditItemByOwner($model->invoice_user_id)) {
             return $model->invoice_number;
         }
         return link_to("invoices/{$model->invoice_public_id}/edit", $model->invoice_number, ['class' => Utils::getEntityRowClass($model)])->toHtml();
     }], ['client_name', function ($model) {
         if (!Client::canViewItemByOwner($model->client_user_id)) {
             return Utils::getClientDisplayName($model);
         }
         return $model->client_public_id ? link_to("clients/{$model->client_public_id}", Utils::getClientDisplayName($model))->toHtml() : '';
     }, !$hideClient], ['transaction_reference', function ($model) {
         return $model->transaction_reference ? $model->transaction_reference : '<i>Manual entry</i>';
     }], ['payment_type', function ($model) {
         return $model->payment_type ? $model->payment_type : ($model->account_gateway_id ? $model->gateway_name : '');
     }], ['amount', function ($model) {
         return Utils::formatMoney($model->amount, $model->currency_id, $model->country_id);
     }], ['payment_date', function ($model) {
         return Utils::dateToString($model->payment_date);
     }]];
 }
Ejemplo n.º 3
0
 protected function getDatatableActions($entityType)
 {
     return [[trans('texts.edit_expense'), function ($model) {
         return URL::to("expenses/{$model->public_id}/edit");
     }, function ($model) {
         return Expense::canEditItem($model);
     }], [trans('texts.view_invoice'), function ($model) {
         return URL::to("/invoices/{$model->invoice_public_id}/edit");
     }, function ($model) {
         return $model->invoice_public_id && Invoice::canEditItemByOwner($model->invoice_user_id);
     }], [trans('texts.invoice_expense'), function ($model) {
         return "javascript:invoiceEntity({$model->public_id})";
     }, function ($model) {
         return !$model->invoice_id && (!$model->deleted_at || $model->deleted_at == '0000-00-00') && Invoice::canCreate();
     }]];
 }