Browse Source

Merge branch 'master' of https://github.com/nafiesl/free-pmo

pull/42/head
Damilola Olowookere 7 years ago
parent
commit
8de0cac9e9
  1. 12
      .env.example
  2. 1
      .travis.yml
  3. 4
      README.id.md
  4. 4
      README.md
  5. 41
      app/Entities/BaseRepository.php
  6. 2
      app/Entities/Payments/PaymentPresenter.php
  7. 8
      app/Entities/Projects/File.php
  8. 60
      app/Entities/Projects/Issue.php
  9. 39
      app/Entities/Projects/IssueStatus.php
  10. 16
      app/Entities/Projects/Job.php
  11. 35
      app/Entities/Projects/Priority.php
  12. 36
      app/Entities/Projects/Project.php
  13. 22
      app/Entities/Reports/ReportsRepository.php
  14. 10
      app/Entities/Subscriptions/Subscription.php
  15. 52
      app/Entities/Subscriptions/SubscriptionsRepository.php
  16. 18
      app/Http/Controllers/Api/CustomerController.php
  17. 18
      app/Http/Controllers/Api/VendorController.php
  18. 38
      app/Http/Controllers/Controller.php
  19. 83
      app/Http/Controllers/Issues/CommentController.php
  20. 26
      app/Http/Controllers/Issues/OptionController.php
  21. 10
      app/Http/Controllers/PaymentsController.php
  22. 20
      app/Http/Controllers/Projects/FilesController.php
  23. 116
      app/Http/Controllers/Projects/IssueController.php
  24. 2
      app/Http/Controllers/Projects/JobsController.php
  25. 42
      app/Http/Controllers/Reports/LogFileController.php
  26. 13
      app/Http/Controllers/ReportsController.php
  27. 64
      app/Http/Controllers/SubscriptionsController.php
  28. 22
      app/Http/Controllers/Users/CalendarController.php
  29. 23
      app/Http/Middleware/TrustProxies.php
  30. 52
      app/Http/Requests/SubscriptionRequest.php
  31. 29
      app/Policies/Projects/IssuePolicy.php
  32. 1
      app/Providers/AppServiceProvider.php
  33. 1
      app/Providers/AuthServiceProvider.php
  34. 62
      app/helpers.php
  35. 18
      composer.json
  36. 1807
      composer.lock
  37. 52
      config/hashing.php
  38. 92
      config/logging.php
  39. 21
      database/factories/IssueFactory.php
  40. 38
      database/migrations/2019_03_03_210017_create_issues_table.php
  41. 1
      phpunit.xml
  42. 1
      resources/lang/de/app.php
  43. 3
      resources/lang/de/customer.php
  44. 57
      resources/lang/de/issue.php
  45. 1
      resources/lang/de/project.php
  46. 4
      resources/lang/de/report.php
  47. 1
      resources/lang/de/vendor.php
  48. 1
      resources/lang/en/app.php
  49. 3
      resources/lang/en/customer.php
  50. 58
      resources/lang/en/issue.php
  51. 1
      resources/lang/en/project.php
  52. 4
      resources/lang/en/report.php
  53. 1
      resources/lang/en/vendor.php
  54. 1
      resources/lang/id/app.php
  55. 2
      resources/lang/id/comment.php
  56. 3
      resources/lang/id/customer.php
  57. 57
      resources/lang/id/issue.php
  58. 1
      resources/lang/id/project.php
  59. 4
      resources/lang/id/report.php
  60. 1
      resources/lang/id/vendor.php
  61. 2
      resources/views/auth/app-install.blade.php
  62. 2
      resources/views/auth/login.blade.php
  63. 4
      resources/views/backups/index.blade.php
  64. 4
      resources/views/customers/invoices.blade.php
  65. 2
      resources/views/customers/payments.blade.php
  66. 2
      resources/views/customers/projects.blade.php
  67. 6
      resources/views/customers/subscriptions.blade.php
  68. 6
      resources/views/invoice-drafts/partials/draft-confirm.blade.php
  69. 2
      resources/views/invoice-drafts/partials/draft-item-list.blade.php
  70. 4
      resources/views/invoices/index.blade.php
  71. 2
      resources/views/invoices/partials/detail.blade.php
  72. 2
      resources/views/invoices/partials/item-list.blade.php
  73. 16
      resources/views/invoices/pdf.blade.php
  74. 8
      resources/views/invoices/show.blade.php
  75. 4
      resources/views/jobs/partials/job-show.blade.php
  76. 2
      resources/views/jobs/partials/job-tasks.blade.php
  77. 8
      resources/views/jobs/unfinished.blade.php
  78. 2
      resources/views/layouts/partials/sidebar.blade.php
  79. 2
      resources/views/options/page-1.blade.php
  80. 8
      resources/views/pages/home.blade.php
  81. 49
      resources/views/payments/edit.blade.php
  82. 6
      resources/views/payments/pdf.blade.php
  83. 64
      resources/views/projects/files.blade.php
  84. 4
      resources/views/projects/index.blade.php
  85. 4
      resources/views/projects/invoices.blade.php
  86. 32
      resources/views/projects/issues/create.blade.php
  87. 54
      resources/views/projects/issues/edit.blade.php
  88. 67
      resources/views/projects/issues/index.blade.php
  89. 54
      resources/views/projects/issues/partials/comment-section.blade.php
  90. 65
      resources/views/projects/issues/show.blade.php
  91. 10
      resources/views/projects/jobs/add-from-other-project.blade.php
  92. 18
      resources/views/projects/jobs/export-html.blade.php
  93. 10
      resources/views/projects/jobs/index.blade.php
  94. 12
      resources/views/projects/jobs/progress-export-html.blade.php
  95. 3
      resources/views/projects/partials/nav-tabs.blade.php
  96. 16
      resources/views/projects/partials/payment-summary.blade.php
  97. 12
      resources/views/projects/partials/project-show.blade.php
  98. 4
      resources/views/projects/partials/project-stats.blade.php
  99. 4
      resources/views/projects/payments.blade.php
  100. 8
      resources/views/projects/subscriptions.blade.php

12
.env.example

@ -1,9 +1,11 @@
APP_NAME="Free-PMO"
APP_ENV=local APP_ENV=local
APP_KEY=SomeRandomString APP_KEY=SomeRandomString
APP_DEBUG=true APP_DEBUG=true
APP_LOG_LEVEL=debug APP_LOG_LEVEL=debug
APP_URL=http://localhost APP_URL=http://localhost
LOG_CHANNEL=stack
APP_TIMEZONE=Asia/Makassar APP_TIMEZONE=Asia/Makassar
DB_CONNECTION=mysql DB_CONNECTION=mysql
@ -28,4 +30,12 @@ MAIL_USERNAME=null
MAIL_PASSWORD=null MAIL_PASSWORD=null
MAIL_ENCRYPTION=null MAIL_ENCRYPTION=null
MAIL_FROM=null MAIL_FROM=null
MAIL_NAME=null
MAIL_NAME=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

1
.travis.yml

@ -1,7 +1,6 @@
language: php language: php
php: php:
- 7.0
- 7.1 - 7.1
before_script: before_script:

4
README.id.md

