diff --git a/requirements.txt b/requirements.txt index 9903a40..fe668e5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -57,7 +57,7 @@ Operations to be functional - Enter notes when communicating with Customer X - Accept pre-payments X - Record Customer Move-Out from Unit - ? - Record utilization of Security Deposit + X - Record utilization of Security Deposit X - Record issuing of a refund - Record Deposit into Petty Cash - Record Payment from Petty Cash to expenses diff --git a/scripts/sitelink2pmgr.pl b/scripts/sitelink2pmgr.pl index f81c5ba..75edd3f 100644 --- a/scripts/sitelink2pmgr.pl +++ b/scripts/sitelink2pmgr.pl @@ -1466,6 +1466,25 @@ addRow('double_entries', { }); +###################################################################### +## Debug ... work from scratch +if (defined $work_from_scratch) { + # delete $newdb{'tables'}{'contacts'}{'rows'}; + # delete $newdb{'tables'}{'contacts_methods'}{'rows'}; + # delete $newdb{'tables'}{'contacts_addresses'}{'rows'}; + # delete $newdb{'tables'}{'contacts_emails'}{'rows'}; + # delete $newdb{'tables'}{'contacts_phones'}{'rows'}; + delete $newdb{'tables'}{'contacts_customers'}{'rows'}; + delete $newdb{'tables'}{'customers'}{'rows'}; + delete $newdb{'tables'}{'double_entries'}{'rows'}; + delete $newdb{'tables'}{'leases'}{'rows'}; + delete $newdb{'tables'}{'ledger_entries'}{'rows'}; + delete $newdb{'tables'}{'statement_entries'}{'rows'}; + delete $newdb{'tables'}{'tenders'}{'rows'}; + delete $newdb{'tables'}{'transactions'}{'rows'}; +} + + ###################################################################### ## Build the Database diff --git a/site/controllers/accounts_controller.php b/site/controllers/accounts_controller.php index c43dfa3..e7d9c0f 100644 --- a/site/controllers/accounts_controller.php +++ b/site/controllers/accounts_controller.php @@ -138,17 +138,18 @@ class AccountsController extends AppController { $this->redirect(array('action'=>'index')); } - $payment_accounts = $this->Account->collectableAccounts(); - //$payment_accounts[$this->Account->nameToID('Closing')] = 'Closing'; - //$payment_accounts[$this->Account->nameToID('Equity')] = 'Equity'; - $default_accounts = array_diff_key($this->Account->receiptAccounts(), - array($this->Account->concessionAccountID() => 1)); - $this->set(compact('payment_accounts', 'default_accounts')); - $this->Account->recursive = -1; $account = $this->Account->read(null, $id); $account = $account['Account']; + $payment_accounts = $this->Account->collectableAccounts(); + //$payment_accounts[$this->Account->nameToID('Closing')] = 'Closing'; + //$payment_accounts[$this->Account->nameToID('Equity')] = 'Equity'; + //$payment_accounts[$id] = 'Reversals'; + $default_accounts = array_diff_key($this->Account->receiptAccounts(), + array($this->Account->concessionAccountID() => 1)); + $this->set(compact('payment_accounts', 'default_accounts')); + $title = ($account['name'] . ': Collected Report'); $this->set(compact('account', 'title')); } diff --git a/site/models/statement_entry.php b/site/models/statement_entry.php index 6de75b4..c8bad09 100644 --- a/site/models/statement_entry.php +++ b/site/models/statement_entry.php @@ -186,7 +186,7 @@ class StatementEntry extends AppModel { * */ function reverse($id, $balance = false, $stamp = null) { - $this->prEnter(compact('id', 'stamp')); + $this->prEnter(compact('id', 'balance', 'stamp')); $ret = array(); diff --git a/site/models/transaction.php b/site/models/transaction.php index ca2f0d0..4e4de98 100644 --- a/site/models/transaction.php +++ b/site/models/transaction.php @@ -123,7 +123,7 @@ class Transaction extends AppModel { $this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id')); if (count($data['Entry']) != 1) - die("INTERNAL ERROR: Should be one Entry for addWaiver"); + INTERNAL_ERROR("Should be one Entry for addWaiver"); // Just make sure the disbursement(s) are marked as waivers // and that they go to cover the specific charge. @@ -150,7 +150,7 @@ class Transaction extends AppModel { $this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id')); if (count($data['Entry']) != 1) - die("INTERNAL ERROR: Should be one Entry for addReversal"); + INTERNAL_ERROR("Should be one Entry for addReversal"); // Just make sure the disbursement(s) are marked as reversals // and that they go to cover the specific charge. diff --git a/site/views/accounts/collected.ctp b/site/views/accounts/collected.ctp index c70768d..ce5d48a 100644 --- a/site/views/accounts/collected.ctp +++ b/site/views/accounts/collected.ctp @@ -164,7 +164,7 @@ echo $this->element('statement_entries', array //'grid_setup' => array('hiddengrid' => true), //'caption' => '', 'caption' => 'Collected ' . Inflector::pluralize($account['name']), - 'filter' => array('StatementEntry.type' => 'DISBURSEMENT', + 'filter' => array(//'StatementEntry.type' => 'DISBURSEMENT', 'ChargeEntry.account_id' => $account['id']), 'exclude' => array('Account', 'Charge', 'Type'), ),