Bug fixes

This commit is contained in:
Hillel Coren 2015-11-15 19:23:45 +02:00
parent 03035e8bdf
commit 9a0058deb1
6 changed files with 37 additions and 21 deletions

View File

@ -107,10 +107,13 @@ class ImportExportController extends BaseController
if ($request->input(ENTITY_CLIENT)) {
$data['clients'] = Client::scope()
->with('user', 'contacts', 'country')
->withTrashed()
->where('is_deleted', '=', false)
->get();
$data['contacts'] = Contact::scope()
->with('user', 'client.contacts')
->withTrashed()
->get();
$data['credits'] = Credit::scope()
@ -121,18 +124,24 @@ class ImportExportController extends BaseController
if ($request->input(ENTITY_TASK)) {
$data['tasks'] = Task::scope()
->with('user', 'client.contacts')
->withTrashed()
->where('is_deleted', '=', false)
->get();
}
if ($request->input(ENTITY_INVOICE)) {
$data['invoices'] = Invoice::scope()
->with('user', 'client.contacts', 'invoice_status')
->withTrashed()
->where('is_deleted', '=', false)
->where('is_quote', '=', false)
->where('is_recurring', '=', false)
->get();
$data['quotes'] = Invoice::scope()
->with('user', 'client.contacts', 'invoice_status')
->withTrashed()
->where('is_deleted', '=', false)
->where('is_quote', '=', true)
->where('is_recurring', '=', false)
->get();
@ -140,6 +149,8 @@ class ImportExportController extends BaseController
if ($request->input(ENTITY_PAYMENT)) {
$data['payments'] = Payment::scope()
->withTrashed()
->where('is_deleted', '=', false)
->with('user', 'client.contacts', 'payment_type', 'invoice', 'account_gateway.gateway')
->get();
}

View File

@ -49,7 +49,7 @@ class PublicClientController extends BaseController
}
$invoice = $invitation->invoice;
$query = $this->activityRepo->findByClientId($invoice->client_id);
$query = $this->activityRepo->findByClientPublicId($invoice->client->public_id);
$query->where('activities.adjustment', '!=', 0);
return Datatable::query($query)

View File

@ -34,7 +34,7 @@ class Contact extends EntityModel
public function client()
{
return $this->belongsTo('App\Models\Client');
return $this->belongsTo('App\Models\Client')->withTrashed();
}
public function getPersonType()

View File

@ -115,6 +115,7 @@ class PaymentLibrariesSeeder extends Seeder
['name' => 'Mexican Peso', 'code' => 'MXN', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Egyptian Pound', 'code' => 'EGP', 'symbol' => '£', 'precision' => '2', 'thousand_separator' => ',', 'decimal_separator' => '.'],
['name' => 'Colombian Peso', 'code' => 'COP', 'symbol' => '$', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
['name' => 'West African Franc', 'code' => 'XOF', 'symbol' => 'CFA ', 'precision' => '2', 'thousand_separator' => '.', 'decimal_separator' => ','],
];
foreach ($currencies as $currency) {

View File

@ -10,16 +10,18 @@
</tr>
@foreach ($contacts as $contact)
<tr>
<td>{{ $contact->client->getDisplayName() }}</td>
@if ($multiUser)
<td>{{ $contact->user->getDisplayName() }}</td>
@endif
<td>{{ $contact->first_name }}</td>
<td>{{ $contact->last_name }}</td>
<td>{{ $contact->email }}</td>
<td>{{ $contact->phone }}</td>
</tr>
@if (!$contact->client->is_deleted)
<tr>
<td>{{ $contact->client->getDisplayName() }}</td>
@if ($multiUser)
<td>{{ $contact->user->getDisplayName() }}</td>
@endif
<td>{{ $contact->first_name }}</td>
<td>{{ $contact->last_name }}</td>
<td>{{ $contact->email }}</td>
<td>{{ $contact->phone }}</td>
</tr>
@endif
@endforeach
<tr><td></td></tr>

View File

@ -9,15 +9,17 @@
</tr>
@foreach ($credits as $credit)
<tr>
<td>{{ $credit->client->getDisplayName() }}</td>
@if ($multiUser)
<td>{{ $credit->user->getDisplayName() }}</td>
@endif
<td>{{ $credit->present()->amount }}</td>
<td>{{ $credit->present()->balance }}</td>
<td>{{ $credit->present()->credit_date }}</td>
</tr>
@if (!$credit->client->is_deleted)
<tr>
<td>{{ $credit->client->getDisplayName() }}</td>
@if ($multiUser)
<td>{{ $credit->user->getDisplayName() }}</td>
@endif
<td>{{ $credit->present()->amount }}</td>
<td>{{ $credit->present()->balance }}</td>
<td>{{ $credit->present()->credit_date }}</td>
</tr>
@endif
@endforeach
<tr><td></td></tr>