mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Hide draft invoices from the client portal
This commit is contained in:
parent
8d8156f580
commit
a0481310a3
@ -73,12 +73,16 @@ class CheckData extends Command {
|
||||
$this->logMessage('Done');
|
||||
$errorEmail = env('ERROR_EMAIL');
|
||||
|
||||
if ( ! $this->isValid && $errorEmail) {
|
||||
if ( ! $this->isValid) {
|
||||
if ($errorEmail) {
|
||||
Mail::raw($this->log, function ($message) use ($errorEmail) {
|
||||
$message->to($errorEmail)
|
||||
->from(CONTACT_EMAIL)
|
||||
->subject('Check-Data');
|
||||
});
|
||||
} else {
|
||||
$this->info($this->log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -209,6 +213,7 @@ class CheckData extends Command {
|
||||
->where('accounts.id', '!=', 20432)
|
||||
->where('clients.is_deleted', '=', 0)
|
||||
->where('invoices.is_deleted', '=', 0)
|
||||
->where('invoices.is_public', '=', 1)
|
||||
->where('invoices.invoice_type_id', '=', INVOICE_TYPE_STANDARD)
|
||||
->where('invoices.is_recurring', '=', 0)
|
||||
->havingRaw('abs(clients.balance - sum(invoices.balance)) > .01 and clients.balance != 999999999.9999');
|
||||
|
@ -119,6 +119,7 @@ class InvoiceTransformer extends EntityTransformer
|
||||
'custom_text_value1' => $invoice->custom_text_value1,
|
||||
'custom_text_value2' => $invoice->custom_text_value2,
|
||||
'is_quote' => (bool) $invoice->isType(INVOICE_TYPE_QUOTE), // Temp to support mobile app
|
||||
'is_public' => (bool) $invoice->is_public,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -1,26 +0,0 @@
|
||||
<?php namespace App\Ninja\Transformers;
|
||||
|
||||
use App\Models\Invoice;
|
||||
|
||||
class QuoteTransformer extends EntityTransformer
|
||||
{
|
||||
protected $defaultIncludes = [
|
||||
'invoice_items',
|
||||
];
|
||||
|
||||
public function includeInvoiceItems($invoice)
|
||||
{
|
||||
$transformer = new InvoiceItemTransformer($this->account, $this->serializer);
|
||||
return $this->includeCollection($invoice->invoice_items, $transformer, 'invoice_items');
|
||||
}
|
||||
|
||||
public function transform(Invoice $invoice)
|
||||
{
|
||||
return [
|
||||
'id' => (int) $invoice->public_id,
|
||||
'quote_number' => $invoice->invoice_number,
|
||||
'amount' => (float) $invoice->amount,
|
||||
'quote_terms' => $invoice->terms,
|
||||
];
|
||||
}
|
||||
}
|
@ -554,7 +554,7 @@
|
||||
<!-- do nothing -->
|
||||
@else
|
||||
@if (!$invoice->is_deleted)
|
||||
@if ($invoice->is_public)
|
||||
@if ($invoice->isSent())
|
||||
{!! Button::success(trans("texts.save_{$entityType}"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))->appendIcon(Icon::create('floppy-disk')) !!}
|
||||
@else
|
||||
{!! Button::normal(trans("texts.save_draft"))->withAttributes(array('id' => 'saveButton', 'onclick' => 'onSaveClick()'))->appendIcon(Icon::create('floppy-disk')) !!}
|
||||
|
Loading…
x
Reference in New Issue
Block a user