Added invoice date

Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole
2016-09-10 18:36:52 +02:00
parent 29a930dae5
commit 629baf9de5
12 changed files with 44 additions and 2 deletions

View File

@@ -175,6 +175,7 @@ class PreferencesController extends Controller
'process_date' => isset($setOptions['process_date']),
'due_date' => isset($setOptions['due_date']),
'payment_date' => isset($setOptions['payment_date']),
'invoice_date' => isset($setOptions['invoice_date']),
'internal_reference' => isset($setOptions['internal_reference']),
'notes' => isset($setOptions['notes']),
'attachments' => isset($setOptions['attachments']),

View File

@@ -177,6 +177,7 @@ class TransactionController extends Controller
// new custom fields:
'due_date' => TransactionJournal::dateAsString($journal, 'due_date'),
'payment_date' => TransactionJournal::dateAsString($journal, 'payment_date'),
'invoice_date' => TransactionJournal::dateAsString($journal, 'invoice_date'),
'interal_reference' => $journal->getMeta('internal_reference'),
'notes' => $journal->getMeta('notes'),
];

View File

@@ -64,6 +64,7 @@ class JournalFormRequest extends Request
// new custom fields here:
'due_date' => $this->get('due_date') ? new Carbon($this->get('due_date')) : null,
'payment_date' => $this->get('payment_date') ? new Carbon($this->get('payment_date')) : null,
'invoice_date' => $this->get('invoice_date') ? new Carbon($this->get('invoice_date')) : null,
'internal_reference' => $this->get('internal_reference'),
'notes' => $this->get('notes'),

View File

@@ -237,6 +237,16 @@ class TransactionJournal extends TransactionJournalSupport
return $value;
}
/**
* @param string $name
*
* @return bool
*/
public function hasMeta(string $name): bool
{
return !is_null($this->getMeta($name));
}
/**
* @return bool
*/

View File

@@ -42,7 +42,7 @@ class JournalRepository implements JournalRepositoryInterface
private $user;
/** @var array */
private $validMetaFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'internal_reference', 'notes'];
private $validMetaFields = ['interest_date', 'book_date', 'process_date', 'due_date', 'payment_date', 'invoice_date', 'internal_reference', 'notes'];
/**
* JournalRepository constructor.