Skip to content

Commit

Permalink
refs #273 change solution system
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jul 11, 2018
1 parent da09152 commit 5503e54
Show file tree
Hide file tree
Showing 14 changed files with 99 additions and 208 deletions.
8 changes: 4 additions & 4 deletions app/Http/Controllers/Banking/Transfers.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ public function store(Request $request)
'company_id' => $request['company_id'],
'account_id' => $request['from_account_id'],
'paid_at' => $request['transferred_at'],
'amount' => $request['amount'],
'currency_code' => $payment_currency_code,
'currency_rate' => $currencies[$payment_currency_code],
'amount' => $request['amount'],
'vendor_id' => 0,
'description' => $request['description'],
'category_id' => Category::transfer(), // Transfer Category ID
Expand Down Expand Up @@ -153,9 +153,9 @@ public function store(Request $request)
'company_id' => $request['company_id'],
'account_id' => $request['to_account_id'],
'paid_at' => $request['transferred_at'],
'amount' => $amount,
'currency_code' => $revenue_currency_code,
'currency_rate' => $currencies[$revenue_currency_code],
'amount' => $amount,
'customer_id' => 0,
'description' => $request['description'],
'category_id' => Category::transfer(), // Transfer Category ID
Expand Down Expand Up @@ -229,9 +229,9 @@ public function update(Transfer $transfer, Request $request)
'company_id' => $request['company_id'],
'account_id' => $request['from_account_id'],
'paid_at' => $request['transferred_at'],
'amount' => $request['amount'],
'currency_code' => $payment_currency_code,
'currency_rate' => $currencies[$payment_currency_code],
'amount' => $request['amount'],
'vendor_id' => 0,
'description' => $request['description'],
'category_id' => Category::transfer(), // Transfer Category ID
Expand Down Expand Up @@ -259,9 +259,9 @@ public function update(Transfer $transfer, Request $request)
'company_id' => $request['company_id'],
'account_id' => $request['to_account_id'],
'paid_at' => $request['transferred_at'],
'amount' => $amount,
'currency_code' => $revenue_currency_code,
'currency_rate' => $currencies[$revenue_currency_code],
'amount' => $amount,
'customer_id' => 0,
'description' => $request['description'],
'category_id' => Category::transfer(), // Transfer Category ID
Expand Down
5 changes: 0 additions & 5 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,5 @@ class Kernel extends HttpKernel
'install' => \App\Http\Middleware\CanInstall::class,
'company.settings' => \App\Http\Middleware\LoadSettings::class,
'company.currencies' => \App\Http\Middleware\LoadCurrencies::class,
'bill.dateformat' => \App\Http\Middleware\BillDateFormat::class,
'invoice.dateformat' => \App\Http\Middleware\InvoiceDateFormat::class,
'payment.dateformat' => \App\Http\Middleware\PaymentDateFormat::class,
'revenue.dateformat' => \App\Http\Middleware\RevenueDateFormat::class,
'transfer.dateformat' => \App\Http\Middleware\TransferDateFormat::class,
];
}
42 changes: 0 additions & 42 deletions app/Http/Middleware/BillDateFormat.php

This file was deleted.

42 changes: 0 additions & 42 deletions app/Http/Middleware/InvoiceDateFormat.php

This file was deleted.

36 changes: 0 additions & 36 deletions app/Http/Middleware/PaymentDateFormat.php

This file was deleted.

36 changes: 0 additions & 36 deletions app/Http/Middleware/RevenueDateFormat.php

This file was deleted.

36 changes: 0 additions & 36 deletions app/Http/Middleware/TransferDateFormat.php

This file was deleted.

22 changes: 22 additions & 0 deletions app/Models/Expense/Bill.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,28 @@ public function setCurrencyRateAttribute($value)
$this->attributes['currency_rate'] = (double) $value;
}

/**
* Convert billed_at to datetime.
*
* @param string $value
* @return void
*/
public function setBilledAtAttribute($value)
{
$this->attributes['billed_at'] = $value . ' ' . Date::now()->format('H:i:s');
}

/**
* Convert due_at to datetime.
*
* @param string $value
* @return void
*/
public function setDueAtAttribute($value)
{
$this->attributes['due_at'] = $value . ' ' . Date::now()->format('H:i:s');
}

/**
* Get the current balance.
*
Expand Down
11 changes: 11 additions & 0 deletions app/Models/Expense/BillPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ public function scopePaid($query)
return $query->sum('amount');
}

/**
* Convert paid_at to datetime.
*
* @param string $value
* @return void
*/
public function setPaidAtAttribute($value)
{
$this->attributes['paid_at'] = $value . ' ' . Date::now()->format('H:i:s');
}

/**
* Get the current balance.
*
Expand Down
11 changes: 11 additions & 0 deletions app/Models/Expense/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@ public static function scopeLatest($query)
return $query->orderBy('paid_at', 'desc');
}

/**
* Convert paid_at to datetime.
*
* @param string $value
* @return void
*/
public function setPaidAtAttribute($value)
{
$this->attributes['paid_at'] = $value . ' ' . Date::now()->format('H:i:s');
}

/**
* Get the current balance.
*
Expand Down
22 changes: 22 additions & 0 deletions app/Models/Income/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,28 @@ public function setCurrencyRateAttribute($value)
$this->attributes['currency_rate'] = (double) $value;
}

/**
* Convert invoiced_at to datetime.
*
* @param string $value
* @return void
*/
public function setInvoicedAtAttribute($value)
{
$this->attributes['invoiced_at'] = $value . ' ' . Date::now()->format('H:i:s');
}

/**
* Convert due_at to datetime.
*
* @param string $value
* @return void
*/
public function setDueAtAttribute($value)
{
$this->attributes['due_at'] = $value . ' ' . Date::now()->format('H:i:s');
}

/**
* Get the current balance.
*
Expand Down
11 changes: 11 additions & 0 deletions app/Models/Income/InvoicePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@ public function scopePaid($query)
return $query->sum('amount');
}

/**
* Convert paid_at to datetime.
*
* @param string $value
* @return void
*/
public function setPaidAtAttribute($value)
{
$this->attributes['paid_at'] = $value . ' ' . Date::now()->format('H:i:s');
}

/**
* Get the current balance.
*
Expand Down
11 changes: 11 additions & 0 deletions app/Models/Income/Revenue.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,17 @@ public function setCurrencyRateAttribute($value)
$this->attributes['currency_rate'] = (double) $value;
}

/**
* Convert paid_at to datetime.
*
* @param string $value
* @return void
*/
public function setPaidAtAttribute($value)
{
$this->attributes['paid_at'] = $value . ' ' . Date::now()->format('H:i:s');
}

public function scopeLatest($query)
{
return $query->orderBy('paid_at', 'desc');
Expand Down

0 comments on commit 5503e54

Please sign in to comment.