mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Enabled manually setting invoices and quotes as sent
This commit is contained in:
parent
65f58c64d6
commit
919f13b0d4
@ -259,6 +259,7 @@ class AccountController extends \BaseController {
|
||||
|
||||
$client->name = 'Sample Client';
|
||||
|
||||
$invoice->invoice_number = Auth::user()->account->getNextInvoiceNumber();
|
||||
$invoice->invoice_date = date_create()->format('Y-m-d');
|
||||
$invoice->account = Auth::user()->account;
|
||||
$invoice->amount = $invoice->balance = 100;
|
||||
|
@ -271,7 +271,7 @@ class InvoiceController extends \BaseController {
|
||||
$action = Input::get('action');
|
||||
$entityType = Input::get('entityType');
|
||||
|
||||
if ($action == 'archive' || $action == 'delete')
|
||||
if ($action == 'archive' || $action == 'delete' || $action == 'mark')
|
||||
{
|
||||
return InvoiceController::bulk($entityType);
|
||||
}
|
||||
@ -413,12 +413,14 @@ class InvoiceController extends \BaseController {
|
||||
public function bulk($entityType = ENTITY_INVOICE)
|
||||
{
|
||||
$action = Input::get('action');
|
||||
$statusId = Input::get('statusId');
|
||||
$ids = Input::get('id') ? Input::get('id') : Input::get('ids');
|
||||
$count = $this->invoiceRepo->bulk($ids, $action);
|
||||
$count = $this->invoiceRepo->bulk($ids, $action, $statusId);
|
||||
|
||||
if ($count > 0)
|
||||
{
|
||||
$message = Utils::pluralize("{$action}d_{$entityType}", $count);
|
||||
$key = $action == 'mark' ? "updated_{$entityType}" : "{$action}d_{$entityType}";
|
||||
$message = Utils::pluralize($key, $count);
|
||||
Session::flash('message', $message);
|
||||
}
|
||||
|
||||
|
@ -433,5 +433,6 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
);
|
||||
|
@ -441,6 +441,8 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
|
||||
|
||||
);
|
@ -431,5 +431,7 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
|
||||
);
|
||||
|
@ -434,5 +434,7 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
|
||||
);
|
||||
|
@ -433,6 +433,8 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
@ -441,6 +441,8 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
@ -441,6 +441,8 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
|
||||
|
||||
);
|
@ -434,6 +434,8 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
@ -422,6 +422,8 @@ return array(
|
||||
'share_invoice_counter' => 'Share invoice counter',
|
||||
'invoice_issued_to' => 'Invoice issued to',
|
||||
'invalid_counter' => 'To prevent a possible conflict please set either an invoice or quote number prefix',
|
||||
'mark_sent' => 'Mark sent',
|
||||
|
||||
|
||||
|
||||
);
|
||||
|
@ -20,7 +20,7 @@ class InvoiceRepository
|
||||
->where('contacts.deleted_at', '=', null)
|
||||
->where('invoices.is_recurring', '=', false)
|
||||
->where('contacts.is_primary', '=', true)
|
||||
->select('clients.public_id as client_public_id', 'invoice_number', 'clients.name as client_name', 'invoices.public_id', 'amount', 'invoices.balance', 'invoice_date', 'due_date', 'invoice_statuses.name as invoice_status_name', 'clients.currency_id', 'contacts.first_name', 'contacts.last_name', 'contacts.email', 'quote_id', 'quote_invoice_id');
|
||||
->select('clients.public_id as client_public_id', 'invoice_number', 'invoice_status_id', 'clients.name as client_name', 'invoices.public_id', 'amount', 'invoices.balance', 'invoice_date', 'due_date', 'invoice_statuses.name as invoice_status_name', 'clients.currency_id', 'contacts.first_name', 'contacts.last_name', 'contacts.email', 'quote_id', 'quote_invoice_id');
|
||||
|
||||
if (!\Session::get('show_trash:invoice'))
|
||||
{
|
||||
@ -121,11 +121,19 @@ class InvoiceRepository
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="' . \URL::to("{$entityType}s/".$model->public_id.'/edit') . '">'.trans("texts.edit_{$entityType}").'</a></li>
|
||||
<li><a href="' . \URL::to("{$entityType}s/".$model->public_id.'/clone') . '">'.trans("texts.clone_{$entityType}").'</a></li>
|
||||
<li class="divider"></li><li>';
|
||||
<li class="divider"></li>';
|
||||
|
||||
if ($model->invoice_status_id < INVOICE_STATUS_SENT)
|
||||
{
|
||||
$str .= '<li><a href="javascript:markEntity(' . $model->public_id . ', ' . INVOICE_STATUS_SENT . ')">'.trans("texts.mark_sent").'</a></li>';
|
||||
}
|
||||
|
||||
if ($entityType == ENTITY_INVOICE)
|
||||
{
|
||||
$str .= '<a href="' . \URL::to('payments/create/' . $model->client_public_id . '/' . $model->public_id ) . '">'.trans('texts.enter_payment').'</a></li>';
|
||||
if ($model->invoice_status_id < INVOICE_STATUS_PAID)
|
||||
{
|
||||
$str .= '<li><a href="' . \URL::to('payments/create/' . $model->client_public_id . '/' . $model->public_id ) . '">'.trans('texts.enter_payment').'</a></li>';
|
||||
}
|
||||
|
||||
if ($model->quote_id)
|
||||
{
|
||||
@ -431,7 +439,7 @@ class InvoiceRepository
|
||||
}
|
||||
|
||||
|
||||
public function bulk($ids, $action)
|
||||
public function bulk($ids, $action, $statusId = false)
|
||||
{
|
||||
if (!$ids)
|
||||
{
|
||||
@ -441,6 +449,13 @@ class InvoiceRepository
|
||||
$invoices = Invoice::withTrashed()->scope($ids)->get();
|
||||
|
||||
foreach ($invoices as $invoice)
|
||||
{
|
||||
if ($action == 'mark')
|
||||
{
|
||||
$invoice->invoice_status_id = $statusId;
|
||||
$invoice->save();
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($action == 'delete')
|
||||
{
|
||||
@ -449,6 +464,7 @@ class InvoiceRepository
|
||||
}
|
||||
|
||||
$invoice->delete();
|
||||
}
|
||||
}
|
||||
|
||||
return count($invoices);
|
||||
|
@ -8,8 +8,15 @@
|
||||
<style type="text/css">
|
||||
|
||||
body {
|
||||
/* background-color: #F6F6F6; */
|
||||
background-color: #EEEEEE;
|
||||
padding-top: 114px;
|
||||
}
|
||||
|
||||
/* Fix for header covering stuff when the screen is narrower */
|
||||
@media screen and (min-width: 1200px) {
|
||||
body {
|
||||
padding-top: 50px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
@ -35,8 +42,6 @@
|
||||
|
||||
@section('body')
|
||||
|
||||
<p> </p>
|
||||
<p> </p>
|
||||
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
|
||||
<div class="container">
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
{{ Former::open($entityType . 's/bulk')->addClass('listForm') }}
|
||||
<div style="display:none">
|
||||
{{ Former::text('action') }}
|
||||
{{ Former::text('statusId') }}
|
||||
{{ Former::text('id') }}
|
||||
</div>
|
||||
|
||||
@ -67,6 +68,12 @@
|
||||
submitForm('archive');
|
||||
}
|
||||
|
||||
function markEntity(id, statusId) {
|
||||
$('#id').val(id);
|
||||
$('#statusId').val(statusId);
|
||||
submitForm('mark');
|
||||
}
|
||||
|
||||
function setTrashVisible() {
|
||||
var checked = $('#trashed').is(':checked');
|
||||
window.location = '{{ URL::to('view_archive/' . $entityType) }}' + (checked ? '/true' : '/false');
|
||||
|
@ -93,7 +93,7 @@
|
||||
paid: d3.sum(d, function(g) {
|
||||
return g.invoice && g.invoice.invoice_status_id == 5 ? (g.qty * g.cost) : 0;
|
||||
}),
|
||||
age: d3.median(d, function(g) {
|
||||
age: d3.mean(d, function(g) {
|
||||
return calculateInvoiceAge(g.invoice) || null;
|
||||
}),
|
||||
}})
|
||||
@ -168,8 +168,8 @@
|
||||
.padding(12);
|
||||
|
||||
var svg = d3.select(".svg-div").append("svg")
|
||||
.attr("width", "100%")
|
||||
.attr("height", "1140px")
|
||||
.attr("width", "1142px")
|
||||
.attr("height", "1142px")
|
||||
.attr("class", "bubble");
|
||||
|
||||
svg.append("rect")
|
||||
|
Loading…
Reference in New Issue
Block a user