CakeAccounting/templates/DeJournalEntries/add.php

85 lines
2.9 KiB
PHP

<?php
/**
* @var \App\View\AppView $this
* @var \Cake\Datasource\EntityInterface $deJournalEntry
* @var \Cake\Collection\CollectionInterface|string[] $deJournals
* @var \Cake\Collection\CollectionInterface|string[] $users
*/
?>
<div class="row">
<aside class="column">
<div class="side-nav">
<h4 class="heading"><?= __('Actions') ?></h4>
<?= $this->Html->link(__('List De Journal Entries'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
</div>
</aside>
<div class="column column-80">
<div class="deJournalEntries form content">
<?= $this->Form->create($deJournalEntry) ?>
<legend><?= __('Add Journal Entry') ?></legend>
<?php
echo $this->Form->control('de_journal_id', ['options' => $deJournals]);
?>
<div class="row">
<div class="column">
<legend><?= __('Debit') ?></legend>
<?php
echo $this->Form->control('de_journal_items.0.account_number_debit', [
'type' => 'select',
'options' => $accounts,
'label' => 'Account',
'empty' => true,
'required' => true,
]);
echo $this->Form->control('de_journal_items.0.external_account_number_debit', [
'type' => 'select',
'options' => $externalAccounts ?? [],
'label' => 'External Account',
'empty' => true,
'required' => false,
]);
?>
</div>
<div class="column">
<legend><?= __('Amount') ?></legend>
<?php
echo $this->Form->control('de_journal_items.0.amount', [
'label' => false,
]);
?>
</div>
<div class="column">
<legend><?= __('Credit') ?></legend>
<?php
echo $this->Form->control('de_journal_items.0.account_number_credit', [
'type' => 'select',
'options' => $accounts,
'label' => 'Account',
'empty' => true,
'required' => true,
]);
echo $this->Form->control('de_journal_items.0.external_account_number_credit', [
'type' => 'select',
'options' => $externalAccounts ?? [],
'label' => 'External Account',
'empty' => true,
'required' => false,
]);
?>
</div>
</div>
<div class="row">
<div class="column">
<?php
echo $this->Form->control('notes', ['type' => 'textarea', 'rows' => 2]);
?>
</div>
</div>
<?= $this->Form->button(__('Submit')) ?>
<?= $this->Form->end() ?>
</div>
</div>
</div>