mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-15 10:24:35 -04:00
bug fixes [trigger:composer]
This commit is contained in:
parent
9f79628579
commit
ac917c2b51
@ -501,7 +501,7 @@ class InvoiceController extends \BaseController {
|
||||
$invoice->is_deleted = true;
|
||||
$invoice->save();
|
||||
}
|
||||
|
||||
|
||||
$invoice->delete();
|
||||
}
|
||||
|
||||
|
@ -74,10 +74,13 @@ class Utils
|
||||
|
||||
public static function formatMoney($value, $currencyId)
|
||||
{
|
||||
$currency = Currency::find($currencyId);
|
||||
if (!$currency) {
|
||||
$currency = Currency::find(1);
|
||||
$currency = Currency::remember(DEFAULT_QUERY_CACHE)->find($currencyId);
|
||||
|
||||
if (!$currency)
|
||||
{
|
||||
$currency = Currency::remember(DEFAULT_QUERY_CACHE)->find(1);
|
||||
}
|
||||
|
||||
return $currency->symbol . number_format($value, $currency->precision, $currency->decimal_separator, $currency->thousand_separator);
|
||||
}
|
||||
|
||||
@ -318,7 +321,7 @@ class Utils
|
||||
public static function encodeActivity($person = null, $action, $entity = null, $otherPerson = null)
|
||||
{
|
||||
$person = $person ? $person->getDisplayName() : '<i>System</i>';
|
||||
$entity = $entity ? '[' . $entity->getKey() . ']' : '';
|
||||
$entity = $entity ? '[' . $entity->getActivityKey() . ']' : '';
|
||||
$otherPerson = $otherPerson ? 'to ' . $otherPerson->getDisplayName() : '';
|
||||
|
||||
return trim("$person $action $entity $otherPerson");
|
||||
|
@ -127,7 +127,7 @@ class Activity extends Eloquent
|
||||
$activity->client_id = $invoice->client_id;
|
||||
$activity->activity_type_id = ACTIVITY_TYPE_ARCHIVE_INVOICE;
|
||||
$activity->message = Utils::encodeActivity(Auth::user(), 'archived', $invoice);
|
||||
$activity->balance = $client->balance;
|
||||
$activity->balance = $invoice->client->balance;
|
||||
$activity->adjustment = $invoice->balance;
|
||||
|
||||
$activity->save();
|
||||
@ -179,7 +179,7 @@ class Activity extends Eloquent
|
||||
$activity->invoice_id = $invoice->id;
|
||||
$activity->activity_type_id = ACTIVITY_TYPE_DELETE_INVOICE;
|
||||
$activity->message = Utils::encodeActivity(Auth::user(), 'deleted', $invoice);
|
||||
$activity->balance = $client->balance;
|
||||
$activity->balance = $invoice->client->balance;
|
||||
$activity->adjustment = $invoice->balance * -1;
|
||||
$activity->save();
|
||||
}
|
||||
|
@ -3,7 +3,7 @@
|
||||
class EntityModel extends Eloquent
|
||||
{
|
||||
protected $softDelete = true;
|
||||
public $timestamps = false;
|
||||
public $timestamps = true;
|
||||
|
||||
protected $hidden = ['id', 'created_at', 'deleted_at', 'updated_at'];
|
||||
|
||||
@ -42,7 +42,7 @@ class EntityModel extends Eloquent
|
||||
return $className::scope($publicId)->pluck('id');
|
||||
}
|
||||
|
||||
public function getKey()
|
||||
public function getActivityKey()
|
||||
{
|
||||
return $this->getEntityType() . ':' . $this->public_id . ':' . $this->getName();
|
||||
}
|
||||
|
@ -143,4 +143,9 @@ Invoice::created(function($invoice)
|
||||
Invoice::updating(function($invoice)
|
||||
{
|
||||
Activity::updateInvoice($invoice);
|
||||
});
|
||||
|
||||
Invoice::deleting(function($invoice)
|
||||
{
|
||||
Activity::archiveInvoice($invoice);
|
||||
});
|
@ -19,13 +19,33 @@
|
||||
//dd(gethostname());
|
||||
//Log::error('test');
|
||||
|
||||
|
||||
/*
|
||||
DB::listen(function($sql)) {
|
||||
Log::info($sql);
|
||||
}
|
||||
Event::listen('illuminate.query', function($query, $bindings, $time, $name)
|
||||
{
|
||||
$data = compact('bindings', 'time', 'name');
|
||||
|
||||
// Format binding data for sql insertion
|
||||
foreach ($bindings as $i => $binding)
|
||||
{
|
||||
if ($binding instanceof \DateTime)
|
||||
{
|
||||
$bindings[$i] = $binding->format('\'Y-m-d H:i:s\'');
|
||||
}
|
||||
else if (is_string($binding))
|
||||
{
|
||||
$bindings[$i] = "'$binding'";
|
||||
}
|
||||
}
|
||||
|
||||
// Insert bindings into query
|
||||
$query = str_replace(array('%', '?'), array('%%', '%s'), $query);
|
||||
$query = vsprintf($query, $bindings);
|
||||
|
||||
Log::info($query, $data);
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
// TODO_FIX replace with cron
|
||||
Route::get('/send_emails', function() {
|
||||
Artisan::call('ninja:send-invoices');
|
||||
|
52
composer.lock
generated
52
composer.lock
generated
@ -68,12 +68,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Anahkiasen/html-object.git",
|
||||
"reference": "2c6cdc6368d19ac42357f7ae17bd99652a1916e4"
|
||||
"reference": "6264f3dd6b65b40a47632328e9049db83750a4c6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Anahkiasen/html-object/zipball/2c6cdc6368d19ac42357f7ae17bd99652a1916e4",
|
||||
"reference": "2c6cdc6368d19ac42357f7ae17bd99652a1916e4",
|
||||
"url": "https://api.github.com/repos/Anahkiasen/html-object/zipball/6264f3dd6b65b40a47632328e9049db83750a4c6",
|
||||
"reference": "6264f3dd6b65b40a47632328e9049db83750a4c6",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -96,7 +96,7 @@
|
||||
}
|
||||
],
|
||||
"description": "A set of classes to create and manipulate HTML objects abstractions",
|
||||
"time": "2013-11-19 15:20:02"
|
||||
"time": "2014-01-08 20:26:54"
|
||||
},
|
||||
{
|
||||
"name": "anahkiasen/rocketeer",
|
||||
@ -211,17 +211,17 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/barryvdh/laravel-debugbar.git",
|
||||
"reference": "d1ec609e371dc081562b106c36a77357641fefa3"
|
||||
"reference": "ae8d5906c95343c7845ffc0c883f7355694b606c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/d1ec609e371dc081562b106c36a77357641fefa3",
|
||||
"reference": "d1ec609e371dc081562b106c36a77357641fefa3",
|
||||
"url": "https://api.github.com/repos/barryvdh/laravel-debugbar/zipball/ae8d5906c95343c7845ffc0c883f7355694b606c",
|
||||
"reference": "ae8d5906c95343c7845ffc0c883f7355694b606c",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/support": "~4.0",
|
||||
"maximebf/debugbar": "~1.8",
|
||||
"maximebf/debugbar": "~1.9",
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
@ -248,7 +248,7 @@
|
||||
"profiler",
|
||||
"webprofiler"
|
||||
],
|
||||
"time": "2014-01-07 10:13:21"
|
||||
"time": "2014-01-08 21:04:27"
|
||||
},
|
||||
{
|
||||
"name": "chumper/datatable",
|
||||
@ -638,12 +638,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/Intervention/image.git",
|
||||
"reference": "ab884ad94b0861bfa43118eff114af8ee7cf4661"
|
||||
"reference": "c932b81171abbbdc8e3365281443cb28d3b974e1"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/Intervention/image/zipball/ab884ad94b0861bfa43118eff114af8ee7cf4661",
|
||||
"reference": "ab884ad94b0861bfa43118eff114af8ee7cf4661",
|
||||
"url": "https://api.github.com/repos/Intervention/image/zipball/c932b81171abbbdc8e3365281443cb28d3b974e1",
|
||||
"reference": "c932b81171abbbdc8e3365281443cb28d3b974e1",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -680,7 +680,7 @@
|
||||
"thumbnail",
|
||||
"watermark"
|
||||
],
|
||||
"time": "2013-12-30 14:38:30"
|
||||
"time": "2014-01-08 18:31:04"
|
||||
},
|
||||
{
|
||||
"name": "ircmaxell/password-compat",
|
||||
@ -915,12 +915,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/framework.git",
|
||||
"reference": "a49d68a0c048718d442855f52c4c68b97d76fd89"
|
||||
"reference": "e7bcc5741dff0ac6bd16d0d26248d14d8a285842"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/a49d68a0c048718d442855f52c4c68b97d76fd89",
|
||||
"reference": "a49d68a0c048718d442855f52c4c68b97d76fd89",
|
||||
"url": "https://api.github.com/repos/laravel/framework/zipball/e7bcc5741dff0ac6bd16d0d26248d14d8a285842",
|
||||
"reference": "e7bcc5741dff0ac6bd16d0d26248d14d8a285842",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -1024,7 +1024,7 @@
|
||||
"framework",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2014-01-07 02:54:25"
|
||||
"time": "2014-01-09 04:59:16"
|
||||
},
|
||||
{
|
||||
"name": "laravelbook/ardent",
|
||||
@ -2943,12 +2943,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/patricktalmadge/bootstrapper.git",
|
||||
"reference": "85c8e3ec29d0f98554d85b73d1e454b6600c0432"
|
||||
"reference": "dcc58a6e9cd8324f391d2846cd1d264969145298"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/patricktalmadge/bootstrapper/zipball/85c8e3ec29d0f98554d85b73d1e454b6600c0432",
|
||||
"reference": "85c8e3ec29d0f98554d85b73d1e454b6600c0432",
|
||||
"url": "https://api.github.com/repos/patricktalmadge/bootstrapper/zipball/dcc58a6e9cd8324f391d2846cd1d264969145298",
|
||||
"reference": "dcc58a6e9cd8324f391d2846cd1d264969145298",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -2973,7 +2973,7 @@
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Maxime Fabre",
|
||||
"name": "Anahkiasen",
|
||||
"email": "ehtnam6@gmail.com"
|
||||
},
|
||||
{
|
||||
@ -2990,7 +2990,7 @@
|
||||
"bootstrap",
|
||||
"laravel"
|
||||
],
|
||||
"time": "2014-01-07 16:02:34"
|
||||
"time": "2014-01-08 20:23:07"
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
@ -3092,12 +3092,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nrk/predis.git",
|
||||
"reference": "d2debfd43eb8a5201204bb70275a0ef83b3d11ff"
|
||||
"reference": "9d0201ed9ef4fae09ed251897260941af230bed3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nrk/predis/zipball/d2debfd43eb8a5201204bb70275a0ef83b3d11ff",
|
||||
"reference": "d2debfd43eb8a5201204bb70275a0ef83b3d11ff",
|
||||
"url": "https://api.github.com/repos/nrk/predis/zipball/9d0201ed9ef4fae09ed251897260941af230bed3",
|
||||
"reference": "9d0201ed9ef4fae09ed251897260941af230bed3",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@ -3131,7 +3131,7 @@
|
||||
"predis",
|
||||
"redis"
|
||||
],
|
||||
"time": "2013-12-22 16:51:18"
|
||||
"time": "2014-01-08 16:38:22"
|
||||
},
|
||||
{
|
||||
"name": "psr/log",
|
||||
|
Loading…
x
Reference in New Issue
Block a user