@ -41,7 +41,7 @@ Tujuan utama Free PMO adalah membantu pengelolaan data project dengan mudah dan
Aplikasi ini dapat dipasang dalam server lokal (PC/Laptop) dan server online, dengan spesifikasi berikut : Aplikasi ini dapat dipasang dalam server lokal (PC/Laptop) dan server online, dengan spesifikasi berikut :
#### Spesifikasi minimum server #### Spesifikasi minimum server
1. PHP 7.0 (dan memenuhi [server requirement Laravel 5.5](https://laravel.com/docs/5.5#server-requirements)),
1. PHP 7.1.3 (dan memenuhi [server requirement Laravel 5.7](https://laravel.com/docs/5.7#server-requirements)),
2. MySQL atau MariaDB, 2. MySQL atau MariaDB,
3. SQlite (untuk automated testing). 3. SQlite (untuk automated testing).
@ -72,7 +72,7 @@ Project ini dikembangkan oleh [Nafies Luthfi](https://github.com/nafiesl) dan pa
Free PMO dibangun menggunakan [metode TDD](https://blog.nafies.id/laravel/testing-laravel-tentang-automated-testing) dengan bahan dan dukungan dari paket-paket berikut ini : Free PMO dibangun menggunakan [metode TDD](https://blog.nafies.id/laravel/testing-laravel-tentang-automated-testing) dengan bahan dan dukungan dari paket-paket berikut ini :
##### Dependencies ##### Dependencies
* [Framework Laravel](https://laravel.com/docs/5.5) (versi 5.2 s/d 5.5).
* [Framework Laravel](https://laravel.com/docs/5.7) (versi 5.2 s/d 5.7).
* [luthfi/formfield](https://github.com/nafiesl/FormField), Wrapper Form dari [laravelcollective/html](https://github.com/laravelcollective/html) dengan Bootstrap 3. * [luthfi/formfield](https://github.com/nafiesl/FormField), Wrapper Form dari [laravelcollective/html](https://github.com/laravelcollective/html) dengan Bootstrap 3.
* [riskihajar/terbilang](https://github.com/riskihajar/terbilang), membuat angka terbilang (pada fitur cetak kuitansi) dan romawi. * [riskihajar/terbilang](https://github.com/riskihajar/terbilang), membuat angka terbilang (pada fitur cetak kuitansi) dan romawi.

4
README.md

@ -43,7 +43,7 @@ Free PMO was built for easy and professional project management.
This application can be installed on local server and online server with these specifications : This application can be installed on local server and online server with these specifications :
#### Server Requirements #### Server Requirements
1. PHP 7.0 (and meet [Laravel 5.5 server requirements](https://laravel.com/docs/5.5#server-requirements)),
1. PHP 7.1.3 (and meet [Laravel 5.7 server requirements](https://laravel.com/docs/5.7#server-requirements)),
2. MySQL or MariaDB database, 2. MySQL or MariaDB database,
3. SQlite (for automated testing). 3. SQlite (for automated testing).
@ -74,7 +74,7 @@ This project maintained by [Nafies Luthfi](https://github.com/nafiesl) and devel
Free PMO built with [TDD metode](https://blog.nafies.id/laravel/testing-laravel-tentang-automated-testing) with these ingredients support : Free PMO built with [TDD metode](https://blog.nafies.id/laravel/testing-laravel-tentang-automated-testing) with these ingredients support :
##### Dependencies ##### Dependencies
* [Framework Laravel](https://laravel.com/docs/5.5) (version 5.2 to 5.5).
* [Framework Laravel](https://laravel.com/docs/5.7) (version 5.2 to 5.7).
* [luthfi/formfield](https://github.com/nafiesl/FormField), Bootstrap 3 Form Wrapper for [laravelcollective/html](https://github.com/laravelcollective/html). * [luthfi/formfield](https://github.com/nafiesl/FormField), Bootstrap 3 Form Wrapper for [laravelcollective/html](https://github.com/laravelcollective/html).
* [riskihajar/terbilang](https://github.com/riskihajar/terbilang), create indonesian in-word number (for payment receipt) and roman numeral. * [riskihajar/terbilang](https://github.com/riskihajar/terbilang), create indonesian in-word number (for payment receipt) and roman numeral.

41
app/Entities/BaseRepository.php

@ -4,8 +4,6 @@ namespace App\Entities;
use App\Entities\Users\User; use App\Entities\Users\User;
use App\Entities\Projects\Job; use App\Entities\Projects\Job;
use App\Entities\Partners\Vendor;
use App\Entities\Projects\Project;
use App\Entities\Partners\Customer; use App\Entities\Partners\Customer;
/** /**
@ -22,22 +20,9 @@ abstract class BaseRepository extends EloquentRepository
*/ */
public function getCustomersList() public function getCustomersList()
{ {
return Customer::orderBy('name')->pluck('name', 'id');
}
/**
* Get list of customers and vendors.
*
* @return array
*/
public function getCustomersAndVendorsList()
{
$partners = [
'Customer' => Customer::orderBy('name')->pluck('name', 'id')->all(),
'Vendor' => Vendor::orderBy('name')->pluck('name', 'id')->all(),
];
return $partners;
return Customer::where('is_active', 1)
->orderBy('name')
->pluck('name', 'id');
} }
/** /**
@ -51,26 +36,6 @@ abstract class BaseRepository extends EloquentRepository
} }
/** /**
* Get collection of vendors.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getVendorsList()
{
return Vendor::orderBy('name')->pluck('name', 'id');
}
/**
* Get collection of projects.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getProjectsList()
{
return Project::orderBy('name')->pluck('name', 'id');
}
/**
* Get Job by it's id. * Get Job by it's id.
* *
* @param int $jobId * @param int $jobId

2
app/Entities/Payments/PaymentPresenter.php

@ -8,7 +8,7 @@ class PaymentPresenter extends Presenter
{ {
public function amount() public function amount()
{ {
return $this->entity->in_out == 0 ? formatRp(-$this->entity->amount) : formatRp($this->entity->amount);
return $this->entity->in_out == 0 ? format_money(-$this->entity->amount) : format_money($this->entity->amount);
} }
public function projectLink() public function projectLink()

8
app/Entities/Projects/File.php

@ -2,6 +2,7 @@
namespace App\Entities\Projects; namespace App\Entities\Projects;
use Storage;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
class File extends Model class File extends Model
@ -37,4 +38,11 @@ class File extends Model
{ {
return \Storage::exists('public/files/'.$this->filename); return \Storage::exists('public/files/'.$this->filename);
} }
public function delete()
{
Storage::delete('public/files/'.$this->filename);
return parent::delete();
}
} }

60
app/Entities/Projects/Issue.php

@ -0,0 +1,60 @@
<?php
namespace App\Entities\Projects;
use App\Entities\Users\User;
use Illuminate\Database\Eloquent\Model;
class Issue extends Model
{
protected $fillable = [
'project_id', 'title', 'body', 'priority_id', 'pic_id', 'creator_id',
];
public function project()
{
return $this->belongsTo(Project::class);
}
public function pic()
{
return $this->belongsTo(User::class)->withDefault(['name' => __('issue.no_pic')]);
}
public function creator()
{
return $this->belongsTo(User::class);
}
public function getPriorityAttribute()
{
return Priority::getNameById($this->priority_id);
}
public function getPriorityLabelAttribute()
{
$classColor = Priority::getColorById($this->priority_id);
return '<span class="label label-'.$classColor.'">'.$this->priority.'</span>';
}
public function getStatusAttribute()
{
return IssueStatus::getNameById($this->status_id);
}
public function getStatusLabelAttribute()
{
return '<span class="badge">'.$this->status.'</span>';
}
/**
* Issue has many comments relation.
*
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function comments()
{
return $this->morphMany(Comment::class, 'commentable');
}
}

39
app/Entities/Projects/IssueStatus.php

@ -0,0 +1,39 @@
<?php
namespace App\Entities\Projects;
use App\Entities\ReferenceAbstract;
class IssueStatus extends ReferenceAbstract
{
protected static $lists = [
0 => 'open',
1 => 'resolved',
2 => 'closed',
3 => 'on_hold',
4 => 'invalid',
];
protected static $colors = [
0 => 'yellow',
1 => 'green',
2 => 'primary',
3 => 'default',
4 => 'warning',
];
public static function getNameById($singleId)
{
return trans('issue.'.static::getById($singleId));
}
public static function toArray()
{
$lists = [];
foreach (static::$lists as $key => $value) {
$lists[$key] = trans('issue.'.$value);
}
return $lists;
}
}

16
app/Entities/Projects/Job.php

@ -2,6 +2,7 @@
namespace App\Entities\Projects; namespace App\Entities\Projects;
use DB;
use App\Entities\Users\User; use App\Entities\Users\User;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Laracasts\Presenter\PresentableTrait; use Laracasts\Presenter\PresentableTrait;
@ -109,4 +110,19 @@ class Job extends Model
{ {
return $this->price * ($this->progress / 100); return $this->price * ($this->progress / 100);
} }
/**
* Delete the model from the database.
*
* @return bool|null
*/
public function delete()
{
DB::beginTransaction();
$this->tasks()->delete();
$this->comments()->delete();
DB::commit();
return parent::delete();
}
} }

35
app/Entities/Projects/Priority.php

@ -0,0 +1,35 @@
<?php
namespace App\Entities\Projects;
use App\Entities\ReferenceAbstract;
class Priority extends ReferenceAbstract
{
protected static $lists = [
1 => 'minor',
2 => 'major',
3 => 'critical',
];
protected static $colors = [
1 => 'info',
2 => 'warning',
3 => 'danger',
];
public static function getNameById($singleId)
{
return trans('issue.'.static::getById($singleId));
}
public static function toArray()
{
$lists = [];
foreach (static::$lists as $key => $value) {
$lists[$key] = trans('issue.'.$value);
}
return $lists;
}
}

36
app/Entities/Projects/Project.php

@ -2,6 +2,7 @@
namespace App\Entities\Projects; namespace App\Entities\Projects;
use DB;
use App\Entities\Invoices\Invoice; use App\Entities\Invoices\Invoice;
use App\Entities\Payments\Payment; use App\Entities\Payments\Payment;
use App\Entities\Partners\Customer; use App\Entities\Partners\Customer;
@ -234,14 +235,43 @@ class Project extends Model
return '-'; return '-';
} }
$workDuration = dateDifference($startDate, $endDate);
$workDuration = date_difference($startDate, $endDate);
if ((int) $workDuration > 365) { if ((int) $workDuration > 365) {
return dateDifference($startDate, $endDate, '%y Year(s) %m Month(s)');
return date_difference($startDate, $endDate, '%y Year(s) %m Month(s)');
} elseif ((int) $workDuration > 30) { } elseif ((int) $workDuration > 30) {
return dateDifference($startDate, $endDate, '%m Month(s) %d Day(s)');
return date_difference($startDate, $endDate, '%m Month(s) %d Day(s)');
} }
return $workDuration.' Day(s)'; return $workDuration.' Day(s)';
} }
/**
* Delete the model from the database.
*
* @return bool|null
*/
public function delete()
{
DB::beginTransaction();
$this->jobs->each->delete();
$this->files->each->delete();
$this->invoices()->delete();
$this->payments()->delete();
$this->subscriptions()->delete();
$this->comments()->delete();
DB::commit();
return parent::delete();
}
/**
* Project has many Issues relation.
*
* @return \Illuminate\Database\Eloquent\Relations\HasMany
*/
public function issues()
{
return $this->hasMany(Issue::class);
}
} }

22
app/Entities/Reports/ReportsRepository.php

@ -106,6 +106,28 @@ class ReportsRepository extends BaseRepository
return collect($reports); return collect($reports);
} }
public function getYearToYearReports()
{
$rawQuery = 'YEAR(date) as year';
$rawQuery .= ', count(`id`) as count';
$rawQuery .= ', sum(if(in_out = 1, amount, 0)) AS cashin';
$rawQuery .= ', sum(if(in_out = 0, amount, 0)) AS cashout';
$reportsData = DB::table('payments')->select(DB::raw($rawQuery))
->groupBy(DB::raw('YEAR(date)'))
->orderBy('date', 'asc')
->get();
$reports = [];
foreach ($reportsData as $report) {
$key = str_pad($report->year, 2, '0', STR_PAD_LEFT);
$reports[$key] = $report;
$reports[$key]->profit = $report->cashin - $report->cashout;
}
return collect($reports);
}
/** /**
* Get current credit/receiveble earnings report. * Get current credit/receiveble earnings report.
* *

10
app/Entities/Subscriptions/Subscription.php

@ -20,13 +20,13 @@ class Subscription extends Model
protected $guarded = ['id', 'created_at', 'updated_at']; protected $guarded = ['id', 'created_at', 'updated_at'];
/** /**
* Show subscription name with link to subscription detail.
* Show subscription name with link to subscription detail attribute.
* *
* @return Illuminate\Support\HtmlString * @return Illuminate\Support\HtmlString
*/ */
public function nameLink()
public function getNameLinkAttribute()
{ {
return link_to_route('subscriptions.show', $this->name, [$this->id], [
return link_to_route('subscriptions.show', $this->name, $this, [
'title' => __( 'title' => __(
'app.show_detail_title', 'app.show_detail_title',
['name' => $this->name, 'type' => __('subscription.subscription')] ['name' => $this->name, 'type' => __('subscription.subscription')]
@ -61,8 +61,8 @@ class Subscription extends Model
*/ */
public function dueDateDescription() public function dueDateDescription()
{ {
$dueDateDescription = __('subscription.start_date').' : '.dateId($this->start_date)."\n";
$dueDateDescription .= __('subscription.due_date').' : '.dateId($this->due_date);
$dueDateDescription = __('subscription.start_date').' : '.date_id($this->start_date)."\n";
$dueDateDescription .= __('subscription.due_date').' : '.date_id($this->due_date);
return $dueDateDescription; return $dueDateDescription;
} }

52
app/Entities/Subscriptions/SubscriptionsRepository.php

@ -1,52 +0,0 @@
<?php
namespace App\Entities\Subscriptions;
use App\Entities\BaseRepository;
/**
* Subscriptions Repository Class.
*/
class SubscriptionsRepository extends BaseRepository
{
/**
* Subscription model.
*
* @var \App\Entities\Subscriptions\Subscription
*/
protected $model;
/**
* Create SubscriptionRepository class instance.
*
* @param \App\Entities\Subscriptions\Subscription $model
*/
public function __construct(Subscription $model)
{
parent::__construct($model);
}
/**
* Get subscrioption list.
*
* @param string $q
* @param int $customerId
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
public function getSubscriptions($q, $customerId)
{
return $this->model->orderBy('status_id', 'desc')
->orderBy('due_date')
->where(function ($query) use ($q, $customerId) {
if ($customerId) {
$query->where('customer_id', $customerId);
}
if ($q) {
$query->where('name', 'like', '%'.$q.'%');
}
})
->with('customer', 'vendor')
->paginate($this->_paginate);
}
}

18
app/Http/Controllers/Api/CustomerController.php

@ -0,0 +1,18 @@
<?php
namespace App\Http\Controllers\Api;
use App\Entities\Partners\Customer;
use App\Http\Controllers\Controller;
class CustomerController extends Controller
{
public function index()
{
$customers = Customer::where('is_active', 1)
->orderBy('name')
->pluck('name', 'id');
return response()->json($customers);
}
}

18
app/Http/Controllers/Api/VendorController.php

@ -0,0 +1,18 @@
<?php
namespace App\Http\Controllers\Api;
use App\Entities\Partners\Vendor;
use App\Http\Controllers\Controller;
class VendorController extends Controller
{
public function index()
{
$vendors = Vendor::where('is_active', 1)
->orderBy('name')
->pluck('name', 'id');
return response()->json($vendors);
}
}

38
app/Http/Controllers/Controller.php

@ -2,6 +2,9 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Entities\Partners\Vendor;
use App\Entities\Projects\Project;
use App\Entities\Partners\Customer;
use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController; use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Foundation\Validation\ValidatesRequests;
@ -10,4 +13,39 @@ use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController class Controller extends BaseController
{ {
use AuthorizesRequests, DispatchesJobs, ValidatesRequests; use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
/**
* Get collection of projects.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getProjectsList()
{
return Project::orderBy('name')->pluck('name', 'id');
}
/**
* Get collection of vendors.
*
* @return \Illuminate\Database\Eloquent\Collection
*/
public function getVendorsList()
{
return Vendor::where('is_active', 1)
->orderBy('name')
->pluck('name', 'id');
}
/**
* Get list of customers and vendors.
*
* @return array
*/
public function getCustomersAndVendorsList()
{
return [
__('customer.customer') => Customer::orderBy('name')->pluck('name', 'id')->all(),
__('vendor.vendor') => Vendor::orderBy('name')->pluck('name', 'id')->all(),
];
}
} }

83
app/Http/Controllers/Issues/CommentController.php

@ -0,0 +1,83 @@
<?php
namespace App\Http\Controllers\Issues;
use Illuminate\Http\Request;
use App\Entities\Projects\Issue;
use App\Entities\Projects\Comment;
use App\Http\Controllers\Controller;
class CommentController extends Controller
{
/**
* Store a new comment in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\Entities\Projects\Issue $issue
* @return \Illuminate\Http\RedirectResponse
*/
public function store(Request $request, Issue $issue)
{
$this->authorize('comment-on', $issue);
$newComment = $request->validate([
'body' => 'required|string|max:255',
]);
$issue->comments()->create([
'body' => $newComment['body'],
'creator_id' => auth()->id(),
]);
$issue->touch();
flash(__('comment.created'), 'success');
return back();
}
/**
* Update the specified comment.
*
* @param \Illuminate\Http\Request $request
* @param \App\Entities\Projects\Issue $issue
* @param \App\Entities\Projects\Comment $comment
* @return \Illuminate\Http\Response
*/
public function update(Request $request, Issue $issue, Comment $comment)
{
$this->authorize('update', $comment);
$commentData = $request->validate([
'body' => 'required|string|max:255',
]);
$comment->update($commentData);
flash(__('comment.updated'), 'success');
return redirect()->route('projects.issues.show', [$issue->project, $issue]);
}
/**
* Remove the specified comment.
*
* @param \App\Entities\Projects\Issue $issue
* @param \\App\Entities\Projects\Comment $comment
* @return \Illuminate\Routing\Redirector
*/
public function destroy(Issue $issue, Comment $comment)
{
$this->authorize('delete', $comment);
request()->validate([
'comment_id' => 'required|exists:comments,id',
]);
if (request('comment_id') == $comment->id && $comment->delete()) {
flash(__('comment.deleted'), 'warning');
return redirect()->route('projects.issues.show', [$issue->project, $issue]);
}
flash(__('comment.undeleted'), 'error');
return back();
}
}

26
app/Http/Controllers/Issues/OptionController.php

@ -0,0 +1,26 @@
<?php
namespace App\Http\Controllers\Issues;
use Illuminate\Http\Request;
use App\Entities\Projects\Issue;
use App\Http\Controllers\Controller;
class OptionController extends Controller
{
public function update(Request $request, Issue $issue)
{
$issueData = $request->validate([
'priority_id' => 'required|in:1,2,3',
'status_id' => 'required|in:0,1,2,3,4',
'pic_id' => 'nullable|exists:users,id',
]);
$issue->priority_id = $issueData['priority_id'];
$issue->status_id = $issueData['status_id'];
$issue->pic_id = $issueData['pic_id'];
$issue->save();
flash(__('issue.updated'), 'success');
return back();
}
}

10
app/Http/Controllers/PaymentsController.php

@ -54,8 +54,8 @@ class PaymentsController extends Controller
*/ */
public function create() public function create()
{ {
$projects = $this->repo->getProjectsList();
$partners = $this->repo->getCustomersAndVendorsList();
$projects = $this->getProjectsList();
$partners = $this->getCustomersAndVendorsList();
$project = Project::find(request('project_id')); $project = Project::find(request('project_id'));
return view('payments.create', compact('projects', 'partners', 'project')); return view('payments.create', compact('projects', 'partners', 'project'));
@ -94,12 +94,14 @@ class PaymentsController extends Controller
*/ */
public function edit(Payment $payment) public function edit(Payment $payment)
{ {
$projects = $this->repo->getProjectsList();
$projects = $this->getProjectsList();
if ($payment->partner_type == 'App\Entities\Users\User') { if ($payment->partner_type == 'App\Entities\Users\User') {
$partners = $this->repo->getWorkersList(); $partners = $this->repo->getWorkersList();
} elseif ($payment->partner_type == 'App\Entities\Partners\Customer') {
$partners = [__('customer.customer') => $this->repo->getCustomersList()];
} else { } else {
$partners = $this->repo->getCustomersAndVendorsList();
$partners = [__('vendor.vendor') => $this->getVendorsList()];
} }
return view('payments.edit', compact('payment', 'projects', 'partners')); return view('payments.edit', compact('payment', 'projects', 'partners'));

20
app/Http/Controllers/Projects/FilesController.php

@ -70,7 +70,7 @@ class FilesController extends Controller
return response()->download(storage_path('app/public/files/'.$file->filename), $file->title.'.'.$extension); return response()->download(storage_path('app/public/files/'.$file->filename), $file->title.'.'.$extension);
} }
flash(trans('file.not_found'), 'danger');
flash(__('file.not_found'), 'danger');
if (\URL::previous() != \URL::current()) { if (\URL::previous() != \URL::current()) {
return back(); return back();
@ -85,7 +85,15 @@ class FilesController extends Controller
$file->description = $request->get('description'); $file->description = $request->get('description');
$file->save(); $file->save();
flash(trans('file.updated'), 'success');
flash(__('file.updated'), 'success');
return redirect()->route($file->fileable_type.'.files', $file->fileable_id);
}
public function destroy(Request $request, File $file)
{
$file->delete();
flash(__('file.deleted'), 'warning');
return redirect()->route($file->fileable_type.'.files', $file->fileable_id); return redirect()->route($file->fileable_type.'.files', $file->fileable_id);
} }
@ -101,13 +109,7 @@ class FilesController extends Controller
$fileData['title'] = $data['title']; $fileData['title'] = $data['title'];
$fileData['description'] = $data['description']; $fileData['description'] = $data['description'];
\DB::beginTransaction(); \DB::beginTransaction();
// dd(is_dir(storage_path('app/public/files')));
if (env('APP_ENV') == 'testing') {
$file->store('public/files', 'avatar');
} else {
$file->store('public/files');
}
// $file->move(storage_path('app/public/files'));
$file->store('public/files');
$file = File::create($fileData); $file = File::create($fileData);
\DB::commit(); \DB::commit();

116
app/Http/Controllers/Projects/IssueController.php

@ -0,0 +1,116 @@
<?php
namespace App\Http\Controllers\Projects;
use App\Entities\Users\User;
use Illuminate\Http\Request;
use App\Entities\Projects\Issue;
use App\Entities\Projects\Comment;
use App\Entities\Projects\Project;
use App\Entities\Projects\Priority;
use App\Http\Controllers\Controller;
use App\Entities\Projects\IssueStatus;
class IssueController extends Controller
{
public function index(Project $project)
{
$issueQuery = $project->issues()
->orderBy('updated_at', 'desc')
->with(['pic', 'creator'])
->withCount(['comments']);
if ($priorityId = request('priority_id')) {
$issueQuery->where('priority_id', $priorityId);
}
if ($statusId = request('status_id')) {
$issueQuery->where('status_id', $priorityId);
}
$issues = $issueQuery->get();
return view('projects.issues.index', compact('project', 'issues'));
}
public function create(Project $project)
{
$users = User::pluck('name', 'id');
$priorities = Priority::toArray();
return view('projects.issues.create', compact('project', 'users', 'priorities'));
}
public function store(Request $request, Project $project)
{
$issueData = $request->validate([
'title' => 'required|max:60',
'body' => 'required|max:255',
'priority_id' => 'required|in:1,2,3',
'pic_id' => 'nullable|exists:users,id',
]);
Issue::create([
'project_id' => $project->id,
'creator_id' => auth()->id(),
'title' => $issueData['title'],
'body' => $issueData['body'],
'priority_id' => $issueData['priority_id'],
'pic_id' => $issueData['pic_id'],
]);
flash(__('issue.created'), 'success');
return redirect()->route('projects.issues.index', $project);
}
public function show(Project $project, Issue $issue)
{
$editableComment = null;
$priorities = Priority::toArray();
$statuses = IssueStatus::toArray();
$users = User::pluck('name', 'id');
$comments = $issue->comments()->with('creator')->get();
if (request('action') == 'comment-edit' && request('comment_id') != null) {
$editableComment = Comment::find(request('comment_id'));
}
return view('projects.issues.show', compact(
'project', 'issue', 'users', 'statuses', 'priorities', 'comments',
'editableComment'
));
}
public function edit(Project $project, Issue $issue)
{
return view('projects.issues.edit', compact('project', 'issue'));
}
public function update(Request $request, Project $project, Issue $issue)
{
$issueData = $request->validate([
'title' => 'required|max:60',
'body' => 'required|max:255',
]);
$issue->title = $issueData['title'];
$issue->body = $issueData['body'];
$issue->save();
flash(__('issue.updated'), 'success');
return redirect()->route('projects.issues.show', [$project, $issue]);
}
public function destroy(Request $request, Project $project, Issue $issue)
{
$request->validate(['issue_id' => 'required']);
if ($request->get('issue_id') == $issue->id && $issue->delete()) {
flash(__('issue.deleted'), 'warning');
return redirect()->route('projects.issues.index', $project);
}
flash(__('issue.undeleted'), 'danger');
return back();
}
}

2
app/Http/Controllers/Projects/JobsController.php

@ -40,7 +40,7 @@ class JobsController extends Controller
{ {
$selectedProject = null; $selectedProject = null;
$workers = $this->repo->getWorkersList(); $workers = $this->repo->getWorkersList();
$projects = $this->repo->getProjectsList();
$projects = $this->getProjectsList();
if ($request->has('project_id')) { if ($request->has('project_id')) {
$selectedProject = Project::find($request->get('project_id')); $selectedProject = Project::find($request->get('project_id'));

42
app/Http/Controllers/Reports/LogFileController.php

@ -0,0 +1,42 @@
<?php
namespace App\Http\Controllers\Reports;
use App\Http\Controllers\Controller;
class LogFileController extends Controller
{
public function index()
{
if (!file_exists(storage_path('logs'))) {
return [];
}
$logFiles = \File::allFiles(storage_path('logs'));
// Sort files by modified time DESC
usort($logFiles, function ($a, $b) {
return -1 * strcmp($a->getMTime(), $b->getMTime());
});
return view('reports.log-files', compact('logFiles'));
}
public function show($fileName)
{
if (file_exists(storage_path('logs/'.$fileName))) {
return response()->file(storage_path('logs/'.$fileName), ['content-type' => 'text/plain']);
}
return 'Invalid file name.';
}
public function download($fileName)
{
if (file_exists(storage_path('logs/'.$fileName))) {
return response()->download(storage_path('logs/'.$fileName), env('APP_ENV').'.'.$fileName);
}
return 'Invalid file name.';
}
}

13
app/Http/Controllers/ReportsController.php

@ -45,8 +45,8 @@ class ReportsController extends Controller
$month = $req->get('month'); $month = $req->get('month');
} }
$reports = $this->repo->getMonthlyReports($year, $month); $reports = $this->repo->getMonthlyReports($year, $month);
$months = \getMonths();
$years = \getYears();
$months = \get_months();
$years = \get_years();
return view('reports.payments.monthly', compact('reports', 'months', 'years', 'month', 'year')); return view('reports.payments.monthly', compact('reports', 'months', 'years', 'month', 'year'));
} }
@ -56,11 +56,18 @@ class ReportsController extends Controller
$year = $req->get('year', date('Y')); $year = $req->get('year', date('Y'));
$reports = $this->repo->getYearlyReports($year); $reports = $this->repo->getYearlyReports($year);
$years = \getYears();
$years = \get_years();
return view('reports.payments.yearly', compact('reports', 'years', 'year')); return view('reports.payments.yearly', compact('reports', 'years', 'year'));
} }
public function yearToYear(Request $request)
{
$reports = $this->repo->getYearToYearReports();
return view('reports.payments.year_to_year', compact('reports'));
}
public function currentCredits() public function currentCredits()
{ {
$projects = $this->repo->getCurrentCredits(); $projects = $this->repo->getCurrentCredits();

64
app/Http/Controllers/SubscriptionsController.php

@ -5,7 +5,6 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use App\Entities\Subscriptions\Type; use App\Entities\Subscriptions\Type;
use App\Entities\Subscriptions\Subscription; use App\Entities\Subscriptions\Subscription;
use App\Entities\Subscriptions\SubscriptionsRepository;
use App\Http\Requests\SubscriptionRequest as FormRequest; use App\Http\Requests\SubscriptionRequest as FormRequest;
/** /**
@ -16,21 +15,6 @@ use App\Http\Requests\SubscriptionRequest as FormRequest;
class SubscriptionsController extends Controller class SubscriptionsController extends Controller
{ {
/** /**
* @var \App\Entities\Subscriptions\SubscriptionsRepository
*/
private $repo;
/**
* Create new Subscription Controller.
*
* @param \App\Entities\Subscriptions\SubscriptionsRepository $repo
*/
public function __construct(SubscriptionsRepository $repo)
{
$this->repo = $repo;
}
/**
* Show subscription list. * Show subscription list.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
@ -38,7 +22,7 @@ class SubscriptionsController extends Controller
*/ */
public function index(Request $request) public function index(Request $request)
{ {
$subscriptions = $this->repo->getSubscriptions(
$subscriptions = $this->getSubscriptionListing(
$request->get('q'), $request->get('q'),
$request->get('vendor_id') $request->get('vendor_id')
); );
@ -53,8 +37,8 @@ class SubscriptionsController extends Controller
*/ */
public function create() public function create()
{ {
$projects = $this->repo->getProjectsList();
$vendors = $this->repo->getVendorsList();
$projects = $this->getProjectsList();
$vendors = $this->getVendorsList();
return view('subscriptions.create', compact('projects', 'vendors')); return view('subscriptions.create', compact('projects', 'vendors'));
} }
@ -67,9 +51,8 @@ class SubscriptionsController extends Controller
*/ */
public function store(FormRequest $subscriptionCreateRequest) public function store(FormRequest $subscriptionCreateRequest)
{ {
$subscriptionCreateRequest->approveFor(new Subscription());
flash(trans('subscription.created'), 'success');
$subscriptionCreateRequest->approveToCreate(new Subscription());
flash(__('subscription.created'), 'success');
return redirect()->route('subscriptions.index'); return redirect()->route('subscriptions.index');
} }
@ -95,8 +78,8 @@ class SubscriptionsController extends Controller
*/ */
public function edit(Subscription $subscription) public function edit(Subscription $subscription)
{ {
$projects = $this->repo->getProjectsList();
$vendors = $this->repo->getVendorsList();
$projects = $this->getProjectsList();
$vendors = $this->getVendorsList();
$pageTitle = $this->getPageTitle('edit', $subscription); $pageTitle = $this->getPageTitle('edit', $subscription);
@ -112,9 +95,8 @@ class SubscriptionsController extends Controller
*/ */
public function update(FormRequest $subscriptionUpdateRequest, Subscription $subscription) public function update(FormRequest $subscriptionUpdateRequest, Subscription $subscription)
{ {
$subscriptionUpdateRequest->approveFor($subscription);
flash(trans('subscription.updated'), 'success');
$subscriptionUpdateRequest->approveToUpdate($subscription);
flash(__('subscription.updated'), 'success');
return redirect()->route('subscriptions.edit', $subscription->id); return redirect()->route('subscriptions.edit', $subscription->id);
} }
@ -129,8 +111,7 @@ class SubscriptionsController extends Controller
public function destroy(FormRequest $subscriptionDeleteRequest, Subscription $subscription) public function destroy(FormRequest $subscriptionDeleteRequest, Subscription $subscription)
{ {
$subscriptionDeleteRequest->approveToDelete($subscription); $subscriptionDeleteRequest->approveToDelete($subscription);
flash(trans('subscription.deleted'), 'success');
flash(__('subscription.deleted'), 'success');
return redirect()->route('subscriptions.index'); return redirect()->route('subscriptions.index');
} }
@ -154,6 +135,29 @@ class SubscriptionsController extends Controller
*/ */
private function getPageTitle($pageType, $subscription) private function getPageTitle($pageType, $subscription)
{ {
return trans('subscription.'.$pageType).' - '.$subscription->name.' - '.$subscription->customer->name;
return __('subscription.'.$pageType).' - '.$subscription->name.' - '.$subscription->customer->name;
}
/**
* Get subscrioption list.
*
* @param string $searchQuery
* @param int $customerId
* @return \Illuminate\Pagination\LengthAwarePaginator
*/
private function getSubscriptionListing($searchQuery, $customerId)
{
$subscriptionQuery = Subscription::orderBy('status_id', 'desc')
->orderBy('due_date')
->with('customer', 'vendor');
if ($searchQuery) {
$subscriptionQuery->where('name', 'like', '%'.$searchQuery.'%');
}
if ($customerId) {
$subscriptionQuery->where('customer_id', $customerId);
}
return $subscriptionQuery->paginate(25);
} }
} }

22
app/Http/Controllers/Users/CalendarController.php

@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers\Users;
use App\Entities\Projects\Project;
use App\Http\Controllers\Controller;
class CalendarController extends Controller
{
public function index()
{
$user = auth()->user();
if ($user->hasRole('admin') == false) {
$projects = $user->projects()->orderBy('projects.name')->pluck('projects.name', 'projects.id');
} else {
$projects = Project::orderBy('name')->pluck('name', 'id');
}
return view('users.calendar', compact('projects'));
}
}

23
app/Http/Middleware/TrustProxies.php

@ -0,0 +1,23 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}

52
app/Http/Requests/SubscriptionRequest.php

@ -25,10 +25,6 @@ class SubscriptionRequest extends Request
public function rules() public function rules()
{ {
switch ($this->method()) { switch ($this->method()) {
case 'POST':
return $this->getCreateRules();
break;
case 'PATCH': case 'PATCH':
return $this->getUpdateRules(); return $this->getUpdateRules();
break; break;
@ -38,6 +34,7 @@ class SubscriptionRequest extends Request
break; break;
default: default:
return $this->getCreateRules();
break; break;
} }
} }
@ -52,7 +49,7 @@ class SubscriptionRequest extends Request
'project_id' => 'required|numeric|exists:projects,id', 'project_id' => 'required|numeric|exists:projects,id',
'vendor_id' => 'required|numeric|exists:vendors,id', 'vendor_id' => 'required|numeric|exists:vendors,id',
'type_id' => 'required|numeric', 'type_id' => 'required|numeric',
'remark' => 'max:255',
'notes' => 'nullable|max:255',
]; ];
} }
@ -66,7 +63,7 @@ class SubscriptionRequest extends Request
'project_id' => 'required|numeric|exists:projects,id', 'project_id' => 'required|numeric|exists:projects,id',
'vendor_id' => 'required|numeric|exists:vendors,id', 'vendor_id' => 'required|numeric|exists:vendors,id',
'type_id' => 'required|numeric', 'type_id' => 'required|numeric',
'remark' => 'max:255',
'notes' => 'nullable|max:255',
]; ];
} }
@ -79,28 +76,33 @@ class SubscriptionRequest extends Request
]; ];
} }
public function approveFor(Subscription $subscription)
public function approveToCreate(Subscription $subscription)
{ {
$project = Project::findOrFail($this->get('project_id')); $project = Project::findOrFail($this->get('project_id'));
if ($subscription->exists) {
$subscriptionData = $this->except(['_method', '_token']);
$subscriptionData['customer_id'] = $project->customer_id;
$subscription->update($subscriptionData);
} else {
$subscription->project_id = $project->id;
$subscription->vendor_id = $this->get('vendor_id');
$subscription->customer_id = $project->customer_id;
$subscription->name = $this->get('name');
$subscription->price = $this->get('price');
$subscription->start_date = $this->get('start_date');
$subscription->due_date = $this->get('due_date');
$subscription->type_id = $this->get('type_id');
$subscription->notes = $this->get('notes');
$subscription->save();
}
$subscription->project_id = $project->id;
$subscription->vendor_id = $this->get('vendor_id');
$subscription->customer_id = $project->customer_id;
$subscription->name = $this->get('name');
$subscription->price = $this->get('price');
$subscription->start_date = $this->get('start_date');
$subscription->due_date = $this->get('due_date');
$subscription->type_id = $this->get('type_id');
$subscription->notes = $this->get('notes');
$subscription->save();
return $subscription;
}
public function approveToUpdate(Subscription $subscription)
{
$project = Project::findOrFail($this->get('project_id'));
$subscriptionData = $this->except(['_method', '_token']);
$subscriptionData['customer_id'] = $project->customer_id;
$subscription->update($subscriptionData);
return $subscription; return $subscription;
} }

29
app/Policies/Projects/IssuePolicy.php

@ -0,0 +1,29 @@
<?php
namespace App\Policies\Projects;
use App\Entities\Users\User;
use App\Entities\Projects\Issue;
use Illuminate\Auth\Access\HandlesAuthorization;
class IssuePolicy
{
use HandlesAuthorization;
public function create(User $user, Issue $issue)
{
return true;
}
/**
* Determine whether the user can add comment to an issue.
*
* @param \App\Entities\Users\User $user
* @param \App\Entities\Projects\Issue $issue
* @return bool
*/
public function commentOn(User $user, Issue $issue)
{
return true;
}
}

1
app/Providers/AppServiceProvider.php

@ -22,6 +22,7 @@ class AppServiceProvider extends ServiceProvider
Relation::morphMap([ Relation::morphMap([
'projects' => 'App\Entities\Projects\Project', 'projects' => 'App\Entities\Projects\Project',
'issues' => 'App\Entities\Projects\Issue',
'jobs' => 'App\Entities\Projects\Job', 'jobs' => 'App\Entities\Projects\Job',
]); ]);
} }

1
app/Providers/AuthServiceProvider.php

@ -18,6 +18,7 @@ class AuthServiceProvider extends ServiceProvider
'App\Entities\Projects\Project' => 'App\Policies\Projects\ProjectPolicy', 'App\Entities\Projects\Project' => 'App\Policies\Projects\ProjectPolicy',
'App\Entities\Projects\Comment' => 'App\Policies\Projects\CommentPolicy', 'App\Entities\Projects\Comment' => 'App\Policies\Projects\CommentPolicy',
'App\Entities\Projects\Job' => 'App\Policies\Projects\JobPolicy', 'App\Entities\Projects\Job' => 'App\Policies\Projects\JobPolicy',
'App\Entities\Projects\Issue' => 'App\Policies\Projects\IssuePolicy',
'App\Entities\Projects\Task' => 'App\Policies\Projects\TaskPolicy', 'App\Entities\Projects\Task' => 'App\Policies\Projects\TaskPolicy',
'App\Entities\Payments\Payment' => 'App\Policies\PaymentPolicy', 'App\Entities\Payments\Payment' => 'App\Policies\PaymentPolicy',
'App\Entities\Users\User' => 'App\Policies\UserPolicy', 'App\Entities\Users\User' => 'App\Policies\UserPolicy',

62
app/helpers.php

@ -6,17 +6,18 @@
* @param int $number money in integer format * @param int $number money in integer format
* @return string money in string format * @return string money in string format
*/ */
function formatNo($number)
function format_no($number)
{ {
return number_format($number, 0, ',', '.'); return number_format($number, 0, ',', '.');
} }
/** /**
* Get number in money currency format. * Get number in money currency format.
*
* @param int|string $number * @param int|string $number
* @return string * @return string
*/ */
function formatRp($number)
function format_money($number)
{ {
$moneySign = Option::get('money_sign', 'Rp.'); $moneySign = Option::get('money_sign', 'Rp.');
@ -25,10 +26,10 @@ function formatRp($number)
} }
if ($number < 0) { if ($number < 0) {
return '- '.$moneySign.' '.formatNo(abs($number));
return '- '.$moneySign.' '.format_no(abs($number));
} }
return $moneySign.' '.formatNo($number);
return $moneySign.' '.format_no($number);
} }
/** /**
@ -37,41 +38,18 @@ function formatRp($number)
* @param int|string $number * @param int|string $number
* @return string * @return string
*/ */
function formatDecimal($number)
function format_decimal($number)
{ {
return number_format($number, 2, ',', '.'); return number_format($number, 2, ',', '.');
} }
/** /**
* Format date in indonesian format dd-mm-yyyy.
*
* @param string $date
* @return string
*/
function formatDate($date)
{
if (!$date || $date == '0000-00-00') {
return;
}
$explodedDate = explode('-', $date);
if (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[0], $explodedDate[2])) {
return $explodedDate[2].'-'.$explodedDate[1].'-'.$explodedDate[0];
} elseif (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[2], $explodedDate[0])) {
return $explodedDate[2].'-'.$explodedDate[1].'-'.$explodedDate[0];
}
throw new App\Exceptions\InvalidDateException('Invalid date format.');
}
/**
* Get Indonesian date format. * Get Indonesian date format.
* *
* @param string $date * @param string $date
* @return string * @return string
*/ */
function dateId($date)
function date_id($date)
{ {
if (is_null($date) || $date == '0000-00-00') { if (is_null($date) || $date == '0000-00-00') {
return '-'; return '-';
@ -80,7 +58,7 @@ function dateId($date)
$explodedDate = explode('-', $date); $explodedDate = explode('-', $date);
if (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[2], $explodedDate[0])) { if (count($explodedDate) == 3 && checkdate($explodedDate[1], $explodedDate[2], $explodedDate[0])) {
$months = getMonths();
$months = get_months();
return $explodedDate[2].' '.$months[$explodedDate[1]].' '.$explodedDate[0]; return $explodedDate[2].' '.$months[$explodedDate[1]].' '.$explodedDate[0];
} }
@ -94,7 +72,7 @@ function dateId($date)
* @param int|string $number * @param int|string $number
* @return string * @return string
*/ */
function monthNumber($number)
function month_number($number)
{ {
return str_pad($number, 2, '0', STR_PAD_LEFT); return str_pad($number, 2, '0', STR_PAD_LEFT);
} }
@ -105,14 +83,14 @@ function monthNumber($number)
* @param int|string $monthNumber * @param int|string $monthNumber
* @return string * @return string
*/ */
function monthId($monthNumber)
function month_id($monthNumber)
{ {
if (is_null($monthNumber)) { if (is_null($monthNumber)) {
return $monthNumber; return $monthNumber;
} }
$months = getMonths();
$monthNumber = monthNumber($monthNumber);
$months = get_months();
$monthNumber = month_number($monthNumber);
return $months[$monthNumber]; return $months[$monthNumber];
} }
@ -122,7 +100,7 @@ function monthId($monthNumber)
* *
* @return array * @return array
*/ */
function getMonths()
function get_months()
{ {
return [ return [
'01' => __('time.months.01'), '01' => __('time.months.01'),
@ -145,7 +123,7 @@ function getMonths()
* *
* @return array * @return array
*/ */
function getYears()
function get_years()
{ {
$yearRange = range(2014, date('Y')); $yearRange = range(2014, date('Y'));
foreach ($yearRange as $year) { foreach ($yearRange as $year) {
@ -172,7 +150,7 @@ function str_split_ucwords($string)
* @param int $bytes File size. * @param int $bytes File size.
* @return string Converted file size with unit. * @return string Converted file size with unit.
*/ */
function formatSizeUnits($bytes)
function format_size_units($bytes)
{ {
if ($bytes >= 1073741824) { if ($bytes >= 1073741824) {
$bytes = number_format($bytes / 1073741824, 2).' GB'; $bytes = number_format($bytes / 1073741824, 2).' GB';
@ -217,7 +195,7 @@ function html_link_to_route($name, $title = null, $parameters = [], $attributes
* @param string $differenceFormat * @param string $differenceFormat
* @return int|string * @return int|string
*/ */
function dateDifference($date1, $date2, $differenceFormat = '%a')
function date_difference($date1, $date2, $differenceFormat = '%a')
{ {
$datetime1 = date_create($date1); $datetime1 = date_create($date1);
$datetime2 = date_create($date2); $datetime2 = date_create($date2);
@ -233,10 +211,10 @@ function dateDifference($date1, $date2, $differenceFormat = '%a')
* @param array $attributes * @param array $attributes
* @return \Illuminate\Support\HtmlString * @return \Illuminate\Support\HtmlString
*/ */
function appLogoImage($attributes = [])
function app_logo_image($attributes = [])
{ {
return Html::image( return Html::image(
appLogoPath(),
app_logo_path(),
'Logo '.Option::get('agency_name', 'Laravel'), 'Logo '.Option::get('agency_name', 'Laravel'),
$attributes $attributes
); );
@ -247,7 +225,7 @@ function appLogoImage($attributes = [])
* *
* @return string * @return string
*/ */
function appLogoPath()
function app_logo_path()
{ {
$defaultLogoImagePath = 'default-logo.png'; $defaultLogoImagePath = 'default-logo.png';
$optionLogoImagePath = Option::get('agency_logo_path'); $optionLogoImagePath = Option::get('agency_logo_path');
@ -266,7 +244,7 @@ function appLogoPath()
* @param string $month * @param string $month
* @return array * @return array
*/ */
function monthDateArray($year, $month)
function month_date_array($year, $month)
{ {
$dateCount = Carbon::parse($year.'-'.$month)->format('t'); $dateCount = Carbon::parse($year.'-'.$month)->format('t');
$dates = []; $dates = [];

18
composer.json

@ -5,11 +5,11 @@
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"require": { "require": {
"php": ">=7.0.0",
"php": "^7.1.3",
"backup-manager/laravel": "^1.2", "backup-manager/laravel": "^1.2",
"guzzlehttp/guzzle": "^6.3",
"laracasts/presenter": "^0.2.1", "laracasts/presenter": "^0.2.1",
"laravel/framework": "5.5.*",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.7.*",
"luthfi/formfield": "^1.0", "luthfi/formfield": "^1.0",
"riskihajar/terbilang": "^1.2", "riskihajar/terbilang": "^1.2",
"spatie/laravel-fractal": "^5.0" "spatie/laravel-fractal": "^5.0"
@ -17,11 +17,11 @@
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.1", "barryvdh/laravel-debugbar": "^3.1",
"fzaninotto/faker": "~1.4",
"johnkary/phpunit-speedtrap": "^2.0",
"fzaninotto/faker": "^1.4",
"johnkary/phpunit-speedtrap": "^3.0",
"luthfi/simple-crud-generator": "^1.2", "luthfi/simple-crud-generator": "^1.2",
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0"
"mockery/mockery": "^1.0",
"phpunit/phpunit": "^7.0"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [
@ -59,5 +59,7 @@
"preferred-install": "dist", "preferred-install": "dist",
"sort-packages": true, "sort-packages": true,
"optimize-autoloader": true "optimize-autoloader": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
} }

1807
composer.lock
File diff suppressed because it is too large
View File

52
config/hashing.php

@ -0,0 +1,52 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

92
config/logging.php

@ -0,0 +1,92 @@
<?php
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['daily'],
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 30,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
],
];

21
database/factories/IssueFactory.php

@ -0,0 +1,21 @@
<?php
use App\Entities\Users\User;
use Faker\Generator as Faker;
use App\Entities\Projects\Issue;
use App\Entities\Projects\Project;
$factory->define(Issue::class, function (Faker $faker) {
return [
'project_id' => function () {
return factory(Project::class)->create()->id;
},
'title' => $faker->words(3, true),
'body' => $faker->sentences(3, true),
'creator_id' => function () {
return factory(User::class)->create()->id;
},
'status_id' => 0,
'priority_id' => 1,
];
});

38
database/migrations/2019_03_03_210017_create_issues_table.php

@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateIssuesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('issues', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('project_id');
$table->string('title', 60);
$table->string('body');
$table->unsignedInteger('creator_id');
$table->unsignedTinyInteger('priority_id');
$table->unsignedInteger('pic_id')->nullable();
$table->unsignedTinyInteger('status_id')->default(0);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('issues');
}
}

1
phpunit.xml

@ -26,6 +26,7 @@
<env name="DB_CONNECTION" value="sqlite"/> <env name="DB_CONNECTION" value="sqlite"/>
<env name="DB_DATABASE" value=":memory:"/> <env name="DB_DATABASE" value=":memory:"/>
<env name="MAIL_DRIVER" value="log"/> <env name="MAIL_DRIVER" value="log"/>
<env name="FILESYSTEM_DRIVER" value="test_storage"/>
</php> </php>
<listeners> <listeners>
<listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener"> <listener class="JohnKary\PHPUnit\Listener\SpeedTrapListener">

1
resources/lang/de/app.php

@ -17,6 +17,7 @@ return [
'total' => 'gesamt', 'total' => 'gesamt',
'count' => 'Summe', 'count' => 'Summe',
'remark' => 'Remark', 'remark' => 'Remark',
'last_update' => 'Last Update',
// Action // Action
'add' => 'Hinzufügen', 'add' => 'Hinzufügen',

3
resources/lang/de/customer.php

@ -4,12 +4,13 @@ return [
// Labels // Labels
'customer' => 'Kunde', 'customer' => 'Kunde',
'list' => 'Kundenliste', 'list' => 'Kundenliste',
'detail' => 'Kundendetails',
'search' => 'Kundensuche', 'search' => 'Kundensuche',
'select' => 'Select Customer',
'not_found' => 'Kunde nicht gefunden.', 'not_found' => 'Kunde nicht gefunden.',
'empty' => 'Kunde ist leer.', 'empty' => 'Kunde ist leer.',
'back_to_show' => 'Zurück zu Kundendetails', 'back_to_show' => 'Zurück zu Kundendetails',
'back_to_index' => 'Zurück zur Kundennliste', 'back_to_index' => 'Zurück zur Kundennliste',
'detail' => 'Kundendetails',
'contact' => 'Kundenkontakt', 'contact' => 'Kundenkontakt',
// Actions // Actions

57
resources/lang/de/issue.php

@ -0,0 +1,57 @@
<?php
return [
// Labels
'issue' => 'Issue',
'list' => 'Issue List',
'search' => 'Search Issue',
'search_text' => 'Title ...',
'all' => 'All Issue',
'select' => 'Select Issue',
'detail' => 'Issue Detail',
'not_found' => 'Issue not found.',
'empty' => 'Issue is empty.',
'back_to_show' => 'Back to Issue Detail',
'back_to_index' => 'Back to Issue List',
'no_pic' => 'No issue PIC',
// Actions
'create' => 'Create new Issue',
'created' => 'A new Issue has been created.',
'show' => 'View Issue Detail',
'edit' => 'Edit Issue',
'update' => 'Update Issue',
'updated' => 'Issue data has been updated.',
'delete' => 'Delete Issue',
'delete_confirm' => 'Are you sure to delete this Issue?',
'deleted' => 'Issue has been deleted.',
'undeleted' => 'Issue not deleted.',
'undeleteable' => 'Issue data cannot be deleted.',
'assign_pic' => 'Assign PIC',
'select_pic' => 'Select a PIC',
'pic_assigned' => 'Issue PIC has been assigned.',
'pic_removed' => 'Issue PIC has been removed.',
// Attributes
'title' => 'Issue Title',
'body' => 'Issue Description',
// Relations
'project' => 'Issue Project',
'pic' => 'Issue PIC',
'creator' => 'Issue Creator',
// Priority
'minor' => 'Minor',
'major' => 'Major',
'critical' => 'Critical',
'all_priority' => 'All Priority',
// Statuses
'open' => 'Open',
'resolved' => 'Resolved',
'closed' => 'Closed',
'on_hold' => 'On Hold',
'invalid' => 'Invalid',
'all_status' => 'All Status',
];

1
resources/lang/de/project.php

@ -71,6 +71,7 @@ return [
'subscriptions' => 'Abonnements', 'subscriptions' => 'Abonnements',
'status' => 'Projektstatus', 'status' => 'Projektstatus',
'payments' => 'Zahlungen', 'payments' => 'Zahlungen',
'issues' => 'Issues',
// Statuses // Statuses
'planned' => 'geplant', 'planned' => 'geplant',

4
resources/lang/de/report.php

@ -26,4 +26,8 @@ return [
'this_year' => 'This Year', 'this_year' => 'This Year',
'view_yearly' => 'View Yearly', 'view_yearly' => 'View Yearly',
'view_yearly_label' => 'View Report per', 'view_yearly_label' => 'View Report per',
// Year to year
'year_to_year' => 'Year to Year Report',
'view_year_to_year' => 'View Year to Year Report',
]; ];

1
resources/lang/de/vendor.php

@ -6,6 +6,7 @@ return [
'list' => 'Hersteller Liste', 'list' => 'Hersteller Liste',
'detail' => 'Vendor Detail', 'detail' => 'Vendor Detail',
'search' => 'Hersteller suchen', 'search' => 'Hersteller suchen',
'select' => 'Select Vendor',
'not_found' => 'Hersteller nicht gefunden.', 'not_found' => 'Hersteller nicht gefunden.',
'empty' => 'Hersteller Liste ist leer.', 'empty' => 'Hersteller Liste ist leer.',
'back_to_show' => 'Zurück zu Herstellerdetails', 'back_to_show' => 'Zurück zu Herstellerdetails',

1
resources/lang/en/app.php

@ -17,6 +17,7 @@ return [
'total' => 'Total', 'total' => 'Total',
'count' => 'Count', 'count' => 'Count',
'remark' => 'Remark', 'remark' => 'Remark',
'last_update' => 'Last Update',
// Action // Action
'add' => 'Add', 'add' => 'Add',

3
resources/lang/en/customer.php

@ -4,12 +4,13 @@ return [
// Labels // Labels
'customer' => 'Customer', 'customer' => 'Customer',
'list' => 'Customer List', 'list' => 'Customer List',
'detail' => 'Customer Detail',
'search' => 'Search Customer', 'search' => 'Search Customer',
'select' => 'Select Customer',
'not_found' => 'Customer not found.', 'not_found' => 'Customer not found.',
'empty' => 'Customer is empty.', 'empty' => 'Customer is empty.',
'back_to_show' => 'Back to Customer Detail', 'back_to_show' => 'Back to Customer Detail',
'back_to_index' => 'Back to Customer List', 'back_to_index' => 'Back to Customer List',
'detail' => 'Customer Detail',
'contact' => 'Customer Contact', 'contact' => 'Customer Contact',
// Actions // Actions

58
resources/lang/en/issue.php

@ -0,0 +1,58 @@
<?php
return [
// Labels
'issue' => 'Issue',
'list' => 'Issue List',
'search' => 'Search Issue',
'search_text' => 'Title ...',
'all' => 'All Issue',
'select' => 'Select Issue',
'detail' => 'Issue Detail',
'not_found' => 'Issue not found.',
'empty' => 'Issue is empty.',
'back_to_show' => 'Back to Issue Detail',
'back_to_index' => 'Back to Issue List',
'no_pic' => 'No issue PIC',
// Actions
'create' => 'Create new Issue',
'created' => 'A new Issue has been created.',
'show' => 'View Issue Detail',
'edit' => 'Edit Issue',
'update' => 'Update Issue',
'updated' => 'Issue data has been updated.',
'delete' => 'Delete Issue',
'delete_confirm' => 'Are you sure to delete this Issue?',
'deleted' => 'Issue has been deleted.',
'undeleted' => 'Issue not deleted.',
'undeleteable' => 'Issue data cannot be deleted.',
'assign_pic' => 'Assign PIC',
'select_pic' => 'Select a PIC',
'pic_assigned' => 'Issue PIC has been assigned.',
'pic_removed' => 'Issue PIC has been removed.',
// Attributes
'title' => 'Issue Title',
'body' => 'Issue Description',
// Relations
'project' => 'Issue Project',
'pic' => 'Issue PIC',
'creator' => 'Issue Creator',
// Priority
'priority' => 'Priority',
'minor' => 'Minor',
'major' => 'Major',
'critical' => 'Critical',
'all_priority' => 'All Priority',
// Statuses
'open' => 'Open',
'resolved' => 'Resolved',
'closed' => 'Closed',
'on_hold' => 'On Hold',
'invalid' => 'Invalid',
'all_status' => 'All Status',
];

1
resources/lang/en/project.php

@ -71,6 +71,7 @@ return [
'subscriptions' => 'Subscriptions', 'subscriptions' => 'Subscriptions',
'status' => 'Project Status', 'status' => 'Project Status',
'payments' => 'Payments', 'payments' => 'Payments',
'issues' => 'Issues',
// Statuses // Statuses
'planned' => 'Planned', 'planned' => 'Planned',

4
resources/lang/en/report.php

@ -26,4 +26,8 @@ return [
'this_year' => 'This Year', 'this_year' => 'This Year',
'view_yearly' => 'View Yearly', 'view_yearly' => 'View Yearly',
'view_yearly_label' => 'View Report per', 'view_yearly_label' => 'View Report per',
// Year to year
'year_to_year' => 'Year to Year Report',
'view_year_to_year' => 'View Year to Year Report',
]; ];

1
resources/lang/en/vendor.php

@ -6,6 +6,7 @@ return [
'list' => 'Vendor List', 'list' => 'Vendor List',
'detail' => 'Vendor Detail', 'detail' => 'Vendor Detail',
'search' => 'Search Vendor', 'search' => 'Search Vendor',
'select' => 'Select Vendor',
'not_found' => 'Vendor not found.', 'not_found' => 'Vendor not found.',
'empty' => 'Vendor list is empty.', 'empty' => 'Vendor list is empty.',
'back_to_show' => 'Back to Vendor Detail', 'back_to_show' => 'Back to Vendor Detail',

1
resources/lang/id/app.php

@ -17,6 +17,7 @@ return [
'total' => 'Total', 'total' => 'Total',
'count' => 'Jumlah', 'count' => 'Jumlah',
'remark' => 'Keterangan', 'remark' => 'Keterangan',
'last_update' => 'Update',
// Action // Action
'add' => 'Tambah', 'add' => 'Tambah',

2
resources/lang/id/comment.php

@ -12,7 +12,7 @@ return [
'created' => 'Input Komentar berhasil.', 'created' => 'Input Komentar berhasil.',
'edit' => 'Edit Komentar', 'edit' => 'Edit Komentar',
'update' => 'Update Komentar', 'update' => 'Update Komentar',
'updated' => 'Update data Komentar telah berhasil.',
'updated' => 'Update Komentar berhasil.',
'delete' => 'Hapus Komentar', 'delete' => 'Hapus Komentar',
'delete_confirm' => 'Anda yakin akan menghapus Komentar ini?', 'delete_confirm' => 'Anda yakin akan menghapus Komentar ini?',
'deleted' => 'Komentar berhasil dihapus.', 'deleted' => 'Komentar berhasil dihapus.',

3
resources/lang/id/customer.php

@ -4,12 +4,13 @@ return [
// Labels // Labels
'customer' => 'Customer', 'customer' => 'Customer',
'list' => 'Daftar Customer', 'list' => 'Daftar Customer',
'detail' => 'Detail Customer',
'search' => 'Cari Customer', 'search' => 'Cari Customer',
'select' => 'Pilih Customer',
'not_found' => 'Customer tidak ditemukan', 'not_found' => 'Customer tidak ditemukan',
'empty' => 'Belum ada Customer', 'empty' => 'Belum ada Customer',
'back_to_show' => 'Kembali ke detail Customer', 'back_to_show' => 'Kembali ke detail Customer',
'back_to_index' => 'Kembali ke daftar Customer', 'back_to_index' => 'Kembali ke daftar Customer',
'detail' => 'Detail Customer',
'contact' => 'Kontak Customer', 'contact' => 'Kontak Customer',
// Actions // Actions

57
resources/lang/id/issue.php

@ -0,0 +1,57 @@
<?php
return [
// Labels
'issue' => 'Issue',
'list' => 'Daftar Issue',
'search' => 'Cari Issue',
'search_text' => 'Nama ...',
'all' => 'Semua Issue',
'select' => 'Pilih Issue',
'detail' => 'Detail Issue',
'not_found' => 'Issue tidak ditemukan.',
'empty' => 'Belum ada Issue',
'back_to_show' => 'Kembali ke detail Issue',
'back_to_index' => 'Kembali ke daftar Issue',
'no_pic' => 'Belum ada PIC',
// Actions
'create' => 'Input Issue Baru',
'created' => 'Input Issue baru telah berhasil.',
'show' => 'Lihat Detail Issue',
'edit' => 'Edit Issue',
'update' => 'Update Issue',
'updated' => 'Update data Issue telah berhasil.',
'delete' => 'Hapus Issue',
'delete_confirm' => 'Anda yakin akan menghapus Issue ini?',
'deleted' => 'Hapus data Issue telah berhasil.',
'undeleted' => 'Data Issue gagal dihapus.',
'undeleteable' => 'Data Issue tidak dapat dihapus.',
'assign_pic' => 'Tugaskan PIC',
'select_pic' => 'Pilih PIC',
'pic_assigned' => 'PIC telah ditugaskan.',
'pic_removed' => 'PIC telah dihapus.',
// Attributes
'title' => 'Judul Issue',
'body' => 'Deskripsi Issue',
// Relations
'project' => 'Project Issue',
'pic' => 'PIC Issue',
'creator' => 'Pembuat Issue',
// Priority
'minor' => 'Minor',
'major' => 'Major',
'critical' => 'Critical',
'all_priority' => 'Semua Priority',
// Statuses
'open' => 'Open',
'resolved' => 'Selesai',
'closed' => 'Ditutup',
'on_hold' => 'Ditunda',
'invalid' => 'Tidak Valid',
'all_status' => 'Semua Status',
];

1
resources/lang/id/project.php

@ -71,6 +71,7 @@ return [
'subscriptions' => 'Langganan', 'subscriptions' => 'Langganan',
'status' => 'Status Project', 'status' => 'Status Project',
'payments' => 'Pembayaran', 'payments' => 'Pembayaran',
'issues' => 'Issue',
// Statuses // Statuses
'planned' => 'Rencana', 'planned' => 'Rencana',

4
resources/lang/id/report.php

@ -26,4 +26,8 @@ return [
'this_year' => 'Tahun Ini', 'this_year' => 'Tahun Ini',
'view_yearly' => 'Lihat Tahunan', 'view_yearly' => 'Lihat Tahunan',
'view_yearly_label' => 'Lihat Tahunan per', 'view_yearly_label' => 'Lihat Tahunan per',
// Year to year
'year_to_year' => 'Laponan Tahun ke Tahun',
'view_year_to_year' => 'Lihat Laporan Tahun ke Tahun',
]; ];

1
resources/lang/id/vendor.php

@ -6,6 +6,7 @@ return [
'list' => 'Daftar Vendor', 'list' => 'Daftar Vendor',
'detail' => 'Detail Vendor', 'detail' => 'Detail Vendor',
'search' => 'Cari Vendor', 'search' => 'Cari Vendor',
'select' => 'Pilih Vendor',
'not_found' => 'Vendor tidak ditemukan', 'not_found' => 'Vendor tidak ditemukan',
'empty' => 'Belum ada Vendor', 'empty' => 'Belum ada Vendor',
'back_to_show' => 'Kembali ke detail Vendor', 'back_to_show' => 'Kembali ke detail Vendor',

2
resources/views/auth/app-install.blade.php

@ -11,7 +11,7 @@
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="text-center"> <div class="text-center">
{!! appLogoImage(['style' => 'width:150px']) !!}
{!! app_logo_image(['style' => 'width:150px']) !!}
<h3>{{ config('app.name') }}</h3> <h3>{{ config('app.name') }}</h3>
</div> </div>
</div> </div>

2
resources/views/auth/login.blade.php

@ -5,7 +5,7 @@
@section('content') @section('content')
<div class="login-panel col-md-4 col-md-offset-4 text-center"> <div class="login-panel col-md-4 col-md-offset-4 text-center">
{!! appLogoImage() !!}
{!! app_logo_image() !!}
<h3>{{ config('app.name') }}</h3> <h3>{{ config('app.name') }}</h3>
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-body"> <div class="panel-body">

4
resources/views/backups/index.blade.php

@ -24,13 +24,13 @@
<tr> <tr>
<td>{{ $key + 1 }}</td> <td>{{ $key + 1 }}</td>
<td>{{ $backup->getFilename() }}</td> <td>{{ $backup->getFilename() }}</td>
<td>{{ formatSizeUnits($backup->getSize()) }}</td>
<td>{{ format_size_units($backup->getSize()) }}</td>
<td>{{ date('Y-m-d H:i:s', $backup->getMTime()) }}</td> <td>{{ date('Y-m-d H:i:s', $backup->getMTime()) }}</td>
<td class="text-center"> <td class="text-center">
<a href="{{ route('backups.index', ['action' => 'restore', 'file_name' => $backup->getFilename()]) }}" <a href="{{ route('backups.index', ['action' => 'restore', 'file_name' => $backup->getFilename()]) }}"
id="restore_{{ str_replace('.gz', '', $backup->getFilename()) }}" id="restore_{{ str_replace('.gz', '', $backup->getFilename()) }}"
class="btn btn-warning btn-xs" class="btn btn-warning btn-xs"
title="{{ __('backup.download') }}"><i class="fa fa-rotate-left"></i></a>
title="{{ __('backup.restore') }}"><i class="fa fa-rotate-left"></i></a>
<a href="{{ route('backups.download', [$backup->getFilename()]) }}" <a href="{{ route('backups.download', [$backup->getFilename()]) }}"
id="download_{{ str_replace('.gz', '', $backup->getFilename()) }}" id="download_{{ str_replace('.gz', '', $backup->getFilename()) }}"
class="btn btn-info btn-xs" class="btn btn-info btn-xs"

4
resources/views/customers/invoices.blade.php

@ -22,7 +22,7 @@
<td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td> <td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td>
<td>{{ $invoice->project->nameLink() }}</td> <td>{{ $invoice->project->nameLink() }}</td>
<td>{{ $invoice->project->customer->nameLink() }}</td> <td>{{ $invoice->project->customer->nameLink() }}</td>
<td class="text-right">{{ formatRp($invoice->amount) }}</td>
<td class="text-right">{{ format_money($invoice->amount) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route( {!! html_link_to_route(
'invoices.show', '', [$invoice->number], 'invoices.show', '', [$invoice->number],
@ -49,7 +49,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="5" class="text-right">{{ trans('app.total') }}</th> <th colspan="5" class="text-right">{{ trans('app.total') }}</th>
<th class="text-right">{{ formatRp($invoices->sum('amount')) }}</th>
<th class="text-right">{{ format_money($invoices->sum('amount')) }}</th>
<th></th> <th></th>
</tr> </tr>
</tfoot> </tfoot>

2
resources/views/customers/payments.blade.php

@ -42,7 +42,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="4" class="text-right">{{ __('app.total') }}</th> <th colspan="4" class="text-right">{{ __('app.total') }}</th>
<th class="text-right">{{ formatRp($payments->sum('amount')) }}</th>
<th class="text-right">{{ format_money($payments->sum('amount')) }}</th>
<th colspan="2">&nbsp;</th> <th colspan="2">&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

2
resources/views/customers/projects.blade.php

@ -21,7 +21,7 @@
<td>{{ $project->nameLink() }}</td> <td>{{ $project->nameLink() }}</td>
<td class="text-center">{{ $project->start_date }}</td> <td class="text-center">{{ $project->start_date }}</td>
<td class="text-right">{{ $project->work_duration }}</td> <td class="text-right">{{ $project->work_duration }}</td>
<td class="text-right">{{ formatRp($project->project_value) }}</td>
<td class="text-right">{{ format_money($project->project_value) }}</td>
<td class="text-center">{{ $project->present()->status }}</td> <td class="text-center">{{ $project->present()->status }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route('projects.show', '', [$project->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => trans('app.show')]) !!} {!! html_link_to_route('projects.show', '', [$project->id], ['icon' => 'search', 'class' => 'btn btn-info btn-xs', 'title' => trans('app.show')]) !!}

6
resources/views/customers/subscriptions.blade.php

@ -20,13 +20,13 @@
@forelse($subscriptions as $key => $subscription) @forelse($subscriptions as $key => $subscription)
<tr> <tr>
<td>{{ 1 + $key }}</td> <td>{{ 1 + $key }}</td>
<td>{{ $subscription->nameLink() }}</td>
<td>{{ $subscription->name_link }}</td>
<td class="text-center">{!! $subscription->type_label !!}</td> <td class="text-center">{!! $subscription->type_label !!}</td>
<td>{{ $subscription->customer->name }}</td> <td>{{ $subscription->customer->name }}</td>
<td class="text-right" title="{!! $subscription->dueDateDescription() !!}"> <td class="text-right" title="{!! $subscription->dueDateDescription() !!}">
{{ dateId($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}
{{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}
</td> </td>
<td class="text-right">{{ formatRp($subscription->price) }}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td>{{ $subscription->vendor->name }}</td> <td>{{ $subscription->vendor->name }}</td>
<td class="text-center">{{ $subscription->status() }}</td> <td class="text-center">{{ $subscription->status() }}</td>
</tr> </tr>

6
resources/views/invoice-drafts/partials/draft-confirm.blade.php

@ -18,7 +18,7 @@
<tr><td>{{ trans('invoice.due_date') }}</td><td>{{ $draft->dueDate }}</td></tr> <tr><td>{{ trans('invoice.due_date') }}</td><td>{{ $draft->dueDate }}</td></tr>
<tr> <tr>
<td>{{ trans('invoice.total') }}</td> <td>{{ trans('invoice.total') }}</td>
<th class="text-right lead">{{ formatRp($draft->getTotal()) }}</th>
<th class="text-right lead">{{ format_money($draft->getTotal()) }}</th>
</tr> </tr>
<tr><td>{{ trans('invoice.notes') }}</td><td>{{ $draft->notes }}</td></tr> <tr><td>{{ trans('invoice.notes') }}</td><td>{{ $draft->notes }}</td></tr>
</tbody> </tbody>
@ -48,7 +48,7 @@
<tr> <tr>
<td width="5%">{{ $key + 1 }}</td> <td width="5%">{{ $key + 1 }}</td>
<td width="70%">{!! nl2br($item->description) !!}</td> <td width="70%">{!! nl2br($item->description) !!}</td>
<td width="25%" class="text-right">{{ formatRp($item->amount) }}</td>
<td width="25%" class="text-right">{{ format_money($item->amount) }}</td>
</tr> </tr>
@empty @empty
@endforelse @endforelse
@ -56,7 +56,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('invoice.total') }} :</th> <th colspan="2" class="text-right">{{ trans('invoice.total') }} :</th>
<th class="text-right">{{ formatRp($draft->getTotal()) }}</th>
<th class="text-right">{{ format_money($draft->getTotal()) }}</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

2
resources/views/invoice-drafts/partials/draft-item-list.blade.php

@ -51,7 +51,7 @@
@endforeach @endforeach
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('invoice.amount') }} :</th> <th colspan="2" class="text-right">{{ trans('invoice.amount') }} :</th>
<th class="text-right">{{ formatRp($draft->getTotal()) }}</th>
<th class="text-right">{{ format_money($draft->getTotal()) }}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
<tr> <tr>

4
resources/views/invoices/index.blade.php

@ -34,7 +34,7 @@
<td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td> <td class="text-center">{{ $invoice->created_at->format('Y-m-d') }}</td>
<td>{{ $invoice->project->nameLink() }}</td> <td>{{ $invoice->project->nameLink() }}</td>
<td>{{ $invoice->project->customer->nameLink() }}</td> <td>{{ $invoice->project->customer->nameLink() }}</td>
<td class="text-right">{{ formatRp($invoice->amount) }}</td>
<td class="text-right">{{ format_money($invoice->amount) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route( {!! html_link_to_route(
'invoices.show', '', [$invoice->number], 'invoices.show', '', [$invoice->number],
@ -61,7 +61,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="5" class="text-right">{{ trans('app.total') }}</th> <th colspan="5" class="text-right">{{ trans('app.total') }}</th>
<th class="text-right">{{ formatRp($invoices->sum('amount')) }}</th>
<th class="text-right">{{ format_money($invoices->sum('amount')) }}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

2
resources/views/invoices/partials/detail.blade.php

@ -7,6 +7,6 @@
<tr><th>{{ trans('invoice.customer') }}</th><td>{{ $invoice->project->customer->nameLink() }}</td></tr> <tr><th>{{ trans('invoice.customer') }}</th><td>{{ $invoice->project->customer->nameLink() }}</td></tr>
<tr><th>{{ trans('invoice.items_count') }}</th><td>{{ $invoice->items_count }}</td></tr> <tr><th>{{ trans('invoice.items_count') }}</th><td>{{ $invoice->items_count }}</td></tr>
<tr><th>{{ trans('invoice.creator') }}</th><td>{{ $invoice->creator->name }}</td></tr> <tr><th>{{ trans('invoice.creator') }}</th><td>{{ $invoice->creator->name }}</td></tr>
<tr><th>{{ trans('invoice.amount') }}</th><td class="text-right lead">{{ formatRp($invoice->amount) }}</td></tr>
<tr><th>{{ trans('invoice.amount') }}</th><td class="text-right lead">{{ format_money($invoice->amount) }}</td></tr>
</tbody> </tbody>
</table> </table>

2
resources/views/invoices/partials/item-list.blade.php

@ -77,7 +77,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('invoice.amount') }} :</th> <th colspan="2" class="text-right">{{ trans('invoice.amount') }} :</th>
<th class="text-right">{{ formatRp(collect($invoice->items)->sum('amount')) }}</th>
<th class="text-right">{{ format_money(collect($invoice->items)->sum('amount')) }}</th>
<th></th> <th></th>
</tr> </tr>
</tfoot> </tfoot>

16
resources/views/invoices/pdf.blade.php

@ -39,7 +39,7 @@
<tbody> <tbody>
<tr> <tr>
<td style="width:100px;"> <td style="width:100px;">
{!! appLogoImage(['style' => 'width:100%']) !!}
{!! app_logo_image(['style' => 'width:100%']) !!}
</td> </td>
<td style="width:380px"> <td style="width:380px">
<div style="width:300px"> <div style="width:300px">
@ -61,7 +61,7 @@
<td style="width:270px; text-align: center;"> <td style="width:270px; text-align: center;">
<h3 style="margin: 3px 0; font-size: 24px">{{ __('invoice.invoice') }}</h3> <h3 style="margin: 3px 0; font-size: 24px">{{ __('invoice.invoice') }}</h3>
<div style="margin: 5px">{{ __('invoice.number') }} : INV-{{ $invoice->number }}</div> <div style="margin: 5px">{{ __('invoice.number') }} : INV-{{ $invoice->number }}</div>
<div>{{ __('app.date') }} : {{ dateId($invoice->date) }}</div>
<div>{{ __('app.date') }} : {{ date_id($invoice->date) }}</div>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -87,7 +87,7 @@
<td class="text-center text-top"> <td class="text-center text-top">
@if ($invoice->due_date) @if ($invoice->due_date)
<h4 style="margin: 30px 3px 0;">{{ __('invoice.due_date') }}</h4> <h4 style="margin: 30px 3px 0;">{{ __('invoice.due_date') }}</h4>
<p>{{ dateId($invoice->due_date) }}</p>
<p>{{ date_id($invoice->due_date) }}</p>
@endif @endif
@if ($taxId = Option::get('agency_tax_id')) @if ($taxId = Option::get('agency_tax_id'))
<h4 style="margin: 30px 3px 0;">{{ __('agency.tax_id') }}</h4> <h4 style="margin: 30px 3px 0;">{{ __('agency.tax_id') }}</h4>
@ -114,7 +114,7 @@
<tr> <tr>
<td class="text-center text-top">{{ 1 + $key }}</td> <td class="text-center text-top">{{ 1 + $key }}</td>
<td>{!! nl2br($item['description']) !!}</td> <td>{!! nl2br($item['description']) !!}</td>
<td class="text-right text-top">{{ formatRp($item['amount']) }}</td>
<td class="text-right text-top">{{ format_money($item['amount']) }}</td>
</tr> </tr>
@php @php
$subtotal += $item['amount']; $subtotal += $item['amount'];
@ -123,19 +123,19 @@
@if ($invoice->discount) @if ($invoice->discount)
<tr> <tr>
<th colspan="2" class="text-right">{{ __('invoice.subtotal') }} :</th> <th colspan="2" class="text-right">{{ __('invoice.subtotal') }} :</th>
<th class="text-right">{{ formatRp($subtotal) }}</th>
<th class="text-right">{{ format_money($subtotal) }}</th>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="text-right"> <td colspan="2" class="text-right">
<strong>{{ __('invoice.discount') }}</strong> <strong>{{ __('invoice.discount') }}</strong>
{{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} : {{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} :
</td> </td>
<th class="text-right">- {{ formatRp($invoice->discount) }}</th>
<th class="text-right">- {{ format_money($invoice->discount) }}</th>
</tr> </tr>
@endif @endif
<tr> <tr>
<th colspan="2" class="text-right">{{ __('app.total') }}</th> <th colspan="2" class="text-right">{{ __('app.total') }}</th>
<th colspan="2" class="text-right">{{ formatRp($invoice->amount) }}</th>
<th colspan="2" class="text-right">{{ format_money($invoice->amount) }}</th>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -176,7 +176,7 @@
<tr> <tr>
<td colspan="3" class="text-center"> <td colspan="3" class="text-center">
{{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }} {{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }}
{{ dateId($invoice->date) }} <br><br><br><br>
{{ date_id($invoice->date) }} <br><br><br><br>
<div style="font-weight: bold;">{{ Option::get('agency_name') }}</div> <div style="font-weight: bold;">{{ Option::get('agency_name') }}</div>
</td> </td>
</tr> </tr>

8
resources/views/invoices/show.blade.php

@ -39,7 +39,7 @@
<tr> <tr>
<td>{{ $key + 1 }}</td> <td>{{ $key + 1 }}</td>
<td>{!! nl2br($item['description']) !!}</td> <td>{!! nl2br($item['description']) !!}</td>
<td class="text-right">{{ formatRp($item['amount']) }}</td>
<td class="text-right">{{ format_money($item['amount']) }}</td>
</tr> </tr>
@php @php
$subtotal += $item['amount']; $subtotal += $item['amount'];
@ -50,19 +50,19 @@
@if ($invoice->discount) @if ($invoice->discount)
<tr> <tr>
<th colspan="2" class="text-right">{{ __('invoice.subtotal') }} :</th> <th colspan="2" class="text-right">{{ __('invoice.subtotal') }} :</th>
<th class="text-right">{{ formatRp($subtotal) }}</th>
<th class="text-right">{{ format_money($subtotal) }}</th>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="text-right"> <td colspan="2" class="text-right">
<strong>{{ __('invoice.discount') }}</strong> <strong>{{ __('invoice.discount') }}</strong>
{{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} : {{ $invoice->discount_notes ? '('.$invoice->discount_notes.')': '' }} :
</td> </td>
<th class="text-right">- {{ formatRp($invoice->discount) }}</th>
<th class="text-right">- {{ format_money($invoice->discount) }}</th>
</tr> </tr>
@endif @endif
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('app.total') }} :</th> <th colspan="2" class="text-right">{{ trans('app.total') }} :</th>
<th class="text-right">{{ formatRp($invoice->amount) }}</th>
<th class="text-right">{{ format_money($invoice->amount) }}</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

4
resources/views/jobs/partials/job-show.blade.php

@ -5,9 +5,9 @@
<tr><th class="col-md-4">{{ __('job.name') }}</th><td class="col-md-8">{{ $job->name }}</td></tr> <tr><th class="col-md-4">{{ __('job.name') }}</th><td class="col-md-8">{{ $job->name }}</td></tr>
<tr><th>{{ __('job.type') }}</th><td>{{ $job->type() }}</td></tr> <tr><th>{{ __('job.type') }}</th><td>{{ $job->type() }}</td></tr>
@can('see-pricings', $job) @can('see-pricings', $job)
<tr><th>{{ __('job.price') }}</th><td>{{ formatRp($job->price) }}</td></tr>
<tr><th>{{ __('job.price') }}</th><td>{{ format_money($job->price) }}</td></tr>
@endcan @endcan
<tr><th>{{ __('job.progress') }}</th><td>{{ formatDecimal($job->progress) }}%</td></tr>
<tr><th>{{ __('job.progress') }}</th><td>{{ format_decimal($job->progress) }}%</td></tr>
<tr><th>{{ __('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr> <tr><th>{{ __('job.worker') }}</th><td>{{ $job->worker->name }}</td></tr>
<tr><th>{{ __('time.updated_at') }}</th><td>{{ $job->updated_at }}</td></tr> <tr><th>{{ __('time.updated_at') }}</th><td>{{ $job->updated_at }}</td></tr>
<tr><th>{{ __('job.description') }}</th><td>{!! nl2br($job->description) !!}</td></tr> <tr><th>{{ __('job.description') }}</th><td>{!! nl2br($job->description) !!}</td></tr>

2
resources/views/jobs/partials/job-tasks.blade.php

@ -66,7 +66,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="2">{{ __('app.total') }}</th> <th class="text-right" colspan="2">{{ __('app.total') }}</th>
<th class="text-center">{{ formatDecimal($job->tasks->avg('progress')) }} %</th>
<th class="text-center">{{ format_decimal($job->tasks->avg('progress')) }} %</th>
<th> <th>
@if (request('action') == 'sort_tasks') @if (request('action') == 'sort_tasks')
{{ link_to_route('jobs.show', __('app.done'), [$job], ['class' => 'btn btn-default btn-xs pull-right']) }} {{ link_to_route('jobs.show', __('app.done'), [$job], ['class' => 'btn btn-default btn-xs pull-right']) }}

8
resources/views/jobs/unfinished.blade.php

@ -46,9 +46,9 @@
@endif @endif
</td> </td>
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td> <td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td>
<td class="text-center">{{ formatDecimal($job->progress) }} %</td>
<td class="text-center">{{ format_decimal($job->progress) }} %</td>
@can('see-pricings', $job) @can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
@endcan @endcan
<td>{{ $job->worker->name }}</td> <td>{{ $job->worker->name }}</td>
<td> <td>
@ -63,9 +63,9 @@
<tr> <tr>
<th class="text-right" colspan="3">{{ __('app.total') }}</th> <th class="text-right" colspan="3">{{ __('app.total') }}</th>
<th class="text-center">{{ $jobs->sum('tasks_count') }}</th> <th class="text-center">{{ $jobs->sum('tasks_count') }}</th>
<th class="text-center">{{ formatDecimal($jobs->avg('progress')) }} %</th>
<th class="text-center">{{ format_decimal($jobs->avg('progress')) }} %</th>
@can('see-pricings', new App\Entities\Projects\Job) @can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th>
<th class="text-right">{{ format_money($jobs->sum('price')) }}</th>
@endcan @endcan
<th colspan="2"></th> <th colspan="2"></th>
</tr> </tr>

2
resources/views/layouts/partials/sidebar.blade.php

@ -10,7 +10,7 @@
<div class="navbar-default sidebar hidden-print" role="navigation"> <div class="navbar-default sidebar hidden-print" role="navigation">
<div class="sidebar-nav navbar-collapse"> <div class="sidebar-nav navbar-collapse">
<a class="navbar-brand text-center" title="Home | {{ Option::get('agency_tagline', 'Laravel app description') }}" href="{{ route('home') }}"> <a class="navbar-brand text-center" title="Home | {{ Option::get('agency_tagline', 'Laravel app description') }}" href="{{ route('home') }}">
{{ appLogoImage(['class' => 'sidebar-logo']) }}
{{ app_logo_image(['class' => 'sidebar-logo']) }}
<div class="small" style="margin-top:10px">{{ config('app.name') }}</div> <div class="small" style="margin-top:10px">{{ config('app.name') }}</div>
</a> </a>
@include('layouts.partials.lang-switcher') @include('layouts.partials.lang-switcher')

2
resources/views/options/page-1.blade.php

@ -17,7 +17,7 @@
['class' => 'form-control', 'maxlength' => 3] ['class' => 'form-control', 'maxlength' => 3]
) }} ) }}
<span class="text-info small"> <span class="text-info small">
Money sign like : <strong>{{ formatRp('9900') }}</strong><br>(Max 3 characters)
Money sign like : <strong>{{ format_money('9900') }}</strong><br>(Max 3 characters)
</span> </span>
</td> </td>
</tr> </tr>

8
resources/views/pages/home.blade.php

@ -32,13 +32,13 @@
</tr> </tr>
<tr> <tr>
<td class="text-center text-primary lead" style="border-top: none;"> <td class="text-center text-primary lead" style="border-top: none;">
{{ $totalEarnings = formatRp(AdminDashboard::totalEarnings($queriedYear)) }}
{{ $totalEarnings = format_money(AdminDashboard::totalEarnings($queriedYear)) }}
</td> </td>
<td class="text-center text-primary lead" style="border-top: none;"> <td class="text-center text-primary lead" style="border-top: none;">
{{ $totalFinishedProjects = AdminDashboard::totalFinishedProjects($queriedYear) }} Projects {{ $totalFinishedProjects = AdminDashboard::totalFinishedProjects($queriedYear) }} Projects
</td> </td>
<td class="text-center text-primary lead" style="border-top: none;"> <td class="text-center text-primary lead" style="border-top: none;">
{{ $currentOutstandingCustomerPayment = formatRp(AdminDashboard::currentOutstandingCustomerPayment($queriedYear)) }}
{{ $currentOutstandingCustomerPayment = format_money(AdminDashboard::currentOutstandingCustomerPayment($queriedYear)) }}
</td> </td>
</tr> </tr>
</table> </table>
@ -71,9 +71,9 @@
</tr> </tr>
@forelse(AdminDashboard::upcomingSubscriptionDueDatesList() as $subscription) @forelse(AdminDashboard::upcomingSubscriptionDueDatesList() as $subscription)
<tr> <tr>
<td>{{ $subscription->nameLink() }}</td>
<td>{{ $subscription->name_link }}</td>
<td>{{ $subscription->customer->name }}</td> <td>{{ $subscription->customer->name }}</td>
<td class="text-right">{{ formatRp($subscription->price) }}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td class="text-center"> <td class="text-center">
{{ $subscription->due_date }} {{ $subscription->due_date }}
{!! $subscription->nearOfDueDateSign() !!} {!! $subscription->nearOfDueDateSign() !!}

49
resources/views/payments/edit.blade.php

@ -8,13 +8,13 @@
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
{!! Form::model($payment, ['route'=>['payments.update', $payment->id], 'method' => 'patch']) !!}
{!! Form::model($payment, ['route' => ['payments.update', $payment], 'method' => 'patch']) !!}
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ __('payment.edit') }}</h3></div> <div class="panel-heading"><h3 class="panel-title">{{ __('payment.edit') }}</h3></div>
<div class="panel-body"> <div class="panel-body">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
{!! FormField::radios('in_out', [__('payment.out'), __('payment.in')], ['label'=> __('payment.in_out')]) !!}
{!! FormField::radios('in_out', [__('payment.out'), __('payment.in')], ['label' => __('payment.in_out')]) !!}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{!! FormField::radios('type_id', PaymentType::toArray(), ['label' => __('payment.type'), 'list_style' => 'unstyled']) !!} {!! FormField::radios('type_id', PaymentType::toArray(), ['label' => __('payment.type'), 'list_style' => 'unstyled']) !!}
@ -22,32 +22,33 @@
</div> </div>
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
{!! FormField::text('date', ['label'=> __('app.date')]) !!}
{!! FormField::text('date', ['label' => __('app.date')]) !!}
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
{!! FormField::price('amount', ['label'=> __('payment.amount'), 'currency' => Option::get('money_sign', 'Rp')]) !!}
{!! FormField::price('amount', ['label' => __('payment.amount'), 'currency' => Option::get('money_sign', 'Rp')]) !!}
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
{!! FormField::select('project_id', $projects, ['label'=> __('payment.project')]) !!}
{!! FormField::select('project_id', $projects, ['label' => __('payment.project')]) !!}
</div> </div>
<div class="col-sm-6"> <div class="col-sm-6">
@if ($payment->partner_type == 'App\Entities\Users\User') @if ($payment->partner_type == 'App\Entities\Users\User')
{!! FormField::select('partner_id', $partners, ['label'=> __('payment.customer')]) !!}
{{ Form::hidden('partner_type', 'users') }} {{ Form::hidden('partner_type', 'users') }}
@else
{!! FormField::select('partner_id', $partners, ['label'=> __('payment.customer')]) !!}
@endif @endif
{!! FormField::select('partner_id', $partners, [
'label' => __('payment.customer'),
'placeholder' => $payment->in_out ? __('customer.select') : __('vendor.select')
]) !!}
</div> </div>
</div> </div>
{!! FormField::textarea('description', ['label'=> __('payment.description')]) !!}
{!! FormField::textarea('description', ['label' => __('payment.description')]) !!}
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
{!! Form::submit(__('payment.update'), ['class'=>'btn btn-primary']) !!}
{!! Form::submit(__('payment.update'), ['class' => 'btn btn-primary']) !!}
{!! link_to_route('projects.payments', __('payment.back_to_index'), [$payment->project_id], ['class' => 'btn btn-default']) !!} {!! link_to_route('projects.payments', __('payment.back_to_index'), [$payment->project_id], ['class' => 'btn btn-default']) !!}
{!! link_to_route('payments.delete', __('payment.delete'), [$payment->id], ['class'=>'btn btn-danger pull-right']) !!}
{!! link_to_route('payments.delete', __('payment.delete'), [$payment->id], ['class' => 'btn btn-danger pull-right']) !!}
</div> </div>
</div> </div>
{!! Form::close() !!} {!! Form::close() !!}
@ -72,6 +73,32 @@
closeOnDateSelect: true, closeOnDateSelect: true,
scrollInput: false scrollInput: false
}); });
$('#in_out_0').click(function() {
$.post("{{ route('api.vendors.index') }}", {},
function(data) {
var string = '<option value="">-- {{ __('vendor.select') }} --</option> ';
string = string + `<optgroup label="Vendor">`;
$.each(data, function(index, value) {
string = string + `<option value="` + index + `">` + value + `</option>`;
});
string = string + `</optgroup>`;
$("#partner_id").html(string);
}
);
});
$('#in_out_1').click(function() {
$.post("{{ route('api.customers.index') }}", {},
function(data) {
var string = '<option value="">-- {{ __('customer.select') }} --</option> ';
string = string + `<optgroup label="Customer">`;
$.each(data, function(index, value) {
string = string + `<option value="` + index + `">` + value + `</option>`;
});
string = string + `</optgroup>`;
$("#partner_id").html(string);
}
);
});
})(); })();
</script> </script>
@endsection @endsection

6
resources/views/payments/pdf.blade.php

@ -22,7 +22,7 @@
<table class="receipt-table"> <table class="receipt-table">
<tbody> <tbody>
<tr> <tr>
<td style="width:140px;">{{ appLogoImage(['style' => 'width: 100px;']) }}</td>
<td style="width:140px;">{{ app_logo_image(['style' => 'width: 100px;']) }}</td>
<td style="width:330px"> <td style="width:330px">
<div style="width:280px"> <div style="width:280px">
<h4 style="margin:0px; border-bottom: 3px; font-size: 21.5px">{{ Option::get('agency_name') }}</h4> <h4 style="margin:0px; border-bottom: 3px; font-size: 21.5px">{{ Option::get('agency_name') }}</h4>
@ -63,13 +63,13 @@
<td>&nbsp;</td> <td>&nbsp;</td>
<td>&nbsp;</td> <td>&nbsp;</td>
<td style="text-align: center;"> <td style="text-align: center;">
{{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }} {{ dateId($payment->date) }}
{{ Option::get('agency_city') ? Option::get('agency_city').', ' : '' }} {{ date_id($payment->date) }}
</td> </td>
</tr> </tr>
<tr> <tr>
<td style="font-size: 20px; font-weight: bold; text-align: center;height: 100px;vertical-align: bottom;">@lang('payment.cash_amount')</td> <td style="font-size: 20px; font-weight: bold; text-align: center;height: 100px;vertical-align: bottom;">@lang('payment.cash_amount')</td>
<td style="font-size: 20px; font-weight: bold; vertical-align: bottom;"> <td style="font-size: 20px; font-weight: bold; vertical-align: bottom;">
{{ formatRp($payment->amount) }},-
{{ format_money($payment->amount) }},-
</td> </td>
<td style="text-align: center;vertical-align: bottom;"> <td style="text-align: center;vertical-align: bottom;">
<strong>{{ auth()->user()->name }}</strong> <br> <strong>{{ auth()->user()->name }}</strong> <br>

64
resources/views/projects/files.blade.php

@ -1,12 +1,12 @@
@extends('layouts.app') @extends('layouts.app')
@section('title', trans('project.files') . ' | ' . $project->name)
@section('title', __('project.files').' | '.$project->name)
@section('content') @section('content')
@include('projects.partials.breadcrumb',['title' => trans('project.files')])
@include('projects.partials.breadcrumb',['title' => __('project.files')])
<h1 class="page-header"> <h1 class="page-header">
{{ $project->name }} <small>{{ trans('project.files') }}</small>
{{ $project->name }} <small>{{ __('project.files') }}</small>
</h1> </h1>
@include('projects.partials.nav-tabs') @include('projects.partials.nav-tabs')
@ -14,16 +14,16 @@
<div class="col-md-8"> <div class="col-md-8">
<div class="panel panel-default table-responsive"> <div class="panel panel-default table-responsive">
<div class="panel-heading"> <div class="panel-heading">
<h3 class="panel-title">{{ trans('project.files') }}</h3>
<h3 class="panel-title">{{ __('project.files') }}</h3>
</div> </div>
<table class="table table-condensed table-striped"> <table class="table table-condensed table-striped">
<thead> <thead>
<th>{{ trans('app.table_no') }}</th>
<th>{{ trans('file.file') }}</th>
<th class="text-center">{{ trans('file.updated_at') }}</th>
<th class="text-right">{{ trans('file.size') }}</th>
<th class="text-center">{{ trans('file.download') }}</th>
<th class="text-center">{{ trans('app.action') }}</th>
<th>{{ __('app.table_no') }}</th>
<th>{{ __('file.file') }}</th>
<th class="text-center">{{ __('file.updated_at') }}</th>
<th class="text-right">{{ __('file.size') }}</th>
<th class="text-center">{{ __('file.download') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</thead> </thead>
<tbody class="sort-files"> <tbody class="sort-files">
@forelse($files as $key => $file) @forelse($files as $key => $file)
@ -37,16 +37,17 @@
<div class="">{{ $file->getDate() }}</div> <div class="">{{ $file->getDate() }}</div>
<div class="text-info small">{{ $file->getTime() }}</div> <div class="text-info small">{{ $file->getTime() }}</div>
</td> </td>
<td class="text-right">{{ formatSizeUnits($file->getSize()) }}</td>
<td class="text-right">{{ format_size_units($file->getSize()) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route('files.download', '', [$file->id], ['icon' => 'file', 'title' => trans('file.download')]) !!}
{!! html_link_to_route('files.download', '', [$file->id], ['icon' => 'file', 'title' => __('file.download')]) !!}
</td> </td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route('projects.files', '', [$project->id, 'action' => 'edit', 'id' => $file->id], ['icon' => 'edit', 'title' => trans('file.edit')]) !!}
{!! html_link_to_route('projects.files', '', [$project, 'action' => 'edit', 'id' => $file->id], ['icon' => 'edit', 'title' => __('file.edit')]) !!}
{!! html_link_to_route('projects.files', '', [$project, 'action' => 'delete', 'id' => $file->id], ['icon' => 'remove', 'title' => __('file.delete'), 'id' => 'delete-file-'.$file->id]) !!}
</td> </td>
</tr> </tr>
@empty @empty
<tr><td colspan="6">{{ trans('file.empty') }}</td></tr>
<tr><td colspan="6">{{ __('file.empty') }}</td></tr>
@endforelse @endforelse
</tbody> </tbody>
</table> </table>
@ -55,33 +56,48 @@
<div class="col-md-4"> <div class="col-md-4">
@if (Request::has('action') == false) @if (Request::has('action') == false)
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('file.create') }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('file.create') }}</h3></div>
<div class="panel-body"> <div class="panel-body">
{!! Form::open(['route' => ['files.upload', $project->id], 'id' => 'upload-file', 'files' => true]) !!} {!! Form::open(['route' => ['files.upload', $project->id], 'id' => 'upload-file', 'files' => true]) !!}
{{ Form::hidden('fileable_type', get_class($project)) }} {{ Form::hidden('fileable_type', get_class($project)) }}
{!! FormField::file('file', ['label' => trans('file.select')]) !!}
{!! FormField::file('file', ['label' => __('file.select')]) !!}
{!! FormField::text('title') !!} {!! FormField::text('title') !!}
{!! FormField::textarea('description') !!} {!! FormField::textarea('description') !!}
{!! Form::submit(trans('file.upload'), ['class' => 'btn btn-info']) !!}
{!! Form::submit(__('file.upload'), ['class' => 'btn btn-info']) !!}
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>
@endif @endif
@if (Request::get('action') == 'edit' && $editableFile) @if (Request::get('action') == 'edit' && $editableFile)
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ trans('file.edit') }} : {{ $editableFile->title }}</h3></div>
<div class="panel-heading"><h3 class="panel-title">{{ __('file.edit') }} : {{ $editableFile->title }}</h3></div>
<div class="panel-body"> <div class="panel-body">
{!! Form::model($editableFile, ['route' => ['files.update', $editableFile->id],'method' => 'patch']) !!} {!! Form::model($editableFile, ['route' => ['files.update', $editableFile->id],'method' => 'patch']) !!}
{!! FormField::text('title', ['label' => trans('file.title'), 'required' => true]) !!}
{!! FormField::textarea('description', ['label' => trans('file.description')]) !!}
{!! Form::submit(trans('file.update'), ['class' => 'btn btn-success']) !!}
{{ link_to_route('projects.files', trans('app.cancel'), [$project->id], ['class' => 'btn btn-default']) }}
{!! FormField::text('title', ['label' => __('file.title'), 'required' => true]) !!}
{!! FormField::textarea('description', ['label' => __('file.description')]) !!}
{!! Form::submit(__('file.update'), ['class' => 'btn btn-success']) !!}
{{ link_to_route('projects.files', __('app.cancel'), [$project->id], ['class' => 'btn btn-default']) }}
{!! Form::close() !!} {!! Form::close() !!}
</div> </div>
</div> </div>
@endif
@endif
@if (Request::get('action') == 'delete' && $editableFile)
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ __('file.delete') }} : {{ $editableFile->title }}</h3></div>
<div class="panel-body">{{ __('file.delete_confirm') }}</div>
<div class="panel-footer">
{!! FormField::delete(
['route' => ['files.destroy', $editableFile->id]],
__('app.delete_confirm_button'),
['class' => 'btn btn-danger'],
['file_id' => $editableFile->id, ]
) !!}
{{ link_to_route('projects.files', __('app.cancel'), $project, ['class' => 'btn btn-default']) }}
</div>
</div>
@endif
</div> </div>
</div> </div>
@endsection
@endsection

4
resources/views/projects/index.blade.php

@ -44,11 +44,11 @@
<td class="text-center">{{ $project->start_date }}</td> <td class="text-center">{{ $project->start_date }}</td>
<td class="text-right">{{ $project->work_duration }}</td> <td class="text-right">{{ $project->work_duration }}</td>
@if (request('status_id') == 2) @if (request('status_id') == 2)
<td class="text-right">{{ formatDecimal($project->getJobOveralProgress()) }} %</td>
<td class="text-right">{{ format_decimal($project->getJobOveralProgress()) }} %</td>
<td class="text-center">{{ $project->due_date }}</td> <td class="text-center">{{ $project->due_date }}</td>
@endif @endif
@can('see-pricings', new App\Entities\Projects\Project) @can('see-pricings', new App\Entities\Projects\Project)
<td class="text-right">{{ formatRp($project->project_value) }}</td>
<td class="text-right">{{ format_money($project->project_value) }}</td>
@endcan @endcan
<td class="text-center">{{ $project->present()->status }}</td> <td class="text-center">{{ $project->present()->status }}</td>
<td>{{ $project->customer->name }}</td> <td>{{ $project->customer->name }}</td>

4
resources/views/projects/invoices.blade.php

@ -40,7 +40,7 @@
<td class="text-center">{{ $invoice->date }}</td> <td class="text-center">{{ $invoice->date }}</td>
<td class="text-center">{{ $invoice->due_date }}</td> <td class="text-center">{{ $invoice->due_date }}</td>
<td>{{ $project->customer->nameLink() }}</td> <td>{{ $project->customer->nameLink() }}</td>
<td class="text-right">{{ formatRp($invoice->amount) }}</td>
<td class="text-right">{{ format_money($invoice->amount) }}</td>
<td class="text-center"> <td class="text-center">
{!! html_link_to_route( {!! html_link_to_route(
'invoices.show', '', [$invoice->number], 'invoices.show', '', [$invoice->number],
@ -68,7 +68,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="5" class="text-right">{{ trans('app.total') }}</th> <th colspan="5" class="text-right">{{ trans('app.total') }}</th>
<th class="text-right">{{ formatRp($project->invoices->sum('amount')) }}</th>
<th class="text-right">{{ format_money($project->invoices->sum('amount')) }}</th>
<th>&nbsp;</th> <th>&nbsp;</th>
</tr> </tr>
</tfoot> </tfoot>

32
resources/views/projects/issues/create.blade.php

@ -0,0 +1,32 @@
@extends('layouts.project')
@section('subtitle', __('issue.create'))
@section('action-buttons')
@can('create', new App\Entities\Projects\Issue)
{!! html_link_to_route('projects.issues.create', __('issue.create'), $project, ['class' => 'btn btn-success', 'icon' => 'plus']) !!}
@endcan
@endsection
@section('content-project')
<div class="row">
<div class="col-sm-6 col-sm-offset-2">
{{ Form::open(['route' => ['projects.issues.store', $project]]) }}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ __('issue.create') }}</h3></div>
<div class="panel-body">
{!! FormField::text('title', ['label' => __('issue.title')]) !!}
{!! FormField::textarea('body', ['label' => __('issue.body')]) !!}
{!! FormField::radios('priority_id', $priorities, ['label' => __('issue.priority'), 'placeholder' => false]) !!}
{!! FormField::select('pic_id', $users, ['label' => __('issue.pic')]) !!}
</div>
<div class="panel-footer">
{{ Form::submit(__('issue.create'), ['class' => 'btn btn-success']) }}
{{ link_to_route('projects.issues.index', __('app.cancel'), $project, ['class' => 'btn btn-default']) }}
</div>
</div>
{{ Form::close() }}
</div>
</div>
@endsection

54
resources/views/projects/issues/edit.blade.php

@ -0,0 +1,54 @@
@extends('layouts.project')
@section('subtitle', __('issue.update'))
@section('action-buttons')
@can('create', new App\Entities\Projects\Issue)
{!! html_link_to_route('projects.issues.create', __('issue.create'), $project, ['class' => 'btn btn-success', 'icon' => 'plus']) !!}
@endcan
@endsection
@section('content-project')
<div class="row">
<div class="col-sm-6 col-sm-offset-2">
@if (request('action') == 'delete' && $issue)
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ __('issue.delete') }}</h3></div>
<div class="panel-body">
<label class="control-label text-primary">{{ __('issue.title') }}</label>
<p>{{ $issue->title }}</p>
<label class="control-label text-primary">{{ __('issue.body') }}</label>
<p>{{ $issue->body }}</p>
{!! $errors->first('issue_id', '<span class="form-error small">:message</span>') !!}
</div>
<hr style="margin:0">
<div class="panel-body text-danger">{{ __('issue.delete_confirm') }}</div>
<div class="panel-footer">
{!! FormField::delete(
['route' => ['projects.issues.destroy', $project, $issue]],
__('app.delete_confirm_button'),
['id' => 'delete-issue-'.$issue->id, 'class' => 'btn btn-danger'],
['issue_id' => $issue->id]
) !!}
{{ link_to_route('projects.issues.edit', __('app.cancel'), [$project, $issue], ['class' => 'btn btn-default']) }}
</div>
</div>
@else
{{ Form::model($issue, ['route' => ['projects.issues.update', $project, $issue], 'method' => 'patch']) }}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ __('issue.update') }}</h3></div>
<div class="panel-body">
{!! FormField::text('title', ['label' => __('issue.title')]) !!}
{!! FormField::textarea('body', ['label' => __('issue.body')]) !!}
</div>
<div class="panel-footer">
{{ Form::submit(__('issue.update'), ['class' => 'btn btn-success']) }}
{{ link_to_route('projects.issues.show', __('app.cancel'), [$project, $issue], ['class' => 'btn btn-default']) }}
{{ link_to_route('projects.issues.edit', __('app.delete'), [$project, $issue, 'action' => 'delete'], ['id' => 'delete-issue-'.$issue->id, 'class' => 'btn btn-danger pull-right']) }}
</div>
</div>
{{ Form::close() }}
@endif
</div>
</div>
@endsection

67
resources/views/projects/issues/index.blade.php

@ -0,0 +1,67 @@
@inject('priorities', 'App\Entities\Projects\Priority')
@inject('issueStatuses', 'App\Entities\Projects\IssueStatus')
@extends('layouts.project')
@section('subtitle', __('project.issues'))
@section('action-buttons')
{{ Form::open(['method' => 'get', 'class' => 'form-inline', 'style' => 'display:inline']) }}
{!! FormField::select('priority_id', $priorities::toArray(), ['label' => false, 'placeholder' => __('issue.all_priority'), 'value' => request('priority_id')]) !!}
{!! FormField::select('status_id', $issueStatuses::toArray(), ['label' => false, 'placeholder' => __('issue.all_status'), 'value' => request('status_id')]) !!}
{{ Form::submit(__('app.filter'), ['class' => 'btn btn-info']) }}
@if (request(['priority_id', 'status_id']))
{{ link_to_route('projects.issues.index', __('app.reset'), $project, ['class' => 'btn btn-default']) }}
@endif
{{ Form::close() }}
@can('create', new App\Entities\Projects\Issue)
{!! html_link_to_route('projects.issues.create', __('issue.create'), $project, ['class' => 'btn btn-success', 'icon' => 'plus']) !!}
@endcan
@endsection
@section('content-project')
<div id="project-issues" class="panel panel-default table-responsive">
<div class="panel-heading">
<h3 class="panel-title">{{ __('project.issues') }}</h3>
</div>
<table class="table table-condensed table-striped">
<thead>
<th>{{ __('app.table_no') }}</th>
<th>{{ __('issue.title') }}</th>
<th>{{ __('issue.priority') }}</th>
<th>{{ __('app.status') }}</th>
<th class="text-center">{{ __('comment.comment') }}</th>
<th>{{ __('issue.pic') }}</th>
<th>{{ __('issue.creator') }}</th>
<th>{{ __('app.last_update') }}</th>
<th class="text-center">{{ __('app.action') }}</th>
</thead>
<tbody>
@forelse($issues as $key => $issue)
@php
$no = 1 + $key;
@endphp
<tr id="{{ $issue->id }}">
<td>{{ $no }}</td>
<td>{{ $issue->title }}</td>
<td>{!! $issue->priority_label !!}</td>
<td>{!! $issue->status_label !!}</td>
<td class="text-center">{{ $issue->comments_count }}</td>
<td>{{ $issue->pic->name }}</td>
<td>{{ $issue->creator->name }}</td>
<td>{{ $issue->updated_at->diffForHumans() }}</td>
<td class="text-center">
{{ link_to_route(
'projects.issues.show',
__('app.show'),
[$project, $issue],
['title' => __('issue.show')]
) }}
</td>
</tr>
@empty
<tr><td colspan="9">{{ __('issue.not_found') }}</td></tr>
@endforelse
</tbody>
</table>
</div>
@endsection

54
resources/views/projects/issues/partials/comment-section.blade.php

@ -0,0 +1,54 @@
@foreach($comments as $comment)
<div class="alert alert-warning">
<legend style="font-size: 14px;margin-bottom: 10px;">
<span class="label label-default pull-right">{{ $comment->time_display }}</span>
<strong>{{ $comment->creator->name }}</strong>
</legend>
<div class="pull-right">
@can('update', $comment)
{{ link_to_route('projects.issues.show', __('app.edit'), [$project, $issue, 'action' => 'comment-edit', 'comment_id' => $comment->id], ['id' => 'edit-comment-'.$comment->id, 'class' => 'small', 'title' => __('comment.edit')]) }}
@endcan
@can('delete', $comment)
{!! FormField::delete(
['route' => ['issues.comments.destroy', $issue, $comment], 'class' => ''],
'&times;',
['class' => 'btn-link', 'id' => 'delete-comment-'.$comment->id],
['comment_id' => $comment->id]
) !!}
@endcan
</div>
{!! nl2br($comment->body) !!}
</div>
@endforeach
@can('comment-on', $issue)
{{ Form::open(['route' => ['issues.comments.store', $issue]]) }}
{!! FormField::textarea('body', ['required' => true, 'label' => false, 'placeholder' => __('comment.create_text')]) !!}
{{ Form::submit(__('comment.create'), ['class' => 'btn btn-success pull-right']) }}
{{ Form::close() }}
<div class="clearfix"></div><br>
@endcan
@if (Request::get('action') == 'comment-edit' && $editableComment)
<div id="commentModal" class="modal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
{{ link_to_route('projects.issues.show', '&times;', [$issue->project, $issue], ['class' => 'close']) }}
<h4 class="modal-title">{{ __('comment.edit') }}</h4>
</div>
{!! Form::model($editableComment, ['route' => ['issues.comments.update', $issue, $editableComment],'method' => 'patch']) !!}
<div class="modal-body">
{!! FormField::textarea('body', ['label' => __('comment.body')]) !!}
{{ Form::hidden('page', request('page')) }}
</div>
<div class="modal-footer">
{!! Form::submit(__('comment.update'), ['class' => 'btn btn-success']) !!}
{{ link_to_route('projects.issues.show', __('app.cancel'), [$project->issue, $issue] + request(['page']), ['class' => 'btn btn-default']) }}
</div>
{!! Form::close() !!}
</div>
</div>
</div>
@endif

65
resources/views/projects/issues/show.blade.php

@ -0,0 +1,65 @@
@extends('layouts.project')
@section('subtitle', __('issue.detail'))
@section('action-buttons')
@can('create', new App\Entities\Projects\Issue)
{!! html_link_to_route('projects.issues.create', __('issue.create'), $project, ['class' => 'btn btn-success', 'icon' => 'plus']) !!}
@endcan
@endsection
@section('content-project')
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<div class="pull-right">{!! $issue->status_label !!}</div>
{{ __('issue.detail') }}
</h3>
</div>
<table class="table table-condensed">
<tbody>
<tr><th class="col-md-4">{{ __('issue.title') }}</th><td class="col-md-8">{{ $issue->title }}</td></tr>
<tr><th>{{ __('issue.body') }}</th><td>{{ $issue->body }}</td></tr>
<tr><th>{{ __('issue.priority') }}</th><td>{!! $issue->priority_label !!}</td></tr>
<tr><th>{{ __('issue.pic') }}</th><td>{{ $issue->pic->name }}</td></tr>
<tr><th>{{ __('app.created_by') }}</th><td>{{ $issue->creator->name }}</td></tr>
</tbody>
</table>
<div class="panel-footer">
{{ link_to_route('projects.issues.edit', __('issue.edit'), [$project, $issue], ['id' => 'edit-issue-'.$issue->id, 'class' => 'btn btn-warning']) }}
{{ link_to_route('projects.issues.index', __('issue.back_to_index'), [$project], ['class' => 'btn btn-default pull-right']) }}
</div>
</div>
<hr>
@include('projects.issues.partials.comment-section')
</div>
<div class="col-md-6">
{{ Form::model($issue, ['route' => ['issues.options.update', $issue], 'method' => 'patch']) }}
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title">{{ __('app.action') }}</h3></div>
<div class="panel-body">
{!! FormField::radios('priority_id', $priorities, ['label' => __('issue.priority')]) !!}
{!! FormField::radios('status_id', $statuses, ['label' => __('app.status')]) !!}
{!! FormField::select('pic_id', $users, ['label' => __('issue.assign_pic'), 'placeholder' => __('issue.select_pic')]) !!}
</div>
<div class="panel-footer">
{{ Form::submit(__('issue.update'), ['class' => 'btn btn-success']) }}
</div>
</div>
{{ Form::close() }}
</div>
</div>
@endsection
@section('script')
<script>
(function () {
$('#commentModal').modal({
show: true,
backdrop: 'static',
});
})();
</script>
@endsection

10
resources/views/projects/jobs/add-from-other-project.blade.php

@ -32,7 +32,7 @@
@foreach($job->tasks as $task) @foreach($job->tasks as $task)
<li> <li>
<label for="{{ $job->id }}_task_id_{{ $task->id }}" style="font-weight:normal"> <label for="{{ $job->id }}_task_id_{{ $task->id }}" style="font-weight:normal">
{{ Form::checkbox($job->id.'_task_ids['.$task->id.']', $task->id, null, ['id' => $job->id.'_task_id_'.$task->id]) }}
{{ Form::checkbox($job->id.'_task_ids['.$task->id.']', $task->id, null, ['id' => $job->id.'_task_id_'.$task->id, 'class' => 'job_id_'.$job->id.'_tasks']) }}
{{ $task->name }}</label> {{ $task->name }}</label>
</li> </li>
@endforeach @endforeach
@ -72,6 +72,14 @@
<script> <script>
(function() { (function() {
$('select[name=project_id]').select2(); $('select[name=project_id]').select2();
@if ($selectedProject)
@foreach ($selectedProject->jobs as $job)
$('#job_id_{{ $job->id }}').change(function () {
$('.job_id_{{ $job->id }}_tasks').prop('checked', this.checked);
});
@endforeach
@endif
})(); })();
</script> </script>
@endsection @endsection

18
resources/views/projects/jobs/export-html.blade.php

@ -1,13 +1,7 @@
<?php
// $filename = str_slug(__('project.jobs') . '-' . $project->name) . '.xls';
// header("Content-Disposition: attachment; filename=\"$filename\"");
// header("Content-Type: application/vnd.ms-excel");
?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
{{-- <meta http-equiv="X-UA-Compatible" content="IE=edge"> --}}
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{{ __('project.jobs') }} {{ $project->name }}</title> <title>{{ __('project.jobs') }} {{ $project->name }}</title>
{!! Html::style('assets/css/app.css') !!} {!! Html::style('assets/css/app.css') !!}
@ -22,9 +16,15 @@
<tbody> <tbody>
<tr style="background-color: #ffd298"><th colspan="2">{{ __('app.description') }}</th></tr> <tr style="background-color: #ffd298"><th colspan="2">{{ __('app.description') }}</th></tr>
<tr><td colspan="2">{!! nl2br($job->description) !!}</td></tr> <tr><td colspan="2">{!! nl2br($job->description) !!}</td></tr>
<tr>
<td colspan="2" class="text-right">
<em>
{{ __('job.price') }}: {{ format_money($job->price) }}
</em>
</td>
</tr>
@if ($job->tasks->count()) @if ($job->tasks->count())
<tr><td colspan="2">&nbsp;</td></tr>
<tr style="background-color: #ffd298"> <tr style="background-color: #ffd298">
<th class="col-md-3">{{ __('task.list') }}</th> <th class="col-md-3">{{ __('task.list') }}</th>
<th class="col-md-6">{{ __('app.description') }}</th> <th class="col-md-6">{{ __('app.description') }}</th>
@ -52,14 +52,14 @@
<tr> <tr>
<td class="text-center">{{ 1 + $key }}</td> <td class="text-center">{{ 1 + $key }}</td>
<td>{{ $job->name }}</td> <td>{{ $job->name }}</td>
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="2">Total</th> <th class="text-right" colspan="2">Total</th>
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th>
<th class="text-right">{{ format_money($jobs->sum('price')) }}</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

10
resources/views/projects/jobs/index.blade.php

@ -82,9 +82,9 @@
@endif @endif
</td> </td>
<td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td> <td class="text-center">{{ $job->tasks_count = $job->tasks->count() }}</td>
<td class="text-center">{{ formatDecimal($job->progress) }} %</td>
<td class="text-center">{{ format_decimal($job->progress) }} %</td>
@can('see-pricings', $job) @can('see-pricings', $job)
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
@endcan @endcan
<td class="text-center"> <td class="text-center">
{{ $job->updated_at->diffForHumans() }} <br> {{ $job->updated_at->diffForHumans() }} <br>
@ -108,11 +108,11 @@
<th class="text-right" colspan="2">Total</th> <th class="text-right" colspan="2">Total</th>
<th class="text-center">{{ $groupedJobs->sum('tasks_count') }}</th> <th class="text-center">{{ $groupedJobs->sum('tasks_count') }}</th>
<th class="text-center"> <th class="text-center">
<span title="Total Progress">{{ formatDecimal($groupedJobs->sum('progress') / $groupedJobs->count()) }} %</span>
<span title="Overal Progress" style="font-weight:300">({{ formatDecimal($project->getJobOveralProgress()) }} %)</span>
<span title="Total Progress">{{ format_decimal($groupedJobs->sum('progress') / $groupedJobs->count()) }} %</span>
<span title="Overal Progress" style="font-weight:300">({{ format_decimal($project->getJobOveralProgress()) }} %)</span>
</th> </th>
@can('see-pricings', new App\Entities\Projects\Job) @can('see-pricings', new App\Entities\Projects\Job)
<th class="text-right">{{ formatRp($groupedJobs->sum('price')) }}</th>
<th class="text-right">{{ format_money($groupedJobs->sum('price')) }}</th>
@endcan @endcan
<th colspan="2"> <th colspan="2">
@can('update', $project) @can('update', $project)

12
resources/views/projects/jobs/progress-export-html.blade.php

@ -30,18 +30,18 @@
<tr> <tr>
<td class="text-center">{{ 1 + $key }}</td> <td class="text-center">{{ 1 + $key }}</td>
<td>{{ $job->name }}</td> <td>{{ $job->name }}</td>
<td class="text-right">{{ formatRp($job->price) }}</td>
<td class="text-right">{{ formatDecimal($job->progress) }} %</td>
<td class="text-right">{{ formatRp($job->receiveable_earning) }}</td>
<td class="text-right">{{ format_money($job->price) }}</td>
<td class="text-right">{{ format_decimal($job->progress) }} %</td>
<td class="text-right">{{ format_money($job->receiveable_earning) }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
<tfoot> <tfoot>
<tr> <tr>
<th class="text-right" colspan="2">{{ __('app.total') }}</th> <th class="text-right" colspan="2">{{ __('app.total') }}</th>
<th class="text-right">{{ formatRp($jobs->sum('price')) }}</th>
<th class="text-right">{{ formatDecimal($project->getJobOveralProgress()) }} %</th>
<th class="text-right">{{ formatRp($jobs->sum('receiveable_earning')) }}</th>
<th class="text-right">{{ format_money($jobs->sum('price')) }}</th>
<th class="text-right">{{ format_decimal($project->getJobOveralProgress()) }} %</th>
<th class="text-right">{{ format_money($jobs->sum('receiveable_earning')) }}</th>
</tr> </tr>
</tfoot> </tfoot>
</table> </table>

3
resources/views/projects/partials/nav-tabs.blade.php

@ -8,6 +8,9 @@
{!! link_to_route('projects.jobs.index', __('project.jobs').' ('.$project->jobs->count().')', $project) !!} {!! link_to_route('projects.jobs.index', __('project.jobs').' ('.$project->jobs->count().')', $project) !!}
</li> </li>
@endcan @endcan
<li class="{{ Request::segment(3) == 'issues' ? 'active' : '' }}">
{!! link_to_route('projects.issues.index', __('project.issues').' ('.$project->issues->count().')', $project) !!}
</li>
@can('view-comments', $project) @can('view-comments', $project)
<li class="{{ Request::segment(3) == 'comments' ? 'active' : '' }}"> <li class="{{ Request::segment(3) == 'comments' ? 'active' : '' }}">
{!! link_to_route('projects.comments.index', __('comment.list').' ('.$project->comments->count().')', $project) !!} {!! link_to_route('projects.comments.index', __('comment.list').' ('.$project->comments->count().')', $project) !!}

16
resources/views/projects/partials/payment-summary.blade.php

@ -8,19 +8,19 @@
<td class="col-xs-2 text-center">{{ trans('project.payment_status') }}</td> <td class="col-xs-2 text-center">{{ trans('project.payment_status') }}</td>
</tr> </tr>
<tr> <tr>
<td class="text-center lead" style="border-top: none;">{{ formatRp($project->project_value) }}</td>
<td class="text-center lead" style="border-top: none;">{{ formatRp($project->cashInTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ formatRp($project->cashOutTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ formatRp($balance = $project->project_value - $project->cashInTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ format_money($project->project_value) }}</td>
<td class="text-center lead" style="border-top: none;">{{ format_money($project->cashInTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ format_money($project->cashOutTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ format_money($balance = $project->project_value - $project->cashInTotal()) }}</td>
<td class="text-center lead" style="border-top: none;">{{ $balance > 0 ? trans('project.payment_statuses.outstanding') : trans('project.payment_statuses.paid') }}</td> <td class="text-center lead" style="border-top: none;">{{ $balance > 0 ? trans('project.payment_statuses.outstanding') : trans('project.payment_statuses.paid') }}</td>
</tr> </tr>
</table> </table>
</div> </div>
<ul class="list-group visible-xs"> <ul class="list-group visible-xs">
<li class="list-group-item">{{ trans('project.project_value') }} <span class="pull-right">{{ formatRp($project->project_value) }}</span></li>
<li class="list-group-item">{{ trans('project.cash_in_total') }} <span class="pull-right">{{ formatRp($project->cashInTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.cash_out_total') }} <span class="pull-right">{{ formatRp($project->cashOutTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.payment_remaining') }} <span class="pull-right">{{ formatRp($balance = $project->project_value - $project->cashInTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.project_value') }} <span class="pull-right">{{ format_money($project->project_value) }}</span></li>
<li class="list-group-item">{{ trans('project.cash_in_total') }} <span class="pull-right">{{ format_money($project->cashInTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.cash_out_total') }} <span class="pull-right">{{ format_money($project->cashOutTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.payment_remaining') }} <span class="pull-right">{{ format_money($balance = $project->project_value - $project->cashInTotal()) }}</span></li>
<li class="list-group-item">{{ trans('project.payment_status') }} <span class="pull-right">{{ $balance > 0 ? trans('project.payment_statuses.outstanding') : trans('project.payment_statuses.paid') }}</span></li> <li class="list-group-item">{{ trans('project.payment_status') }} <span class="pull-right">{{ $balance > 0 ? trans('project.payment_statuses.outstanding') : trans('project.payment_statuses.paid') }}</span></li>
</ul> </ul>

12
resources/views/projects/partials/project-show.blade.php

@ -5,14 +5,14 @@
<tbody> <tbody>
<tr><td class="col-xs-3">{{ trans('project.name') }}</td><td class="col-xs-9">{{ $project->name }}</td></tr> <tr><td class="col-xs-3">{{ trans('project.name') }}</td><td class="col-xs-9">{{ $project->name }}</td></tr>
<tr><td>{{ trans('project.description') }}</td><td>{!! nl2br($project->description) !!}</td></tr> <tr><td>{{ trans('project.description') }}</td><td>{!! nl2br($project->description) !!}</td></tr>
<tr><td>{{ trans('project.proposal_date') }}</td><td>{{ dateId($project->proposal_date) }}</td></tr>
<tr><td>{{ trans('project.proposal_date') }}</td><td>{{ date_id($project->proposal_date) }}</td></tr>
@can('see-pricings', $project) @can('see-pricings', $project)
<tr><td>{{ trans('project.proposal_value') }}</td><td class="text-right">{{ formatRp($project->proposal_value) }}</td></tr>
<tr><td>{{ trans('project.project_value') }}</td><td class="text-right">{{ formatRp($project->project_value) }}</td></tr>
<tr><td>{{ trans('project.proposal_value') }}</td><td class="text-right">{{ format_money($project->proposal_value) }}</td></tr>
<tr><td>{{ trans('project.project_value') }}</td><td class="text-right">{{ format_money($project->project_value) }}</td></tr>
@endcan @endcan
<tr><td>{{ trans('project.start_date') }}</td><td>{{ dateId($project->start_date) }}</td></tr>
<tr><td>{{ trans('project.end_date') }}</td><td>{{ dateId($project->end_date) }}</td></tr>
<tr><td>{{ trans('project.due_date') }}</td><td>{{ dateId($project->due_date) }}</td></tr>
<tr><td>{{ trans('project.start_date') }}</td><td>{{ date_id($project->start_date) }}</td></tr>
<tr><td>{{ trans('project.end_date') }}</td><td>{{ date_id($project->end_date) }}</td></tr>
<tr><td>{{ trans('project.due_date') }}</td><td>{{ date_id($project->due_date) }}</td></tr>
<tr><td>{{ trans('app.status') }}</td><td>{{ $project->present()->status }}</td></tr> <tr><td>{{ trans('app.status') }}</td><td>{{ $project->present()->status }}</td></tr>
<tr> <tr>
<td>{{ trans('project.customer') }}</td> <td>{{ trans('project.customer') }}</td>

4
resources/views/projects/partials/project-stats.blade.php

@ -6,7 +6,7 @@
<div class="row"> <div class="row">
<div class="col-xs-3"><i class="fa fa-tasks fa-4x"></i></div> <div class="col-xs-3"><i class="fa fa-tasks fa-4x"></i></div>
<div class="col-xs-9 text-right"> <div class="col-xs-9 text-right">
<div class="huge" style="font-size: 38px;">{{ formatDecimal($project->getJobOveralProgress()) }} %</div>
<div class="huge" style="font-size: 38px;">{{ format_decimal($project->getJobOveralProgress()) }} %</div>
<div class="lead">{{ __('project.overall_progress') }}</div> <div class="lead">{{ __('project.overall_progress') }}</div>
</div> </div>
</div> </div>
@ -38,7 +38,7 @@
<div class="col-xs-12 text-right"> <div class="col-xs-12 text-right">
<i class="fa fa-money fa-2x pull-left"></i> <i class="fa fa-money fa-2x pull-left"></i>
<div class="lead">Collectibe Earnings</div> <div class="lead">Collectibe Earnings</div>
<div class="lead" style="font-size: 30px;">{{ formatRp($project->getCollectibeEarnings()) }}</div>
<div class="lead" style="font-size: 30px;">{{ format_money($project->getCollectibeEarnings()) }}</div>
</div> </div>
</div> </div>
</div> </div>

4
resources/views/projects/payments.blade.php

@ -36,7 +36,7 @@
<tr> <tr>
<td class="text-center">{{ 1 + $key }}</td> <td class="text-center">{{ 1 + $key }}</td>
<td class="text-center">{{ $payment->date }}</td> <td class="text-center">{{ $payment->date }}</td>
<td class="text-right">{{ formatRp($payment->amount) }}</td>
<td class="text-right">{{ format_money($payment->amount) }}</td>
<td>{{ $payment->partner->name }}</td> <td>{{ $payment->partner->name }}</td>
<td>{{ $payment->description }} [{{ $payment->type() }}]</td> <td>{{ $payment->description }} [{{ $payment->type() }}]</td>
<td class="text-center"> <td class="text-center">
@ -53,7 +53,7 @@
<tfoot> <tfoot>
<tr> <tr>
<th colspan="2" class="text-right">{{ trans('app.total') }}</th> <th colspan="2" class="text-right">{{ trans('app.total') }}</th>
<th class="text-right">{{ formatRp($payments->sum('amount')) }}</th>
<th class="text-right">{{ format_money($payments->sum('amount')) }}</th>
<th colspan="5"></th> <th colspan="5"></th>
</tr> </tr>
</tfoot> </tfoot>

8
resources/views/projects/subscriptions.blade.php

@ -30,10 +30,10 @@
<tr> <tr>
<td>{{ 1 + $key }}</td> <td>{{ 1 + $key }}</td>
<td class="text-center">{{ $subscription->type }}</td> <td class="text-center">{{ $subscription->type }}</td>
<td>{{ $subscription->nameLink() }}</td>
<td class="text-right">{{ dateId($subscription->start_date) }}</td>
<td class="text-right">{{ dateId($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}</td>
<td class="text-right">{{ formatRp($subscription->price) }}</td>
<td>{{ $subscription->name_link }}</td>
<td class="text-right">{{ date_id($subscription->start_date) }}</td>
<td class="text-right">{{ date_id($subscription->due_date) }} {!! $subscription->nearOfDueDateSign() !!}</td>
<td class="text-right">{{ format_money($subscription->price) }}</td>
<td> <td>
{!! link_to_route('subscriptions.show',trans('app.show'),[$subscription->id],['class'=>'btn btn-info btn-xs']) !!} {!! link_to_route('subscriptions.show',trans('app.show'),[$subscription->id],['class'=>'btn btn-info btn-xs']) !!}
{!! link_to_route('subscriptions.edit',trans('app.edit'),[$subscription->id],['class'=>'btn btn-warning btn-xs']) !!} {!! link_to_route('subscriptions.edit',trans('app.edit'),[$subscription->id],['class'=>'btn btn-warning btn-xs']) !!}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save