Compare commits

...

26 Commits

Author SHA1 Message Date
abijah
cbdce4f166 Added the gridview parameter, since we're not doing anything too complicated with grids. Updated the jqGrid css, some of which is just not longer needed, and some of which is broken by the move to jqGrid 3.5
git-svn-id: file:///svn-source/pmgr/branches/jqgrid_3.5@528 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-11 07:08:54 +00:00
abijah
e9b9bdc420 Preliminary move to jqGrid 3.5.1. It has proven troublesome to change over, although really, I've only found one compatibility break so far. The real problem has been the elimination of the jqGrid loader code. We now have to build the jqGrid package through a selection form on the jqGrid download page, and the errors made it difficult to determine that the package configuration was the problem (such as destroying the entire page content). It's working alright at the moment.
git-svn-id: file:///svn-source/pmgr/branches/jqgrid_3.5@527 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-11 04:43:33 +00:00
abijah
704412727d Branch to roll up to the 3.5 version of jqGrid
git-svn-id: file:///svn-source/pmgr/branches/jqgrid_3.5@526 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-11 04:11:45 +00:00
abijah
72af3f3247 Changed invoice generation to match the receipt changes in r521 (no more debug, transition to the lease after entry, etc).
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@525 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-11 01:08:39 +00:00
abijah
f0693bdc05 Whitespace only change
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@524 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-11 01:07:20 +00:00
abijah
15f885ab8a Fixed problem when effective_date is an empty string, as opposed to completely missing.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@523 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-11 01:07:01 +00:00
abijah
b1a7f41934 Renamed the menu items for invoice and receipt creation.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@522 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-11 01:06:28 +00:00
abijah
4f11e27a76 Removed the debug portions of receipt entry, and added a checkbox to allow the user to either keep entering receipts, or have the page automatically transition to the customer page.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@521 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 23:57:20 +00:00
abijah
f8aef6e794 Missed adding this file on the last checkin (r519)
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@520 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 22:24:23 +00:00
abijah
e100c9a88f Added the ability to edit a tender. I've locked this down to just editing the data1-4 fields at the moment, since there are accounting ramifications if we were to change the tender type.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@519 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 22:23:47 +00:00
abijah
1ce71a3936 Added automatic grid reload, since the default grid load is inconsistent with the displayed settings. The solution here sucks, but at least it avoids the inconsistency.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@518 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 22:22:56 +00:00
abijah
19f8c18ce9 Removed the two dangerous links from the Debug menu, as we're preparing to enter new data and don't want to zap it.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@517 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 19:20:29 +00:00
abijah
eb28852b87 Added the ability to accept payments (or a write-off) on a closed lease, if there is a balance owing. Added the ability to do write off bad debt at the customer level, since some charges may not be on a lease, like the NSF fee.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@516 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 19:01:20 +00:00
abijah
98f3dd7688 Added the close date to the leases grid, to make it clear which customer leases are still open. Perhaps we should exclude the field by default, and just add it into the customer view page.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@515 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 19:00:02 +00:00
abijah
c33a823e50 Added Bad Debt as one of the accounts for the collected report
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@514 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 18:58:41 +00:00
abijah
1f97e8db35 Added confirmation to the NSF functionality, as well as a timestamp field instead of forcing time=now.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@513 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 05:49:43 +00:00
abijah
76df8c924f Changed the Deposits menu item to be at the top level, instead of underneath the Accounts menu.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@512 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 05:48:49 +00:00
abijah
598ce5784b Modified NSF to use positive amounts for the ledger entries (swapping credit/debit, of course). The statement entries remain using negative amounts, as they are negative disbursements.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@511 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 04:46:54 +00:00
abijah
cdb7d4b15c Preventing moved-out leases in sitelink data from being closed, since the security deposit hasn't been released. Added a temporary function to release the deposit, so I can manually release and close the few leases needed.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@510 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 01:27:12 +00:00
abijah
07a2be05f7 Added customer since/until fields. Changed the ledger entry grid on the customers page into a receipts grid, and added it to the lease page as well, even though it is for the customer in general, and may include receipts for leases other than the one being viewed. I may put more effort into this later, but for now it solves the problem of getting the receipt tenders visible when viewing the lease.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@509 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-10 00:56:41 +00:00
abijah
fd1a1f43d4 Added transaction model writeOff function, and a new statement_entry WRITEOFF type. Not a big deal, but it makes presentation a bit more straightforward.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@508 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-09 15:11:51 +00:00
abijah
2e2147b238 Added mechanism to automatically assess late fees. This uses hardcoded assumptions, since our late fee table has not yet been implemented.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@507 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-08 16:37:12 +00:00
abijah
a0c00f1a35 Implemented a single function to assess rent across all leases.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@506 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-08 16:09:49 +00:00
abijah
868e23b982 Implemented mechanism for automatic assessment of monthly rent
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@505 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-08 15:44:52 +00:00
abijah
e6b0313523 Add refund capability to the customer, and in fact only the customer, as we've revoked refund capability from the lease. This is to help work through various issues surrounding use of security deposits and general refund functionality. For example, a customer who has overpayed (customer surplus, with zero balance on lease), and then moves out. Where that security deposit surplus goes has been a bit of a thorn. Hopefully, this resolves the issue, although there may still be some bugs to flush out.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@504 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-08 04:27:02 +00:00
abijah
654eb0960e Some of the finer detail work, mostly around pre-populating the move-in invoice with useful and correct data, and allowing the lease rent and deposit to be set at movein.
git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@503 97e9348a-65ac-dc4b-aefc-98561f571b83
2009-08-07 22:52:01 +00:00
397 changed files with 1221 additions and 25564 deletions

View File

@@ -1077,6 +1077,7 @@ CREATE TABLE `pmgr_statement_entries` (
`type` ENUM('CHARGE', -- Invoiced Charge to Customer
'DISBURSEMENT', -- Disbursement of Receipt Funds
'REVERSAL', -- Reversal of a charge
'WRITEOFF', -- Write-off bad debt
'VOUCHER', -- Agreement to pay
'PAYMENT', -- Payment of a Voucher
'REFUND', -- Payment due to refund
@@ -1154,6 +1155,12 @@ CREATE TABLE `pmgr_tender_types` (
`data3_name` VARCHAR(80) DEFAULT NULL,
`data4_name` VARCHAR(80) DEFAULT NULL,
-- The field from pmgr_tenders that is used for helping
-- to name the tender. For example, a Check tender type
-- might specify data1 as the field, so that tenders
-- would be named "Check #0000"
`naming_field` VARCHAR(80) DEFAULT 'id',
-- When we accept legal tender of this form, where does
-- it go? Each type of legal tender can specify an
-- account, either distinct or non-distinct from others

View File

@@ -5,6 +5,7 @@ use Data::Dumper;
use File::Copy;
my $closing_one_transaction = 0;
my $work_from_scratch = 0;
# Internally adjust all numbers coming from the database to
# be in inches. Not necessary to go to this detail, but the
@@ -543,16 +544,19 @@ foreach my $tender_name ('Cash', 'Check', 'Money Order', 'ACH',
) {
my ($tillable, $fields) = (0, 0);
my ($name1, $name2, $name3, $name4);
my ($name_field) = ('id');
$tillable = 1
if ($tender_name =~ /^Cash|Check|Money Order$/);
($name1) = ('Check Number')
($name1, $name_field) = ('Check Number', 'data1')
if ($tender_name eq 'Check');
($name1) = ('Money Order Number')
($name1, $name_field) = ('Money Order Number', 'data1')
if ($tender_name eq 'Money Order');
# REVISIT <AP>: 20090810
# Make data3 be the confirmation number?
($name1, $name2) = ('Routing Number', 'Account Number')
if ($tender_name eq 'ACH');
@@ -570,6 +574,7 @@ foreach my $tender_name ('Cash', 'Check', 'Money Order', 'ACH',
'data2_name' => $name2,
'data3_name' => $name3,
'data4_name' => $name4,
'naming_field' => $name_field,
});
$newdb{'lookup'}{'tender_type'}{$tender_name}
@@ -961,7 +966,7 @@ foreach $row (@{query($sdbh, $query)}) {
'lease_date' => datefmt($row->{'DateIn'}),
'movein_date' => datefmt($row->{'DateIn'}),
'moveout_date' => datefmt($row->{'DateOut'}),
'close_date' => datefmt($row->{'DateClosed'}),
#'close_date' => datefmt($row->{'DateClosed'}),
'rent' => $row->{'Rent'},
#'comment' => "LedgerID: $row->{'LedgerID'}",
});
@@ -1205,8 +1210,6 @@ foreach $row (@{query($sdbh, $query)}) {
= $newdb{'lookup'}{'account'}{'A/R'}{'ledger_id'};
if ($SITELINK_ACCOUNT_TYPE{$row->{'PaymentType'}} eq 'Check') {
$newdb{'lookup'}{'receipt'}{$row->{'ReceiptNum'}}{$row->{'PaymentType'}}{'name'}
= 'Check #' . $row->{'CheckNum'};
$newdb{'lookup'}{'receipt'}{$row->{'ReceiptNum'}}{$row->{'PaymentType'}}{'data1'}
= $row->{'CheckNum'};
}
@@ -1468,7 +1471,7 @@ addRow('double_entries', {
######################################################################
## Debug ... work from scratch
if (defined $work_from_scratch) {
if ($work_from_scratch) {
# delete $newdb{'tables'}{'contacts'}{'rows'};
# delete $newdb{'tables'}{'contacts_methods'}{'rows'};
# delete $newdb{'tables'}{'contacts_addresses'}{'rows'};
@@ -1482,6 +1485,11 @@ if (defined $work_from_scratch) {
delete $newdb{'tables'}{'statement_entries'}{'rows'};
delete $newdb{'tables'}{'tenders'}{'rows'};
delete $newdb{'tables'}{'transactions'}{'rows'};
foreach (@{$newdb{'tables'}{'units'}{'rows'}}) {
$_->{'status'} = 'VACANT'
if defined $_ && ($_->{'status'} =~ /^(OCCUPIED)$/ || $_->{'name'} =~ /^Y/);
}
}
@@ -1570,3 +1578,26 @@ $query = "UPDATE pmgr_transactions T, pmgr_ledger_entries E
WHERE E.transaction_id = T.id AND E.account_id = T.account_id";
query($db_handle, $query);
######################################################################
## Tender Names
print("Set Tender Names...\n");
$query = "UPDATE pmgr_tenders T, pmgr_tender_types TT
SET T.`name` = CONCAT(T.`name`, ' #',
IF(T.tender_type_id IN (2,3), T.data1, T.id))
WHERE T.tender_type_id IS NULL OR TT.id = T.tender_type_id";
query($db_handle, $query);
######################################################################
## Invoice date fixes
# print("Fix Invoice Dates...\n");
# $query = "UPDATE pmgr_transactions T, pmgr_statement_entries E
# SET T.`stamp` =
# WHERE E.transaction_id = T.id AND E.account_id = T.account_id";
# query($db_handle, $query);

View File

@@ -46,13 +46,14 @@ class AppController extends Controller {
array('name' => 'Leases', 'url' => array('controller' => 'leases', 'action' => 'index')),
array('name' => 'Customers', 'url' => array('controller' => 'customers', 'action' => 'index')),
array('name' => 'Accounts', 'url' => array('controller' => 'accounts', 'action' => 'index')),
array('name' => 'Deposits', 'url' => array('controller' => 'transactions', 'action' => 'deposit')),
array('name' => 'Debug', 'header' => true),
array('name' => 'Un-Nuke', 'url' => '#', 'htmlAttributes' =>
array('onclick' => '$(".pr-section").show(); return false;')),
array('name' => 'Contacts', 'url' => array('controller' => 'contacts', 'action' => 'index')),
array('name' => 'Ledgers', 'url' => array('controller' => 'ledgers', 'action' => 'index')),
array('name' => 'New Ledgers', 'url' => array('controller' => 'accounts', 'action' => 'newledger')),
array('name' => 'RESET DATA', 'url' => array('controller' => 'accounts', 'action' => 'reset_data')),
//array('name' => 'New Ledgers', 'url' => array('controller' => 'accounts', 'action' => 'newledger')),
//array('name' => 'RESET DATA', 'url' => array('controller' => 'accounts', 'action' => 'reset_data')),
);
}

View File

@@ -12,9 +12,6 @@ class AccountsController extends AppController {
array('name' => 'Equity', 'url' => array('controller' => 'accounts', 'action' => 'equity')),
array('name' => 'Income', 'url' => array('controller' => 'accounts', 'action' => 'income')),
array('name' => 'Expense', 'url' => array('controller' => 'accounts', 'action' => 'expense')),
array('name' => 'Deposits', 'header' => true),
array('name' => 'Prior Deposits', 'url' => array('controller' => 'transactions', 'action' => 'deposit')),
array('name' => 'New Deposit', 'url' => array('controller' => 'tenders', 'action' => 'deposit')),
);

View File

@@ -202,7 +202,19 @@ class CustomersController extends AppController {
));
//pr($customer);
// Determine how long this customer has been with us.
$leaseinfo = $this->Customer->find
('first', array
('link' => array('Lease' => array('fields' => array())),
'fields' => array('MIN(Lease.movein_date) AS since',
'IF(Customer.current_lease_count = 0, MAX(Lease.moveout_date), NULL) AS until'),
'conditions' => array('Customer.id' => $id),
'group' => 'Customer.id',
));
$this->set($leaseinfo[0]);
// Figure out the outstanding balances for this customer
//$this->set('stats', $this->Customer->stats($id));
$outstanding_balance = $this->Customer->balance($id);
$outstanding_deposit = $this->Customer->securityDepositBalance($id);
@@ -237,12 +249,17 @@ class CustomersController extends AppController {
/* $id)); */
/* } */
if ($show_payment) {
if ($show_payment || $outstanding_balance > 0)
$this->sidemenu_links[] =
array('name' => 'Payment',
array('name' => 'New Receipt',
'url' => array('action' => 'receipt',
$id));
}
if (!$show_moveout && $outstanding_balance > 0)
$this->sidemenu_links[] =
array('name' => 'Write-Off',
'url' => array('action' => 'bad_debt',
$id));
if ($outstanding_balance < 0)
$this->sidemenu_links[] =
@@ -395,18 +412,64 @@ class CustomersController extends AppController {
* - Refunds customer charges
*/
function refund() {
$entries = $this->Customer->StatementEntry->find
('all', array
function refund($id) {
$customer = $this->Customer->find
('first', array
('contain' => false,
'conditions' => array('StatementEntry.id' =>
//array(199,200,201)
61
'conditions' => array(array('Customer.id' => $id),
),
));
pr(compact('entries'));
if (empty($customer)) {
$this->redirect(array('action'=>'view', $id));
}
$this->Customer->refund($entries);
// Determine the customer balance, bailing if the customer owes money
$balance = $this->Customer->balance($id);
if ($balance >= 0) {
$this->redirect(array('action'=>'view', $id));
}
// The refund will be for a positive amount
$balance *= -1;
// Get the accounts capable of paying the refund
$refundAccounts = $this->Customer->StatementEntry->Account->refundAccounts();
$defaultAccount = current($refundAccounts);
$this->set(compact('refundAccounts', 'defaultAccount'));
// Prepare to render
$title = ($customer['Customer']['name'] . ': Refund');
$this->set(compact('title', 'customer', 'balance'));
$this->render('/transactions/refund');
}
/**************************************************************************
**************************************************************************
**************************************************************************
* action: bad_debt
* - Sets up the write-off entry page, so that the
* user can write off remaining charges of a customer.
*/
function bad_debt($id) {
$this->Customer->id = $id;
$customer = $this->Customer->find
('first', array
('contain' => false,
));
// Make sure we have a valid customer to write off
if (empty($customer))
$this->redirect(array('action' => 'index'));
// Get the customer balance
$balance = $this->Customer->balance($id);
// Prepare to render
$title = ($customer['Customer']['name'] . ': Write Off Bad Debt');
$this->set(compact('title', 'customer', 'balance'));
$this->render('/transactions/bad_debt');
}

View File

@@ -135,17 +135,22 @@ class LeasesController extends AppController {
// Handle the move in based on the data given
//pr(array('Move-in data', $this->data));
foreach (array('deposit', 'rent') AS $currency) {
$this->data['Lease'][$currency]
= str_replace('$', '', $this->data['Lease'][$currency]);
}
$lid = $this->Lease->moveIn($this->data['Lease']['customer_id'],
$this->data['Lease']['unit_id'],
null, null,
$this->data['Lease']['deposit'],
$this->data['Lease']['rent'],
$this->data['Lease']['movein_date'],
$this->data['Lease']['comment']
);
// Since this is a new lease, go to the invoice
// screen so we can start assessing charges.
$this->redirect(array('action'=>'invoice', $lid));
$this->redirect(array('action'=>'invoice', $lid, 'move-in'));
// For debugging, only if the redirect above have been
// commented out, otherwise this section isn't reached.
@@ -273,6 +278,7 @@ class LeasesController extends AppController {
$lease['Unit']['name'] . ': ' .
$lease['Customer']['name'] . ': Refund');
$this->set(compact('title', 'lease', 'balance'));
$this->render('/transactions/refund');
}
@@ -285,6 +291,7 @@ class LeasesController extends AppController {
*/
function bad_debt($id) {
$this->Lease->id = $id;
$lease = $this->Lease->find
('first', array
('contain' => array
@@ -292,20 +299,14 @@ class LeasesController extends AppController {
'Unit' => array('fields' => array('id', 'name')),
'Customer' => array('fields' => array('id', 'name')),
),
'conditions' => array(array('Lease.id' => $id),
// Make sure lease is not closed...
array('Lease.close_date' => null),
),
));
// Make sure we have a valid lease to write off
if (empty($lease))
$this->redirect(array('action' => 'view', $id));
// Get the lease balance, part of lease stats
$stats = $this->Lease->stats($id);
$balance = $stats['balance'];
// Get the lease balance
$balance = $this->Lease->balance($id);
// Prepare to render
$title = ('Lease #' . $lease['Lease']['number'] . ': ' .
@@ -323,9 +324,23 @@ class LeasesController extends AppController {
* - Closes a lease to any further action
*/
// REVISIT <AP>: 20090809
// While cleaning up the sitelink data, then delete reldep()
function reldep($id) {
$this->Lease->id = $id;
$stamp = $this->Lease->field('moveout_date');
$this->Lease->releaseSecurityDeposits($id, $stamp);
$this->redirect(array('action'=>'view', $id));
}
function close($id) {
// REVISIT <AP>: 20090708
// We should probably seek confirmation first...
if (!$this->Lease->closeable($id)) {
INTERNAL_ERROR("This lease is not ready to close");
$this->redirect(array('action'=>'view', $id));
}
$this->Lease->close($id);
$this->redirect(array('action'=>'view', $id));
}
@@ -362,13 +377,30 @@ class LeasesController extends AppController {
$A = new Account();
$charge_accounts = $A->invoiceAccounts();
$default_account = $A->rentAccountID();
$this->set(compact('charge_accounts', 'default_account'));
$rent_account = $A->rentAccountID();
$security_deposit_account = $A->securityDepositAccountID();
$this->set(compact('charge_accounts', 'default_account',
'rent_account', 'security_deposit_account'));
// REVISIT <AP> 20090705:
// Of course, the late charge should come from the late_schedule
$default_rent = $lease['Lease']['rent'];
$default_late = 10;
$this->set(compact('default_rent', 'default_late'));
$this->set(compact('default_late'));
if ($type === 'move-in') {
$movein = array();
$movein['time'] = strtotime($lease['Lease']['movein_date']);
$movein['effective_time'] = strtotime($lease['Lease']['movein_date']);
$movein_date = getdate($movein['effective_time']);
$movein['through_time'] = mktime(0, 0, 0, $movein_date['mon'] + 1, 0, $movein_date['year']);
$days_in_month = idate('d', $movein['through_time']);
$movein['prorated_days'] = $days_in_month - $movein_date['mday'] + 1;
$movein['prorated_rent'] = $lease['Lease']['rent'] * $movein['prorated_days'] / $days_in_month;
$movein['prorated'] = $movein['prorated_days'] != $days_in_month;
$movein['deposit'] = $lease['Lease']['deposit'];
$this->set(compact('movein'));
}
$title = ('Lease #' . $lease['Lease']['number'] . ': ' .
$lease['Unit']['name'] . ': ' .
@@ -377,6 +409,21 @@ class LeasesController extends AppController {
}
/**************************************************************************
**************************************************************************
**************************************************************************
* action: assess_rent/late
* - Assesses the new monthly rent/late charge, if need be
*/
function assess_rent($date = null) {
$this->Lease->assessMonthlyRentAll($date);
}
function assess_late($date = null) {
$this->Lease->assessMonthlyLateAll($date);
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -413,8 +460,11 @@ class LeasesController extends AppController {
$outstanding_balance = $this->Lease->balance($id);
$outstanding_deposit = $this->Lease->securityDepositBalance($id);
// Set up dynamic menu items
if (!isset($lease['Lease']['close_date'])) {
// Set up dynamic menu items. Normally, these will only be present
// on an open lease, but it's possible for a lease to be closed, and
// yet still have an outstanding balance. This can happen if someone
// were to reverse charges, or if a payment should come back NSF.
if (!isset($lease['Lease']['close_date']) || $outstanding_balance > 0) {
$this->sidemenu_links[] =
array('name' => 'Operations', 'header' => true);
@@ -423,24 +473,34 @@ class LeasesController extends AppController {
array('name' => 'Move-Out', 'url' => array('action' => 'move_out',
$id));
$this->sidemenu_links[] =
array('name' => 'Charges', 'url' => array('action' => 'invoice',
$id));
if (!isset($lease['Lease']['close_date']))
$this->sidemenu_links[] =
array('name' => 'New Invoice', 'url' => array('action' => 'invoice',
$id));
$this->sidemenu_links[] =
array('name' => 'Payments', 'url' => array('controller' => 'customers',
'action' => 'receipt',
$lease['Customer']['id']));
array('name' => 'New Receipt', 'url' => array('controller' => 'customers',
'action' => 'receipt',
$lease['Customer']['id']));
/* if ($outstanding_balance < 0) */
/* $this->sidemenu_links[] = */
/* array('name' => 'Transfer Credit to Customer', */
/* 'url' => array('action' => 'promote_surplus', $id)); */
// REVISIT <AP>:
// Not allowing refund to be issued from the lease, as
// in fact, we should never have a positive lease balance.
// I'll flag this at the moment, since we might get one
// when a charge is reimbursed; a bug that we'll either
// need to fix, or we'll have to revisit this assumption.
if ($outstanding_balance < 0)
$this->sidemenu_links[] =
array('name' => 'Issue Refund',
'url' => array('action' => 'refund', $id));
INTERNAL_ERROR("Should not have a customer lease credit.");
/* if ($outstanding_balance < 0) */
/* $this->sidemenu_links[] = */
/* array('name' => 'Issue Refund', */
/* 'url' => array('action' => 'refund', $id)); */
if (isset($lease['Lease']['moveout_date']) && $outstanding_balance > 0)
$this->sidemenu_links[] =

View File

@@ -115,15 +115,33 @@ class TendersController extends AppController {
*/
function nsf($id = null) {
if ($this->data) {
$result = $this->Tender->nsf
($this->data['Tender']['id'],
$this->data['Transaction']['stamp'],
$this->data['Transaction']['comment']);
$this->redirect(array('controller' => 'tenders',
'action' => 'view',
$this->data['Tender']['id']));
}
if (!$id) {
$this->Session->setFlash(__('Invalid Item.', true));
$this->redirect(array('action'=>'index'));
}
$this->Tender->nsf($id);
$this->redirect(array('action'=>'view', $id));
$this->Tender->id = $id;
$tender = $this->Tender->find
('first', array
('contain' => array('Customer', 'LedgerEntry' => array('Transaction')),
));
// Prepare to render.
$title = "Tender #{$tender['Tender']['id']} : {$tender['Tender']['name']} : NSF";
$this->set(compact('tender', 'title'));
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -138,22 +156,30 @@ class TendersController extends AppController {
}
// Get the Tender and related fields
$this->Tender->id = $id;
$tender = $this->Tender->find
('first', array
('contain' => array('TenderType', 'Customer', 'LedgerEntry' => array('Transaction')),
));
// Set up dynamic menu items
$this->sidemenu_links[] =
array('name' => 'Operations', 'header' => true);
// Watch out for the special "Closing" entries
if (!empty($tender['TenderType']['id']))
$this->sidemenu_links[] =
array('name' => 'Edit',
'url' => array('action' => 'edit',
$id));
if (!empty($tender['Tender']['deposit_transaction_id'])
&& empty($tender['Tender']['nsf_transaction_id'])
// Hard to tell what types of items can come back as NSF.
// For now, assume iff it is a named item, it can be NSF.
&& !empty($tender['TenderType']['data1_name'])
) {
// Set up dynamic menu items
$this->sidemenu_links[] =
array('name' => 'Operations', 'header' => true);
$this->sidemenu_links[] =
array('name' => 'NSF',
'url' => array('action' => 'nsf',
@@ -161,7 +187,76 @@ class TendersController extends AppController {
}
// Prepare to render.
$title = "Tender #{$tender['Tender']['id']}";
$title = "Tender #{$tender['Tender']['id']} : {$tender['Tender']['name']}";
$this->set(compact('tender', 'title'));
}
/**************************************************************************
**************************************************************************
**************************************************************************
* action: edit
* - Edit tender information
*/
function edit($id = null) {
if (isset($this->data)) {
// Check to see if the operation was cancelled.
if (isset($this->params['form']['cancel'])) {
if (empty($this->data['Tender']['id']))
$this->redirect(array('action'=>'index'));
$this->redirect(array('action'=>'view', $this->data['Tender']['id']));
}
// Make sure we have tender data
if (empty($this->data['Tender']) || empty($this->data['Tender']['id']))
$this->redirect(array('action'=>'index'));
// Figure out which tender type was chosen
// REVISIT <AP>: 20090810; Not ready to change tender type
// $tender_type_id = $this->data['Tender']['tender_type_id'];
$tender_type_id = $this->Tender->field('tender_type_id');
if (empty($tender_type_id))
$this->redirect(array('action'=>'view', $this->data['Tender']['id']));
// Get data fields from the selected tender type
$this->data['Tender'] += $this->data['type'][$tender_type_id];
unset($this->data['type']);
// Save the tender and all associated data
$this->Tender->create();
$this->Tender->id = $this->data['Tender']['id'];
if (!$this->Tender->save($this->data, false)) {
$this->Session->setFlash("TENDER SAVE FAILED", true);
pr("TENDER SAVE FAILED");
}
$this->redirect(array('action'=>'view', $this->Tender->id));
// For debugging, only if the redirects above have been
// commented out, otherwise this section isn't reached.
$this->render('/fake');
return;
}
if ($id) {
$this->data = $this->Tender->findById($id);
} else {
$this->redirect(array('action'=>'index'));
}
$tender_types = $this->Tender->TenderType->find
('list', array('order' => array('name')));
$this->set(compact('tender_types'));
$types = $this->Tender->TenderType->find('all', array('contain' => false));
$this->set(compact('types'));
// Prepare to render.
$title = ('Tender #' . $this->data['Tender']['id'] .
' : ' . $this->data['Tender']['name'] .
" : Edit");
$this->set(compact('title'));
}
}

View File

@@ -35,7 +35,13 @@ class TransactionsController extends AppController {
function all() { $this->gridView('All Transactions', 'all'); }
function invoice() { $this->gridView('Invoices'); }
function receipt() { $this->gridView('Receipts'); }
function deposit() { $this->gridView('Deposits'); }
function deposit() {
$this->sidemenu_links = array
(array('name' => 'Operations', 'header' => true),
array('name' => 'New Deposit', 'url' => array('controller' => 'tenders',
'action' => 'deposit')));
$this->gridView('Deposits');
}
/**************************************************************************
@@ -275,9 +281,6 @@ class TransactionsController extends AppController {
}
$data = $this->data;
$data['Entry'][0]['account_id'] =
$this->Transaction->Account->badDebtAccountID();
if (empty($data['Customer']['id']))
$data['Customer']['id'] = null;
if (empty($data['Lease']['id']))
@@ -285,9 +288,9 @@ class TransactionsController extends AppController {
pr(compact('data'));
if (!$this->Transaction->addReceipt($data,
$data['Customer']['id'],
$data['Lease']['id'])) {
if (!$this->Transaction->addWriteOff($data,
$data['Customer']['id'],
$data['Lease']['id'])) {
$this->Session->setFlash("WRITE OFF FAILED", true);
// REVISIT <AP> 20090706:
// Until we can work out the session problems,
@@ -295,8 +298,6 @@ class TransactionsController extends AppController {
die("<H1>WRITE-OFF FAILED</H1>");
}
$this->render('/fake');
// Return to viewing the lease/customer
if (empty($data['Lease']['id']))
$this->redirect(array('controller' => 'customers',

View File

@@ -245,10 +245,12 @@ class UnitsController extends AppController {
$this->sidemenu_links[] =
array('name' => 'Move-Out', 'url' => array('action' => 'move_out',
$id));
} else {
} elseif ($this->Unit->available($unit['Unit']['status'])) {
$this->sidemenu_links[] =
array('name' => 'Move-In', 'url' => array('action' => 'move_in',
$id));
} else {
// Unit is unavailable (dirty, damaged, reserved, business-use, etc)
}
if (isset($unit['CurrentLease']['id']) &&

View File

@@ -132,6 +132,7 @@ class Account extends AppModel {
function cashAccountID() { return $this->nameToID('Cash'); }
function checkAccountID() { return $this->nameToID('Check'); }
function moneyOrderAccountID() { return $this->nameToID('Money Order'); }
function achAccountID() { return $this->nameToID('ACH'); }
function concessionAccountID() { return $this->nameToID('Concession'); }
function waiverAccountID() { return $this->nameToID('Waiver'); }
function pettyCashAccountID() { return $this->nameToID('Petty Cash'); }
@@ -223,6 +224,7 @@ class Account extends AppModel {
$accounts = $this->receiptAccounts();
foreach(array($this->nsfAccountID(),
$this->badDebtAccountID(),
$this->securityDepositAccountID())
AS $account_id) {
$accounts[$account_id] = $this->name($account_id);

View File

@@ -44,26 +44,26 @@ class Lease extends AppModel {
$this->prEnter(compact('id', 'query'));
$this->queryInit($query);
// REVISIT <AP>: 20090807
// Let's try simplifying the security deposit issue.
// Presume that security deposits are NOT used at all,
// until the customer moves out of the unit. At that
// time, the ENTIRE deposit is converted to customer
// credit. Piece of cake.
// For more information, see file revision history,
// including the revision just before this, r503.
$this->id = $id;
$moveout_date = $this->field('moveout_date');
if (!empty($moveout_date))
return $this->prReturn(0);
$query['conditions'][] = array('StatementEntry.lease_id' => $id);
$query['conditions'][] = array('StatementEntry.account_id' =>
$this->StatementEntry->Account->securityDepositAccountID());
// REVISIT <AP>: 20090804
// Dilemma... how to handle security deposits used to pay
// charges on the lease, yet are not part of the lease
// security deposit(s)? For example, Lease A & Lease B,
// each with $25 Sec. Dep. Move out of Lease A, and
// promote the lease surplus to the customer. A new
// charge on Lease B for $15, which is assigned $15/$25
// from the promoted Lease A surplus. They way this
// function works at present, it will presume the $15 is
// part of the security deposit balance, and will end up
// calculating it as only $10, which is wrong. Perhaps
// the fix is to release security deposits into some sort
// of income account.
$stats = $this->StatementEntry->stats(null, $query);
return $this->prReturn($stats['account_balance']);
return $this->prReturn($stats['Charge']['disbursement']);
}
@@ -113,8 +113,12 @@ class Lease extends AppModel {
$customer_id = $secdeps[0]['StatementEntry']['customer_id'];
$lease_id = $secdeps[0]['StatementEntry']['lease_id'];
// Add receipt of the security deposit funds. Do NOT
// flag them as part of the lease, as all received funds
// are only associated with the customer, for future
// (or present) disbursement on any lease.
$result = $this->StatementEntry->Transaction->addReceipt
($release, $customer_id, $lease_id);
($release, $customer_id, null);
return $this->prReturn($result);
}
@@ -164,6 +168,35 @@ class Lease extends AppModel {
}
/**************************************************************************
**************************************************************************
**************************************************************************
* function: lateCharges
* - Returns a list of late charges from this lease
*/
function lateCharges($id) {
$this->prEnter(compact('id'));
$late_account_id = $this->StatementEntry->Account->lateChargeAccountID();
$entries = $this->StatementEntry->find
('all',
array('link' =>
array(// Models
'Lease',
),
//'fields' => array('id', 'amount', 'effective_date', 'through_date'),
'conditions' => array(array('Lease.id' => $id),
array('StatementEntry.type' => 'CHARGE'),
array('StatementEntry.account_id' => $late_account_id),
),
)
);
return $this->prReturn($entries);
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -263,6 +296,222 @@ class Lease extends AppModel {
}
/**************************************************************************
**************************************************************************
**************************************************************************
* function: assessMonthlyRent
* - Charges rent for the month, if not already charged.
*/
function assessMonthlyRent($id, $date = null) {
$this->prEnter(compact('id', 'date'));
$this->id = $id;
if (empty($date))
$date = time();
if (is_string($date))
$date = strtotime($date);
// REVISIT <AP>: 20090808
// Anniversary Billing not supported
$anniversary = 0 && $this->field('anniversary_billing');
if (empty($anniversary)) {
$date_parts = getdate($date);
$date = mktime(0, 0, 0, $date_parts['mon'], 1, $date_parts['year']);
}
// Make sure we're not trying to assess rent on a closed lease
$close_date = $this->field('close_date');
$this->pr(17, compact('close_date'));
if (!empty($close_date))
return $this->prReturn(null);
// Don't assess rent after customer has moved out
$moveout_date = $this->field('moveout_date');
$this->pr(17, compact('moveout_date'));
if (!empty($moveout_date) && strtotime($moveout_date) < $date)
return $this->prReturn(null);
// Determine when the customer has already been charged through
// and, of course, don't charge them if they've already been.
$charge_through_date = strtotime($this->rentChargeThrough($id));
$this->pr(17, compact('date', 'charge_through_date')
+ array('date_str' => date('Y-m-d', $date),
'charge_through_date_str' => date('Y-m-d', $charge_through_date)));
if ($charge_through_date >= $date)
return $this->prReturn(null);
// OK, it seems we're going to go ahead and charge the customer
// on this lease. Calculate the new charge through date, which
// is 1 day shy of 1 month from $date. For example, if we're
// charging for 8/1/09, charge through will be 8/31/09, and
// charging for 8/15/09, charge through will be 9/14/09.
$date_parts = getdate($date);
$charge_through_date = mktime(0, 0, 0,
$date_parts['mon']+1,
$date_parts['mday']-1,
$date_parts['year']);
// Build the invoice transaction
$invoice = array('Transaction' => array(), 'Entry' => array());
// REVISIT <AP>: 20090808
// Keeping Transaction.stamp until the existing facility
// is up to date. Then we want the stamp to be now()
// (and so can just delete the next line).
$invoice['Transaction']['stamp'] = date('Y-m-d', $date);
$invoice['Entry'][] =
array('effective_date' => date('Y-m-d', $date),
'through_date' => date('Y-m-d', $charge_through_date),
'amount' => $this->field('rent'),
'account_id' => $this->StatementEntry->Account->rentAccountId(),
);
// Record the invoice and return the result
$this->pr(21, compact('invoice'));
$result = $this->StatementEntry->Transaction->addInvoice
($invoice, null, $id);
return $this->prReturn($result);
}
/**************************************************************************
**************************************************************************
**************************************************************************
* function: assessMonthlyRentAll
* - Ensures rent has been charged on all open leases
*/
function assessMonthlyRentAll($date = null) {
$this->prEnter(compact('date'));
$leases = $this->find
('all', array('contain' => false,
'conditions' => array('Lease.close_date' => null),
));
$ret = array('Lease' => array());
foreach ($leases AS $lease) {
$result = $this->assessMonthlyRent($lease['Lease']['id'], $date);
$ret['Lease'][$lease['Lease']['id']] = $result;
if ($result['error'])
$ret['error'] = true;
}
return $this->prReturn($ret + array('error' => false));
}
/**************************************************************************
**************************************************************************
**************************************************************************
* function: assessMonthlyLate
* - Assess late charges for the month, if not already charged.
*/
function assessMonthlyLate($id, $date = null) {
$this->prFunctionLevel(25);
$this->prEnter(compact('id', 'date'));
$this->id = $id;
if (empty($date))
$date = time();
if (is_string($date))
$date = strtotime($date);
// REVISIT <AP>: 20090808
// Anniversary Billing not supported
$anniversary = 0 && $this->field('anniversary_billing');
if (empty($anniversary)) {
$date_parts = getdate($date);
$date = mktime(0, 0, 0, $date_parts['mon'], 11, $date_parts['year']);
}
// Make sure we're not trying to assess late charges on a closed lease
$close_date = $this->field('close_date');
$this->pr(17, compact('close_date'));
if (!empty($close_date))
return $this->prReturn(null);
// Don't assess late charges after customer has moved out
$moveout_date = $this->field('moveout_date');
$this->pr(17, compact('moveout_date'));
if (!empty($moveout_date) && strtotime($moveout_date) < $date)
return $this->prReturn(null);
// Determine when the customer has been charged through for rent
// and don't mark them as late if they haven't even been charged rent
$charge_through_date = strtotime($this->rentChargeThrough($id));
$this->pr(17, compact('date', 'charge_through_date')
+ array('date_str' => date('Y-m-d', $date),
'charge_through_date_str' => date('Y-m-d', $charge_through_date)));
if ($charge_through_date <= $date)
return $this->prReturn(null);
// Determine if the customer is actually late. This is based on
// when they've paid through, plus 10 days before they're late.
$paid_through_date = strtotime($this->rentPaidThrough($id));
$this->pr(17, compact('date', 'paid_through_date')
+ array('date_str' => date('Y-m-d', $date),
'paid_through_date_str' => date('Y-m-d', $paid_through_date)));
$date_parts = getdate($paid_through_date);
$paid_through_date = mktime(0, 0, 0, $date_parts['mon'], $date_parts['mday']+10, $date_parts['year']);
if ($paid_through_date >= $date)
return $this->prReturn(null);
// Determine if the customer has already been charged a late fee
// and, of course, don't charge them if they've already been.
$late_charges = $this->lateCharges($id);
foreach ($late_charges AS $late) {
if (strtotime($late['StatementEntry']['effective_date']) == $date)
return $this->prReturn(null);
}
// Build the invoice transaction
$invoice = array('Transaction' => array(), 'Entry' => array());
// REVISIT <AP>: 20090808
// Keeping Transaction.stamp until the existing facility
// is up to date. Then we want the stamp to be now()
// (and so can just delete the next line).
$invoice['Transaction']['stamp'] = date('Y-m-d', $date);
$invoice['Entry'][] =
array('effective_date' => date('Y-m-d', $date),
'amount' => 10,
'account_id' => $this->StatementEntry->Account->lateChargeAccountId(),
);
// Record the invoice and return the result
$this->pr(21, compact('invoice'));
$result = $this->StatementEntry->Transaction->addInvoice
($invoice, null, $id);
return $this->prReturn($result);
}
/**************************************************************************
**************************************************************************
**************************************************************************
* function: assessMonthlyLateAll
* - Ensures rent has been charged on all open leases
*/
function assessMonthlyLateAll($date = null) {
$this->prEnter(compact('date'));
$leases = $this->find
('all', array('contain' => false,
'conditions' => array('Lease.close_date' => null),
));
$ret = array('Lease' => array());
foreach ($leases AS $lease) {
$result = $this->assessMonthlyLate($lease['Lease']['id'], $date);
$ret['Lease'][$lease['Lease']['id']] = $result;
if ($result['error'])
$ret['error'] = true;
}
return $this->prReturn($ret + array('error' => false));
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -451,12 +700,13 @@ class Lease extends AppModel {
if (isset($this->data['Lease']['close_date']))
return $this->prReturn(false);
$deposit_balance = $this->securityDepositBalance($id);
$stats = $this->stats($id);
// A lease can only be closed if there are no outstanding
// security deposits, and if the account balance is zero.
if ($deposit_balance != 0)
// security deposits ...
if ($this->securityDepositBalance($id) != 0)
return $this->prReturn(false);
// ... and if the account balance is zero.
if ($this->balance($id) != 0)
return $this->prReturn(false);
// Apparently this lease meets all the criteria!

View File

@@ -35,7 +35,7 @@ class StatementEntry extends AppModel {
}
function creditTypes() {
return array('DISBURSEMENT', 'WAIVER', 'REVERSAL', 'SURPLUS');
return array('DISBURSEMENT', 'WAIVER', 'REVERSAL', 'WRITEOFF', 'SURPLUS');
}
function voidTypes() {
@@ -125,14 +125,14 @@ class StatementEntry extends AppModel {
$ret = array();
if (!$this->verifyStatementEntry($entry))
return array('error' => true, 'verify_data' => $entry) + $ret;
return $this->prReturn(array('error' => true, 'verify_data' => $entry) + $ret);
$this->pr(20, array('checkpoint' => 'Pre-Save')
+ compact('entry'));
$this->create();
if (!$this->save($entry))
return array('error' => true, 'save_data' => $entry) + $ret;
return $this->prReturn(array('error' => true, 'save_data' => $entry) + $ret);
$ret['statement_entry_id'] = $this->id;
return $this->prReturn($ret + array('error' => false));
@@ -656,7 +656,7 @@ class StatementEntry extends AppModel {
* - Returns summary data from the requested statement entry
*/
function stats($id = null, $query = null) {
$this->prFunctionLevel(array('log' => 19, 'show' => 10));
//$this->prFunctionLevel(array('log' => 19, 'show' => 10));
$this->prEnter(compact('id', 'query'));
$this->queryInit($query);

View File

@@ -14,6 +14,41 @@ class Tender extends AppModel {
);
/**************************************************************************
**************************************************************************
**************************************************************************
* function: beforeSave
* - Performs any work needed before the save occurs
*/
function afterSave() {
// Come up with a (not necessarily unique) name for the tender.
// For checks & money orders, this will be based on the check
// number. For other types of tender, we'll just use the
// generic name of the tender type, and the tender ID
// Determine our tender type, and set the ID of that model
$this->TenderType->id = $this->field('tender_type_id');
// REVISIT <AP>: 20090810
// The only tender expected to have no tender type
// is our special "Closing" tender.
if (empty($this->TenderType->id))
$newname = 'Closing';
else {
$newname = $this->TenderType->field('name');
$naming_field = $this->TenderType->field('naming_field');
if (!empty($naming_field))
$newname .= ' #' . $this->field($naming_field);
}
if ($newname !== $this->field('name'))
$this->saveField('name', $newname);
return parent::afterSave();
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -47,25 +82,6 @@ class Tender extends AppModel {
if (!$this->verifyTender($tender))
return $this->prReturn(array('error' => true) + $ret);
// Come up with a (not necessarily unique) name for the tender.
// For checks & money orders, this will be based on the check
// number. For other types of tender, we'll just use the
// generic name of the monetary account.
// REVISIT <AP>: 20090723
// I would like to have cash named "Cash #1234", where
// the number would correspond to either the Tender ID
// or the LedgerEntry ID.
if (empty($tender['name']) && !empty($tender['account_id'])) {
$tender['name'] = $this->LedgerEntry->Account->name($tender['account_id']);
if ($tender['account_id'] == $this->LedgerEntry->Account->checkAccountID() ||
$tender['account_id'] == $this->LedgerEntry->Account->moneyOrderAccountID()) {
$tender['name'] .= ' #' . $tender['data1'];
}
}
$this->pr(20, array('Tender' => $tender),
'Pre-Save');
$this->create();
if (!$this->save($tender))
return $this->prReturn(array('error' => true) + $ret);
@@ -80,31 +96,10 @@ class Tender extends AppModel {
**************************************************************************
* function: nsf
* - Flags the ledger entry as having insufficient funds
*
* Steps:
* - Get information from Check (C1); for amount $A
* - Find Bank Deposit matching to Tender
* - New Transaction (T1)
* - New Bank Deposit (D1)
* - New Tender (N1); NSF; D1,
* - Add new LedgerEntry (L1a); T1; debit:bank; -$A
* - Add new LedgerEntry (L1b); T1; credit:NSF; -$A
* - Add new LedgerEntry (L2a); T1; debit:NSF; -$A; N1
* - Add new LedgerEntry (L2b); T1; credit:A/R; -$A
* - For Tx associated with LE associated with C1:
* - For each Disbursement SE of Tx:
* - Add new StatementEntry (S1n); T1; DISBURSEMENT; -1*S1n.amount
* - New Transaction (T2) (?????)
* - Add new StatementEntry (S2); T2; CHARGE; NSF; $35
* - Add new LedgerEntry (L3a); T2; credit:NSF-Fee; $35
* - Add new LedgerEntry (L3b); T2; debit:A/R; $35
* - Set C1.nsf_tx = T1
* - Re-Reconcile (customer may have running credit)
*/
function nsf($id, $stamp = null) {
$this->prFunctionLevel(30);
$this->prEnter(compact('id'));
function nsf($id, $stamp = null, $comment = null) {
$this->prEnter(compact('id', 'stamp', 'comment'));
// Get information about this NSF item.
$this->id = $id;
@@ -128,16 +123,15 @@ class Tender extends AppModel {
unset($tender['NsfTransaction']);
$T = new Transaction();
$result = $T->addNsf($tender, $stamp);
if ($result['error'])
return $this->prReturn(false);
$result = $T->addNsf($tender, $stamp, $comment);
if (empty($result['error'])) {
// Flag the tender as NSF, using the items created from addNsf
$this->id = $id;
$this->saveField('nsf_transaction_id', $result['nsf_transaction_id']);
$this->saveField('nsf_ledger_entry_id', $result['nsf_ledger_entry_id']);
}
// Flag the tender as NSF, using the items created from addNsf
$this->id = $id;
$this->saveField('nsf_transaction_id', $result['nsf_transaction_id']);
$this->saveField('nsf_ledger_entry_id', $result['nsf_ledger_entry_id']);
return $this->prReturn(true);
return $this->prReturn($result);
}

View File

@@ -167,6 +167,33 @@ class Transaction extends AppModel {
}
/**************************************************************************
**************************************************************************
**************************************************************************
* function: addWriteOff
* - Adds a new write off of bad debt
*/
function addWriteOff($data, $customer_id, $lease_id = null) {
$this->prEnter(compact('data', 'charge_id', 'customer_id', 'lease_id'));
if (count($data['Entry']) != 1)
INTERNAL_ERROR("Should be one Entry for addWriteOff");
// Just make sure the disbursement(s) are marked as write offs,
// and that the write-off account is used.
$data['Transaction']['disbursement_type'] = 'WRITEOFF';
$data['Entry'][0]['account_id'] = $this->Account->badDebtAccountID();
// In all other respects this is just a receipt.
$ids = $this->addReceipt($data, $customer_id, $lease_id);
if (isset($ids['transaction_id']))
$ids['writeoff_id'] = $ids['transaction_id'];
return $this->prReturn($ids);
}
/**************************************************************************
**************************************************************************
**************************************************************************
@@ -198,7 +225,7 @@ class Transaction extends AppModel {
if (!isset($group[$entry['account_id']]))
$group[$entry['account_id']] =
array('account_id' => $entry['account_id'],
'crdr' => 'CREDIT',
'crdr' => strtoupper($this->Account->fundamentalOpposite($deposit['crdr'])),
'amount' => 0);
$group[$entry['account_id']]['amount'] += $entry['amount'];
}
@@ -461,9 +488,8 @@ class Transaction extends AppModel {
// Automatically figure out the customer if we have the lease
if (!empty($transaction['lease_id']) && empty($transaction['customer_id'])) {
$L = new Lease();
$L->recursive = -1;
$lease = $L->read(null, $transaction['lease_id']);
$transaction['customer_id'] = $lease['Lease']['customer_id'];
$L->id = $transaction['lease_id'];
$transaction['customer_id'] = $L->field('customer_id');
}
// Break each entry out of the combined statement/ledger entry
@@ -475,6 +501,10 @@ class Transaction extends AppModel {
// accidentally pick up stale data.
$le1 = $le1_tender = $le2 = $se = null;
// Really, data should be sanitized at the controller,
// and not here. However, it's a one stop cleanup.
$entry['amount'] = str_replace('$', '', $entry['amount']);
// Add entry amount into the transaction total
$transaction['amount'] += $entry['amount'];
@@ -526,6 +556,8 @@ class Transaction extends AppModel {
array_intersect_key($transaction,
array_flip(array('customer_id', 'lease_id')));
$se['comment'] = $entry['statement_entry_comment'];
if (!empty($entry['se_negative']))
$se['amount'] *= -1;
// (DISBURSEMENTS will have statement entries created below, when
// assigning credits, and DEPOSITS don't have statement entries)
@@ -551,11 +583,11 @@ class Transaction extends AppModel {
// that were created above before we nulled them out
array_unshift($entries,
array('le1' => array('account_id' => $transaction['account_id'],
'crdr' => 'DEBIT',
'amount' => $transaction['amount']),
'le2' => array('account_id' => $this->Account->accountReceivableAccountID(),
'crdr' => 'CREDIT',
'amount' => $transaction['amount'])
'amount' => -1 * $transaction['amount']),
'le2' => array('account_id' => $this->Account->accountReceivableAccountID(),
'crdr' => 'DEBIT',
'amount' => -1 * $transaction['amount'])
));
}
@@ -598,7 +630,8 @@ class Transaction extends AppModel {
if (!empty($se)) {
$se['transaction_id'] = $ret['transaction_id'];
$se += array('effective_date' => $transaction_stamp);
if (empty($se['effective_date']))
$se['effective_date'] = $transaction_stamp;
$result = $this->StatementEntry->addStatementEntry($se);
$ret['entries'][$e_index]['StatementEntry'] = $result;
if ($result['error']) {
@@ -641,8 +674,8 @@ class Transaction extends AppModel {
* - Adds NSF transaction
*/
function addNsf($tender, $stamp) {
$this->prEnter(compact('tender', 'stamp'));
function addNsf($tender, $stamp = null, $comment = null) {
$this->prEnter(compact('tender', 'stamp', 'comment'));
$ret = array();
@@ -651,10 +684,13 @@ class Transaction extends AppModel {
// and recording it in the NSF account. It has nothing to do
// with the customer statement (charges, disbursements, credits, etc).
$bounce_result = $this->addDeposit
(array('Transaction' => array(),
(array('Transaction' => array('stamp' => $stamp,
'crdr' => 'CREDIT'),
'Entry' => array(array('tender_id' => null,
'account_id' => $this->Account->nsfAccountID(),
'amount' => -1 * $tender['LedgerEntry']['amount'],
'crdr' => 'DEBIT',
'amount' => $tender['LedgerEntry']['amount'],
'se_negative' => true,
))),
$tender['Transaction']['account_id']);
@@ -694,10 +730,10 @@ class Transaction extends AppModel {
$rollback['Transaction']['stamp'] = $stamp;
$rollback['Transaction']['type'] = 'RECEIPT';
$rollback['Transaction']['crdr'] = 'DEBIT'; // Unused... keeps verifyTx happy
$rollback['Transaction']['crdr'] = 'CREDIT'; // Unused... keeps verifyTx happy
$rollback['Transaction']['account_id'] = $this->Account->nsfAccountID();
$rollback['Transaction']['customer_id'] = $tender['Tender']['customer_id'];
$rollback['Transaction']['amount'] = -1 * $tender['LedgerEntry']['amount'];
$rollback['Transaction']['comment'] = $comment;
foreach ($nsf_ledger_entry['Transaction']['StatementEntry'] AS $disbursement) {
if ($disbursement['type'] === 'SURPLUS') {
@@ -713,7 +749,6 @@ class Transaction extends AppModel {
'customer_id' => $disbursement['customer_id'],
'lease_id' => $disbursement['lease_id'],
'charge_entry_id' => $disbursement['charge_entry_id'],
'effective_date' => $stamp,
);
}
}

View File

@@ -55,10 +55,50 @@ class Unit extends AppModel {
return $this->statusValue('OCCUPIED');
}
function statusCheck($id_or_enum,
$min = null, $min_strict = false,
$max = null, $max_strict = false)
{
$this->prEnter(compact('id_or_enum', 'min', 'min_strict', 'max', 'max_strict'));
if (is_int($id_or_enum)) {
$this->id = $id_or_enum;
$id_or_enum = $this->field('status');
}
$enum_val = $this->statusValue($id_or_enum);
if (isset($min) && is_string($min))
$min = $this->statusValue($min);
if (isset($max) && is_string($max))
$max = $this->statusValue($max);
$this->pr(17, compact('enum_val', 'min', 'min_strict', 'max', 'max_strict'));
if (isset($min) &&
($enum_val < $min ||
($min_strict && $enum_val == $min)))
return $this->prReturn(false);
if (isset($max) &&
($enum_val > $max ||
($max_strict && $enum_val == $max)))
return $this->prReturn(false);
return $this->prReturn(true);
}
function occupied($enum) {
return $this->statusCheck($enum, 'OCCUPIED', false, null, false);
}
function conditionOccupied() {
return ('Unit.status >= ' . $this->statusValue('OCCUPIED'));
}
function vacant($enum) {
return $this->statusCheck($enum, 'UNAVAILABLE', true, 'OCCUPIED', true);
}
function conditionVacant() {
return ('Unit.status BETWEEN ' .
($this->statusValue('UNAVAILABLE')+1) .
@@ -66,10 +106,16 @@ class Unit extends AppModel {
($this->statusValue('OCCUPIED')-1));
}
function unavailable($enum) {
return $this->statusCheck($enum, null, false, 'UNAVAILABLE', false);
}
function conditionUnavailable() {
return ('Unit.status <= ' . $this->statusValue('UNAVAILABLE'));
}
function available($enum) { return $this->vacant($enum); }
/**************************************************************************
**************************************************************************

View File

@@ -15,7 +15,8 @@ echo '<div class="account collected">' . "\n";
// Reset the form
function resetForm() {
/* updateEntriesGrid(); */
<?php /* REVISIT <AP>: 20090810; Hate to do this, but first data is wrong... */ ?>
setTimeout(updateEntriesGrid, 1000);
}
function onGridLoadComplete() {

View File

@@ -11,6 +11,9 @@
* Javascript
*/
// Warnings _really_ screw up javascript
$saved_debug_state = Configure::read('debug');
Configure::write('debug', '0');
?>
<script type="text/javascript"><!--
@@ -23,14 +26,8 @@
success: showResponse, // post-submit callback
// other available options:
//url: url, // override for form's 'action' attribute
//type: 'get', // 'get' or 'post', override for form's 'method' attribute
//dataType: null, // 'xml', 'script', or 'json' (expected server response type)
//clearForm: true, // clear all form fields after successful submit
//resetForm: true, // reset the form after successful submit
// $.ajax options can be used here too, for example:
//timeout: 3000,
};
// bind form using 'ajaxForm'
@@ -39,16 +36,7 @@
// pre-submit callback
function verifyRequest(formData, jqForm, options) {
// formData is an array; here we use $.param to convert it to a string to display it
// but the form plugin does this for you automatically when it submits the data
//var_dump(formData);
//$('#request-debug').html('<PRE>'+dump(formData)+'</PRE>');
$('#request-debug').html('Ommitted');
//return false;
$('#response-debug').html('Loading <BLINK>...</BLINK>');
$('#output-debug').html('Loading <BLINK>...</BLINK>');
$('#results').html('Working <BLINK>...</BLINK>');
// here we could return false to prevent the form from being submitted;
// returning anything other than false will allow the form submit to continue
return true;
@@ -56,29 +44,32 @@ function verifyRequest(formData, jqForm, options) {
// post-submit callback
function showResponse(responseText, statusText) {
// for normal html responses, the first argument to the success callback
// is the XMLHttpRequest object's responseText property
// if the ajaxForm method was passed an Options Object with the dataType
// property set to 'xml' then the first argument to the success callback
// is the XMLHttpRequest object's responseXML property
// if the ajaxForm method was passed an Options Object with the dataType
// property set to 'json' then the first argument to the success callback
// is the json data object returned by the server
if (statusText == 'success') {
var amount = 0;
$("input.payment.amount").each(function(i) {
amount += $(this).val();
});
$('#results').html('<H3>Receipt Saved<BR>' +
$("#receipt-customer-name").html() +
' : ' + fmtCurrency(amount) +
'</H3>');
if (!$("#repeat").attr("checked")) {
window.location.href =
"<?php echo $html->url(array('controller' => 'customers',
'action' => 'view')); ?>"
+ "/" + $("#customer-id").val();
return;
}
// get a clean slate
//resetForm();
// REVISIT <AP>: 20090806 Add to resetForm()
updateCharges($("#customer-id").val());
resetForm();
}
else {
alert('not successful??');
$('#results').html('<H2>Failed to save receipt!</H2>');
alert('Failed to save receipt.');
}
$('#response-debug').html('<PRE>'+dump(statusText)+'</PRE>');
}
// Reset the form
@@ -86,13 +77,8 @@ function resetForm() {
$('#payment-entry-id').val(1);
$('#payments').html('');
$("#receipt-customer-id").html("INTERNAL ERROR");
$("#receipt-customer-name").html("INTERNAL ERROR");
$("#receipt-balance").html("INTERNAL ERROR");
$("#receipt-charges-caption").html("Outstanding Charges");
addPaymentSource(false);
datepickerNow('TransactionStamp');
updateCharges($("#customer-id").val());
}
function onRowSelect(grid_id, customer_id) {
@@ -174,7 +160,7 @@ function addPaymentSource(flash) {
'<DIV ID="payment-amount-div-%{id}" CLASS="input text required">' +
' <INPUT TYPE="text" SIZE="20"' +
' NAME="data[Entry][%{id}][amount]"' +
' CLASS="payment"' +
' CLASS="payment amount"' +
' ID="payment-amount-%{id}" />' +
' <LABEL CLASS="payment" FOR="payment-amount-%{id}">Amount</LABEL>' +
'</DIV>' +
@@ -220,11 +206,13 @@ function addPaymentSource(flash) {
}
function switchPaymentType(paymentid_base, paymentid, radioid) {
$("."+paymentid_base+"-"+paymentid).slideUp();
var type_id = $("#"+radioid).val();
$("."+paymentid_base+"-"+paymentid+
":not(" +
"#"+paymentid_base+"-"+paymentid+"-"+type_id +
")").slideUp();
$("#"+paymentid_base+"-"+paymentid+"-"+type_id).slideDown();
}
}
function updateChargesGrid(idlist) {
var dynamic_post = new Array();
@@ -268,11 +256,12 @@ function updateCharges(id) {
}
--></script>
--></script>
<?php
; // align
//echo '<DIV ID="dialog">' . "\n";
// Re-Enable warnings
Configure::write('debug', $saved_debug_state);
echo $this->element('customers', array
('config' => array
@@ -363,6 +352,10 @@ echo $this->element('form_table',
),
)));
echo "<BR>\n";
echo $form->input('repeat', array('type' => 'checkbox',
'id' => 'repeat',
'label' => 'Enter Multiple Receipts')) . "\n";
echo $form->submit('Generate Receipt') . "\n";
?>
@@ -383,9 +376,13 @@ echo $form->submit('Generate Receipt') . "\n";
<?php /* echo '</DIV>' . "\n"; // End of the dialog DIV */ ?>
<div><H4>Request</H4><div id="request-debug"></div></div>
<div><H4>Response</H4><div id="response-debug"></div></div>
<div><H4>Output</H4><div id="output-debug"></div></div>
<div id="results"></div>
<div id="output-debug" style="display:none"></div>
<?php
// Warnings _really_ screw up javascript
Configure::write('debug', '0');
?>
<script type="text/javascript"><!--
$(document).ready(function(){
@@ -396,6 +393,13 @@ echo $form->submit('Generate Receipt') . "\n";
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
datepickerNow('TransactionStamp');
$("#receipt-customer-id").html("INTERNAL ERROR");
$("#receipt-customer-name").html("INTERNAL ERROR");
$("#receipt-balance").html("INTERNAL ERROR");
$("#receipt-charges-caption").html("Outstanding Charges");
resetForm();
<?php if (isset($customer['id'])): ?>
@@ -413,37 +417,7 @@ echo $form->submit('Generate Receipt') . "\n";
onGridState(null, 'visible');
<?php endif; ?>
/* $("#dialog").dialog({ */
/* bgiframe: true, */
/* autoOpen: false, */
/* height: 500, */
/* width: 600, */
/* modal: true, */
/* buttons: { */
/* 'Post a Payment': function() { */
/* var bValid = true; */
/* if (bValid) { */
/* $('#debug').append('<H2>POSTED!</H2>'); */
/* $(this).dialog('close'); */
/* } */
/* }, */
/* Cancel: function() { */
/* $(this).dialog('close'); */
/* } */
/* }, */
/* close: function() { */
/* } */
/* }); */
/* $('#post-payment').click(function() { */
/* $('#dialog').dialog('open'); */
/* }); */
});
--></script>
</div>
<a href="#" onClick="$('#debug').html(''); return false;">Clear Debug Output</a>

View File

@@ -11,6 +11,9 @@ echo '<div class="customer view">' . "\n";
$rows = array();
$rows[] = array('Name', $customer['Customer']['name']);
$rows[] = array('Since', FormatHelper::date($since, true));
if (!empty($until))
$rows[] = array('Until', FormatHelper::date($until, true));
$rows[] = array('Comment', $customer['Customer']['comment']);
echo $this->element('table',
@@ -27,7 +30,9 @@ echo $this->element('table',
echo '<div class="infobox">' . "\n";
$rows = array();
$rows[] = array('Security Deposit:', FormatHelper::currency($outstandingDeposit));
$rows[] = array('Balance:', FormatHelper::currency($outstandingBalance));
//$rows[] = array('Charges:', FormatHelper::currency($stats['charges']));
//$rows[] = array('Payments:', FormatHelper::currency($stats['disbursements']));
$rows[] = array('Balance Owed:', FormatHelper::currency($outstandingBalance));
echo $this->element('table',
array('class' => 'summary',
'rows' => $rows,
@@ -80,7 +85,7 @@ echo $this->element('leases', array
echo $this->element('statement_entries', array
(// Grid configuration
'config' => array
('caption' => 'Account',
('caption' => 'Customer Statement',
'filter' => array('Customer.id' => $customer['Customer']['id'],
'type !=' => 'VOID'),
'exclude' => array('Customer'),
@@ -90,27 +95,19 @@ echo $this->element('statement_entries', array
/**********************************************************************
* Customer Ledger History
* Receipt History
*/
/*
* REVISIT <AP>: 20090724
* It's not my intention to really include this, as I believe it
* just will confuse folks. However, I've added it at the moment
* to help me see the picture of what's happening. It may prove
* useful with respect to identifying pre-payments, so after using
* it for a while, maybe we can get a feeling for that. I suspect
* it will be MUCH more useful just to add the pre-pay amount to
* the info box, or provide a list of ledger entries that are JUST
* pre-payments. We'll see...
*/
echo $this->element('ledger_entries', array
(// Grid configuration
'config' => array
('caption' => 'Ledger Entries',
('caption' => 'Receipts',
'filter' => array('Customer.id' => $customer['Customer']['id'],
'Account.id !=' => '-AR-'),
'exclude' => array('Customer'),
'Transaction.type' => 'RECEIPT',
'Tender.id !=' => null,
//'Account.id !=' => '-AR-'
),
'exclude' => array('Account', 'Cr/Dr'),
'sort_column' => 'Date',
'sort_order' => 'DESC',
)));

View File

@@ -123,7 +123,7 @@ foreach ($fields AS $field => $config) {
}
echo $this->element('table',
compact('class', 'caption', 'headers',
compact('id', 'class', 'caption', 'headers',
'rows', 'row_class', 'suppress_alternate_rows',
'column_class')
);

View File

@@ -46,12 +46,12 @@ if (!isset($grid_setup))
$grid_setup = array();
// Do some prework to bring in the appropriate libraries
$imgpath = '/pmgr/site/css/jqGrid/basic/images';
$html->css('jqGrid/basic/grid', null, null, false);
$html->css('jqGrid/jqModal', null, null, false);
$javascript->link('jqGrid/jquery.jqGrid.js', false);
$javascript->link('jqGrid/js/jqModal', false);
$javascript->link('jqGrid/js/jqDnR', false);
$html->css('jqGrid/ui.jqgrid', null, null, false);
//$html->css('jqGrid/jqModal', null, null, false);
$javascript->link('jqGrid/grid.locale-en', false);
$javascript->link('jqGrid/jquery.jqGrid.min', false);
//$javascript->link('jqGrid/js/jqModal', false);
//$javascript->link('jqGrid/js/jqDnR', false);
$javascript->link('pmgr_jqGrid', false);
@@ -231,8 +231,8 @@ $jqGrid_setup = array_merge
'sortname' => $sortname,
'sortorder' => $sortorder,
'caption' => $caption,
'imgpath' => $imgpath,
'viewrecords' => true,
'gridview' => true,
'pager' => $grid_id.'-pager',
),
$grid_events,
@@ -251,16 +251,16 @@ $jqGrid_setup = array_merge
<script type="text/javascript"><!--
jQuery(document).ready(function(){
currencyFormatter = function(el, cellval, opts) {
currencyFormatter = function(cellval, opts, rowObject) {
if (!cellval)
return;
$(el).html(fmtCurrency(cellval));
return "";
return fmtCurrency(cellval);
}
idFormatter = function(el, cellval, opts) {
idFormatter = function(cellval, opts, rowObject) {
if (!cellval)
return;
$(el).html('#'+cellval);
return cellval;
return '#'+cellval;
}
jQuery('#<?php echo $grid_id; ?>').jqGrid(
@@ -272,36 +272,6 @@ jQuery(document).ready(function(){
del:false,
search:true,
refresh:true});
<?php
/* jQuery('#t_<?php echo $grid_id; ?>').height(25).hide() */
/* .filterGrid('#<?php echo $grid_id; ?>', { */
/* gridModel:true, */
/* gridToolbar:true, */
/* autosearch:true, */
/* }); */
/* jQuery('#<?php echo $grid_id; ?>').navGrid('#<?php echo $grid_id; ?>-pager', */
/* { view:false, */
/* edit:false, */
/* add:false, */
/* del:false, */
/* search:false, */
/* refresh:false}) */
/* .navButtonAdd('#<?php echo $grid_id; ?>-pager',{ */
/* caption:"Search", */
/* title:"Toggle Search", */
/* buttonimg:'<?php echo $imgpath; ?>' + '/find.gif', */
/* onClickButton:function(){ */
/* if(jQuery('#t_<?php echo $grid_id; ?>').css("display")=="none") { */
/* jQuery('#t_<?php echo $grid_id; ?>').css("display",""); */
/* } else { */
/* jQuery('#t_<?php echo $grid_id; ?>').css("display","none"); */
/* } */
/* } */
/* }); */
?>
});
--></script>

View File

@@ -11,6 +11,7 @@ $cols['Deposit'] = array('index' => 'Lease.deposit', 'formatter' => 'cur
$cols['Signed'] = array('index' => 'Lease.lease_date', 'formatter' => 'date');
$cols['Move-In'] = array('index' => 'Lease.movein_date', 'formatter' => 'date');
$cols['Move-Out'] = array('index' => 'Lease.moveout_date', 'formatter' => 'date');
$cols['Closed'] = array('index' => 'Lease.close_date', 'formatter' => 'date');
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Lease.comment', 'formatter' => 'comment');

View File

@@ -64,7 +64,10 @@ if (isset($rows) && is_array($rows) && count($rows)) {
$class = implode(' ', $class);
// OK, output the table HTML
echo('<TABLE' . (isset($class) ? ' CLASS="'.$class.'"' : '') . '>' . "\n");
echo('<TABLE' .
(isset($id) ? ' ID="'.$id.'"' : '') .
(isset($class) ? ' CLASS="'.$class.'"' : '') .
'>' . "\n");
if (isset($caption))
echo(' <CAPTION>' . $caption . '</CAPTION>' . "\n");

View File

@@ -8,6 +8,7 @@ $cols['ID'] = array('index' => 'Unit.id', 'formatter' => 'id');
$cols['Unit'] = array('index' => 'Unit.name', 'formatter' => 'shortname');
$cols['Size'] = array('index' => 'UnitSize.name', 'formatter' => 'shortname');
$cols['Rent'] = array('index' => 'Unit.rent', 'formatter' => 'currency');
$cols['Deposit'] = array('index' => 'Unit.deposit', 'formatter' => 'currency');
$cols['Status'] = array('index' => 'Unit.status', 'formatter' => 'name'); // We have enough real estate
$cols['Balance'] = array('index' => 'balance', 'formatter' => 'currency');
$cols['Comment'] = array('index' => 'Unit.comment', 'formatter' => 'comment');
@@ -19,4 +20,4 @@ $grid
->defaultFields(array('Sort', 'ID', 'Unit'))
->searchFields(array('Unit', 'Size', 'Status'))
->render($this, isset($config) ? $config : null,
array_diff(array_keys($cols), array('Walk', 'Comment')));
array_diff(array_keys($cols), array('Walk', 'Deposit', 'Comment')));

View File

@@ -35,12 +35,12 @@
echo $html->css('layout') . "\n";
echo $html->css('print', null, array('media' => 'print')) . "\n";
echo $html->css('sidemenu') . "\n";
//echo $html->css('jquery/base/ui.all') . "\n";
//echo $html->css('jquery/smoothness/ui.all') . "\n";
//echo $html->css('jquery/dotluv/ui.all') . "\n";
echo $html->css('jquery/start/ui.all') . "\n";
echo $javascript->link('jquery/jquery') . "\n";
echo $javascript->link('jquery/jquery-ui') . "\n";
echo $javascript->link('http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js') . "\n";
echo $javascript->link('http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js') . "\n";
//echo $html->css('themes/base/ui.all') . "\n";
//echo $html->css('themes/smoothness/ui.all') . "\n";
//echo $html->css('themes/dotluv/ui.all') . "\n";
echo $html->css('themes/start/ui.all') . "\n";
echo $javascript->link('jquery.form') . "\n";
echo $javascript->link('pmgr') . "\n";
echo $scripts_for_layout . "\n";

View File

@@ -4,6 +4,13 @@
<?php
; // Editor alignment
$unit = $lease['Unit'];
$customer = $lease['Customer'];
if (isset($lease['Lease']))
$lease = $lease['Lease'];
/**********************************************************************
**********************************************************************
**********************************************************************
@@ -11,6 +18,9 @@
* Javascript
*/
// Warnings _really_ screw up javascript
$saved_debug_state = Configure::read('debug');
Configure::write('debug', '0');
?>
<script type="text/javascript"><!--
@@ -23,14 +33,8 @@
success: showResponse, // post-submit callback
// other available options:
//url: url, // override for form's 'action' attribute
//type: 'get', // 'get' or 'post', override for form's 'method' attribute
//dataType: null, // 'xml', 'script', or 'json' (expected server response type)
//clearForm: true, // clear all form fields after successful submit
//resetForm: true, // reset the form after successful submit
// $.ajax options can be used here too, for example:
//timeout: 3000,
};
// bind form using 'ajaxForm'
@@ -39,16 +43,7 @@
// pre-submit callback
function verifyRequest(formData, jqForm, options) {
// formData is an array; here we use $.param to convert it to a string to display it
// but the form plugin does this for you automatically when it submits the data
//var_dump(formData);
//$('#request-debug').html('<PRE>'+dump(formData)+'</PRE>');
$('#request-debug').html('Ommitted');
//return false;
$('#response-debug').html('Loading <BLINK>...</BLINK>');
$('#output-debug').html('Loading <BLINK>...</BLINK>');
$('#results').html('Working <BLINK>...</BLINK>');
// here we could return false to prevent the form from being submitted;
// returning anything other than false will allow the form submit to continue
return true;
@@ -56,42 +51,41 @@ function verifyRequest(formData, jqForm, options) {
// post-submit callback
function showResponse(responseText, statusText) {
// for normal html responses, the first argument to the success callback
// is the XMLHttpRequest object's responseText property
// if the ajaxForm method was passed an Options Object with the dataType
// property set to 'xml' then the first argument to the success callback
// is the XMLHttpRequest object's responseXML property
// if the ajaxForm method was passed an Options Object with the dataType
// property set to 'json' then the first argument to the success callback
// is the json data object returned by the server
if (statusText == 'success') {
var amount = 0;
$("input.invoice.amount").each(function(i) {
amount += (+ $(this).val().replace(/\$/,''));
});
$('#results').html('<H3>Invoice Saved<BR>' +
$("#invoice-customer").html() +
' : ' + fmtCurrency(amount) +
'</H3>');
if (!$("#repeat").attr("checked")) {
window.location.href =
"<?php echo $html->url(array('controller' => 'leases',
'action' => 'view')); ?>"
+ "/" + $("#lease-id").val();
return;
}
// get a clean slate
//resetForm();
}
else {
alert('not successful??');
$('#results').html('<H2>Failed to save invoice!</H2>');
alert('Failed to save invoice.');
}
$('#response-debug').html('<PRE>'+dump(statusText)+'</PRE>');
}
// Reset the form
function resetForm() {
$("#charge-entry-id").val(1);
function resetForm(nocharge) {
$('#charge-entry-id').val(1);
$('#charges').html('');
$("#invoice-lease").html("INTERNAL ERROR");
$("#invoice-unit").html("INTERNAL ERROR");
$("#invoice-customer").html("INTERNAL ERROR");
$("#invoice-rent").html("INTERNAL ERROR");
$("#invoice-late").html("INTERNAL ERROR");
$("#invoice-deposit").html("INTERNAL ERROR");
addChargeSource(false);
datepickerNow('TransactionStamp');
if (!nocharge)
addChargeSource(false);
}
@@ -152,7 +146,8 @@ function addChargeSource(flash) {
<?php
echo FormatHelper::phpVarToJavascript
($this->element('form_table',
array('class' => "item invoice ledger-entry entry",
array('id' => 'Entry%{id}Form',
'class' => "item invoice ledger-entry entry",
//'with_name_after' => ':',
'field_prefix' => 'Entry.%{id}',
'fields' => array
@@ -170,7 +165,7 @@ function addChargeSource(flash) {
array('type' => 'text'),
'between' => '<A HREF="#" ONCLICK="datepickerEOM(\'Entry%{id}EffectiveDate\',\'Entry%{id}ThroughDate\'); return false;">EOM</A>',
),
"amount" => true,
"amount" => array('opts' => array('class' => 'invoice amount')),
"comment" => array('opts' => array('size' => 50)),
),
))) . "+\n";
@@ -192,12 +187,16 @@ function addChargeSource(flash) {
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
return id;
}
--></script>
<?php
; // align
// Re-Enable warnings
Configure::write('debug', $saved_debug_state);
echo $this->element('leases', array
('config' => array
@@ -205,7 +204,7 @@ echo $this->element('leases', array
'grid_div_class' => 'text-below',
'caption' => ('<A HREF="#" ONCLICK="$(\'#leases-list .HeaderButton\').click();'.
' return false;">Select Lease</A>'),
'grid_setup' => array('hiddengrid' => isset($lease['Lease']['id'])),
'grid_setup' => array('hiddengrid' => isset($lease['id'])),
'grid_events' => array('onSelectRow' =>
array('ids' =>
'if (ids != null){onRowSelect("#"+$(this).attr("id"), ids);}'),
@@ -267,6 +266,10 @@ echo $this->element('form_table',
/* echo '</fieldset>' . "\n"; */
echo "<BR>\n";
echo $form->input('repeat', array('type' => 'checkbox',
'id' => 'repeat',
'label' => 'Enter Multiple Invoices')) . "\n";
echo $form->submit('Generate Invoice') . "\n";
?>
@@ -281,11 +284,20 @@ echo $form->submit('Generate Invoice') . "\n";
<?php echo $form->end('Generate Invoice'); ?>
<div><H4>Request</H4><div id="request-debug"></div></div>
<div><H4>Response</H4><div id="response-debug"></div></div>
<div><H4>Output</H4><div id="output-debug"></div></div>
<div id="results"></div>
<div id="output-debug" style="display:none"></div>
<?php
// Warnings _really_ screw up javascript
Configure::write('debug', '0');
?>
<script type="text/javascript"><!--
$.fn.removeCol = function(col){
if(!col){ col = 1; }
$('tr td:nth-child('+col+'), tr th:nth-child('+col+')', this).remove();
};
$(document).ready(function(){
$("#TransactionStamp")
.attr('autocomplete', 'off')
@@ -294,21 +306,96 @@ echo $form->submit('Generate Invoice') . "\n";
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
resetForm();
$("#invoice-lease").html("INTERNAL ERROR");
$("#invoice-unit").html("INTERNAL ERROR");
$("#invoice-customer").html("INTERNAL ERROR");
$("#invoice-rent").html("INTERNAL ERROR");
$("#invoice-late").html("INTERNAL ERROR");
$("#invoice-deposit").html("INTERNAL ERROR");
<?php if (isset($lease['Lease']['id'])): ?>
$("#lease-id").val(<?php echo $lease['Lease']['id']; ?>);
//$("#invoice-lease").html("<?php echo '#'.$lease['Lease']['number']; ?>");
<?php if (empty($movein)): ?>
resetForm();
datepickerNow('TransactionStamp');
<?php else: ?>
var id;
resetForm(true);
$("#TransactionStamp").datepicker('disable');
$("#TransactionStamp").val("<?php echo date('m/d/Y', $movein['time']); ?>");
$('#TransactionStamp').after
('<input type="hidden"' +
' name="data[Transaction][stamp]"' +
' value="<?php echo date('m/d/Y', $movein['time']); ?>">');
$("#TransactionComment").val('Move-In Charges');
id = addChargeSource(false);
$('#Entry'+id+'Form').removeCol(2);
$('#Entry'+id+'Form input, #Entry'+id+'Form select').attr('disabled', true);
$('#Entry'+id+'EffectiveDate').val("<?php echo date('m/d/Y', $movein['effective_time']); ?>");
$('#Entry'+id+'EffectiveDate').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][effective_date]"' +
' value="<?php echo date('m/d/Y', $movein['effective_time']); ?>">');
$('#Entry'+id+'AccountId').val(<?php echo $securityDepositAccount; ?>);
$('#Entry'+id+'AccountId').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][account_id]"' +
' value="<?php echo $securityDepositAccount; ?>">');
$('#Entry'+id+'Amount').val("<?php echo FormatHelper::currency($movein['deposit']); ?>");
$('#Entry'+id+'Amount').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][amount]"' +
' value="<?php echo FormatHelper::currency($movein['deposit']); ?>">');
//$('#Entry'+id+'Comment').val('Move-In Security Deposit');
$('#Entry'+id+'Comment').removeAttr('disabled');
id = addChargeSource(false);
$('#Entry'+id+'Form').removeCol(2);
$('#Entry'+id+'Form input, #Entry'+id+'Form select').attr('disabled', true);
$('#Entry'+id+'EffectiveDate').val("<?php echo date('m/d/Y', $movein['effective_time']); ?>");
$('#Entry'+id+'EffectiveDate').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][effective_date]"' +
' value="<?php echo date('m/d/Y', $movein['effective_time']); ?>">');
$('#Entry'+id+'ThroughDate').val("<?php echo date('m/d/Y', $movein['through_time']); ?>");
$('#Entry'+id+'ThroughDate').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][through_date]"' +
' value="<?php echo date('m/d/Y', $movein['through_time']); ?>">');
$('#Entry'+id+'AccountId').val(<?php echo $rentAccount; ?>);
$('#Entry'+id+'AccountId').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][account_id]"' +
' value="<?php echo $rentAccount; ?>">');
$('#Entry'+id+'Amount').val("<?php echo FormatHelper::currency($movein['prorated_rent']); ?>");
$('#Entry'+id+'Amount').after
('<input type="hidden"' +
' name="data[Entry]['+id+'][amount]"' +
' value="<?php echo FormatHelper::currency($movein['prorated_rent']); ?>">');
$('#Entry'+id+'Comment').val('Move-In Rent'
<?php if ($movein['prorated']) echo "+ ' (Prorated)'" ?>);
$('#Entry'+id+'Comment').removeAttr('disabled');
<?php endif; ?>
<?php if (isset($lease['id'])): ?>
$("#lease-id").val(<?php echo $lease['id']; ?>);
//$("#invoice-lease").html("<?php echo '#'.$lease['number']; ?>");
$("#invoice-lease").html('<A HREF="/pmgr/site/leases/view/' +
"<?php echo $lease['Lease']['id']; ?>" +
"<?php echo $lease['id']; ?>" +
'">#' +
"<?php echo $lease['Lease']['number']; ?>" +
"<?php echo $lease['number']; ?>" +
'</A>');
$("#invoice-unit").html("<?php echo $lease['Unit']['name']; ?>");
$("#invoice-customer").html("<?php echo $lease['Customer']['name']; ?>");
$("#invoice-rent").html("<?php echo FormatHelper::currency($lease['Lease']['rent']); ?>");
$("#invoice-late").html('$10.00');
$("#invoice-deposit").html("<?php echo FormatHelper::currency($lease['Lease']['deposit']); ?>");
$("#invoice-unit").html("<?php echo $unit['name']; ?>");
$("#invoice-customer").html("<?php echo $customer['name']; ?>");
$("#invoice-rent").html("<?php echo FormatHelper::currency($lease['rent']); ?>");
$("#invoice-late").html("<?php echo FormatHelper::currency($defaultLate); ?>");
$("#invoice-deposit").html("<?php echo FormatHelper::currency($lease['deposit']); ?>");
onGridState(null, 'hidden');
<?php else: ?>
onGridState(null, 'visible');
@@ -317,5 +404,3 @@ echo $form->submit('Generate Invoice') . "\n";
--></script>
</div>
<a href="#" onClick="$('#debug').html(''); return false;">Clear Debug Output</a>

View File

@@ -41,6 +41,12 @@ function onRowSelect(grid_id, item_type, item_id) {
// Get the item name from the grid
$("#move-"+item_type).html($(grid_id).getCell(item_id, cell_name));
// If a unit was selected, update the rent and deposit
if (item_type == 'unit') {
$("#LeaseRent").val($(grid_id).getCell(item_id, 'Unit-rent'));
$("#LeaseDeposit").val($(grid_id).getCell(item_id, 'Unit-deposit'));
}
// Hide the "no customer" message and show the current customer
$("."+item_type+"-selection-invalid").hide();
$("."+item_type+"-selection-valid").show();
@@ -120,6 +126,8 @@ if ($move_type !== 'out') {
array('gridstate' =>
'onGridState("#"+$(this).attr("id"), "unit", gridstate)'),
),
'include' => array('Deposit'),
'exclude' => array('Balance'),
'action' => 'unoccupied',
'nolinks' => true,
'limit' => 10,
@@ -169,7 +177,20 @@ echo $this->element('form_table',
'id' => "LeaseMoveDate"),
'between' => '<A HREF="#" ONCLICK="datepickerNow(\'LeaseMoveDate\', false); return false;">Now</A>',
),
"comment" =>
) +
($move_type === 'in' ? array
("deposit" =>
array('opts' => array
('value' => (!empty($unit)
? FormatHelper::currency($unit['deposit'])
: null))),
"rent" =>
array('opts' => array
('value' => (!empty($unit)
? FormatHelper::currency($unit['rent'])
: null))),
) : array()) + array
("comment" =>
($move_type !== 'out'
? array('opts' => array('size' => 50))
: null),

View File

@@ -57,7 +57,7 @@ echo $this->element('table',
echo '<div class="infobox">' . "\n";
$rows = array();
$rows[] = array('Security Deposit:', FormatHelper::currency($outstandingDeposit));
$rows[] = array('Balance:', FormatHelper::currency($outstandingBalance));
$rows[] = array('Balance Owed:', FormatHelper::currency($outstandingBalance));
echo $this->element('table',
array('class' => 'summary',
'rows' => $rows,
@@ -84,7 +84,7 @@ echo '<div CLASS="detail supporting">' . "\n";
echo $this->element('statement_entries', array
(// Grid configuration
'config' => array
('caption' => 'Account',
('caption' => 'Lease Statement',
'filter' => array('Lease.id' => $lease['id']),
'include' => array('Through'),
'exclude' => array('Customer', 'Lease', 'Unit'),
@@ -93,6 +93,25 @@ echo $this->element('statement_entries', array
)));
/**********************************************************************
* Receipt History
*/
echo $this->element('ledger_entries', array
(// Grid configuration
'config' => array
('caption' => 'Customer Receipts',
'filter' => array('Customer.id' => $customer['id'],
'Transaction.type' => 'RECEIPT',
'Tender.id !=' => null,
//'Account.id !=' => '-AR-'
),
'exclude' => array('Account', 'Cr/Dr'),
'sort_column' => 'Date',
'sort_order' => 'DESC',
)));
/* End "detail supporting" div */
echo '</div>' . "\n";

View File

@@ -0,0 +1,91 @@
<?php /* -*- mode:PHP -*- */
echo '<div class="tender edit">' . "\n";
?>
<script type="text/javascript"><!--
function switchTenderType(base, radioid) {
var type_id = $("#"+radioid).val();
if (!$("#"+base+"-"+type_id).is(':visible')) {
$("."+base).slideUp();
$("#"+base+"-"+type_id).slideDown();
}
}
$(document).ready(function(){
switchTenderType("tender-type-div", "TenderTenderTypeId");
});
--></script>
<?php
; // align
echo $form->create('Tender', array('action' => 'edit')) . "\n";
echo $form->input('id') . "\n";
if (empty($this->data['Tender']))
INTERNAL_ERROR('Creation of new Tender not allowed.');
echo $form->input('tender_type_id',
array('div' => 'tender',
// REVISIT <AP>: 20090810
// We're not ready to allow changing the type
// of a tender, since it will force us to deal
// with changing the LedgerEntry account (easy)
// and the associated StatementEntry accounts
// (not too hard), and make sure the tender has
// not been deposited (easy), and then deal with
// any corner cases that pop up.
'disabled' => true,
'onclick' => ('switchTenderType(' .
'"tender-type-div", ' .
'$(this).attr("id")' .
')'),
)) . "\n";
$form->input('comment');
foreach ($types AS $type) {
$type = $type['TenderType'];
echo('<DIV' .
' ID="tender-type-div-'.$type['id'].'"' .
' CLASS="tender-type-div"' .
($type['id'] != $this->data['TenderType']['id']
? ' STYLE="display:none;"' : '') .
'>' . "\n");
echo ('<INPUT TYPE="hidden"' .
' NAME="data[type]['.$type['id'].'][tender_type_id]"' .
' VALUE="'.$type['id'].'"' .
'>' . "\n");
for ($i=1; $i<=4; ++$i) {
if (!empty($type["data{$i}_name"])) {
echo ("<!-- data{$i}_name -->\n");
echo $form->input("type.{$type['id']}.data$i",
array('label' => $type["data{$i}_name"],
'div' => 'input text tender',
'value' =>
($type['id'] == $this->data['TenderType']['id']
? $this->data['Tender']["data$i"] : null),
)) . "\n";
/* echo ('<DIV CLASS="input text required">' . */
/* ' <INPUT TYPE="text" SIZE="20"' . */
/* ' NAME="data[type]['.$type['id'].'][data'.$i.']"' . */
/* ' CLASS="tender"' . */
/* ' ID= */
/* '<LABEL' . */
/* ' CLASS="tender"' . */
/* ' FOR="tender-data'.$i.'">' . */
/* $type["data{$i}_name"] . */
/* '</LABEL>' . "\n" . */
/* '</DIV>' . "\n"); */
}
}
echo('</DIV>' . "\n");
}
echo $form->submit('Update') . "\n";
echo $form->submit('Cancel', array('name' => 'cancel')) . "\n";
echo $form->end() . "\n";
echo '</div>' . "\n";

View File

@@ -0,0 +1,74 @@
<?php /* -*- mode:PHP -*- */
echo '<div class="nsf input">' . "\n";
$customer = $tender['Customer'];
$entry = $tender['LedgerEntry'];
$transaction = $entry['Transaction'];
if (isset($tender['Tender']))
$tender = $tender['Tender'];
// We're not actually using a grid to select the customer,
// but selection-text makes for reasonable formatting
echo ('<DIV CLASS="nsf grid-selection-text">' .
'<TABLE>' . "\n");
echo ('<TR><TD style="padding-right: 1em;">' . $customer['name'] . '</TD>' .
' <TD>' . '(Customer #' . $customer['id'] . ')' . '</TD>' .
'</TR>' . "\n");
echo ('<TR><TD style="padding-right: 1em;">' . $tender['name'] . '</TD>' .
' <TD>' . '(Tender #' . $tender['id'] . ')' . '</TD>' .
'</TR>' . "\n");
echo ('<TR><TD style="padding-right: 1em;">Amount:</TD>' .
' <TD>' . FormatHelper::currency($entry['amount']) . '</TD>' .
'</TR>' . "\n");
echo ('</TABLE>' .
'</DIV>' . "\n");
echo $form->create(null, array('id' => 'nsf-form',
'url' => array('action' => 'nsf'))) . "\n";
echo $form->input("Tender.id",
array('type' => 'hidden',
'value' => $tender['id'])) . "\n";
echo $this->element('form_table',
array('class' => "item receipt transaction entry",
//'with_name_after' => ':',
'field_prefix' => 'Transaction',
'fields' => array
("stamp" => array('opts' => array('type' => 'text'),
'between' => '<A HREF="#" ONCLICK="datepickerNow(\'TransactionStamp\'); return false;">Now</A>',
),
"comment" => array('opts' => array('size' => 50),
),
))) . "\n";
echo $form->end('Record Item as NSF');
?>
<script type="text/javascript"><!--
// Reset the form
function resetForm() {
datepickerNow('TransactionStamp');
}
$(document).ready(function(){
$("#TransactionStamp")
.attr('autocomplete', 'off')
.datepicker({ constrainInput: true,
numberOfMonths: [1, 1],
showCurrentAtPos: 0,
dateFormat: 'mm/dd/yy' });
resetForm();
});
--></script>
</div>

View File

@@ -1,447 +0,0 @@
.GridHeader {
}
.Header {
width: 100%;
}
.Header th {
font-size: 100%; font-weight: bold; text-align: left;
padding: 2px;
background-image: url(images/headerbg.gif) ;
color: #FFFFFF;
width: 100%;
white-space: nowrap;
}
.HeaderLeft {
background-image: url(images/headerleft.gif);
}
.HeaderRight {
background-image: url(images/headerright.gif);
}
.HeaderButton {
background-image: url(images/headerbg.gif);
}
.HeaderButton img{
width: 17px;
}
.HeaderLeft img{
width: 14px;
}
.HeaderRight img{
width: 10px;
}
.GridHeader table {margin:0;}
.GridHeader td, tr {padding:0;}
/* Grid */
table.scroll {
table-layout: fixed;
/*border-right: 1px solid #D4D0C8;*/
margin-bottom:0;
}
table.scroll tbody tr {
background-color: #ffffff;
}
table.scroll tbody tr.alt {
background-color: #F9F9F9;
}
table.scroll tr.over td{
background-color: #E1DCF4;
}
table.scroll tr.selected td {
background: #3d84cc;
color: White;
}
table.scroll tbody td {
padding: 2px;
text-align: left;
border-bottom: 1px solid #D4D0C8;
border-left: 1px solid #D4D0C8;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
height : auto;
}
table.scroll thead th {
padding: 2px;
border-bottom: 1px solid #CBC7B8;
border-left: 1px solid #D4D0C8;
text-align: left;
font-weight: normal;
overflow: hidden;
white-space: nowrap;
background-image: url(images/grid-blue-hd.gif);
height : 17px;
}
table.scroll th div {
overflow: hidden;
/* white-space: nowrap;*/
word-wrap: break-word;
height : 17px;
}
table.scroll th span {
cursor: e-resize;
/* border-right: 1px solid #D6D2C2; */
width: 10px;
float: right;
display: block;
margin: -2px -1px -2px 0px;
height: 17px;
overflow: hidden;
white-space: nowrap;
}
/* End Grid */
/* Pager */
div.scroll {
vertical-align: top;
height: 23px;
white-space: nowrap;
text-align: center;
background-image: url(images/grid-blue-ft.gif);
}
div.scroll span {
vertical-align : top;
}
.selbox {
font-size: x-small;
vertical-align : top;
}
input.selbox{
font-size: x-small;
vertical-align : top;
}
.pgbuttons {
margin-top :2px;
}
.nav-table-left {
padding:1px;
float: left;
/* position:absolute;*/
}
.nav-table-right {
padding:1px;
float: right;
}
table.navtable {margin-bottom:0; width: auto;}
table.navtable tr{
background-image: url(images/grid-blue-ft.gif);
}
table.navtable td.nav-button {
border: 1px solid #E2ECF8;
white-space: nowrap;
}
table.navtable td.nav-hover {
border: 1px solid #83B4D8;
}
table.tbutton tr td{
border : none;
padding:0px;
}
img.jsHover { /*not used */
border: 1px solid #99CCFF;
}
/* End Pager */
/*multiselect checkbox */
.cbox {
height: 10px;
width: 10px;
/*border:1px solid #999;*/
}
/* end multiselect */
/* loading div */
div.loading {
position: absolute;
padding: 3px;
text-align: center;
font-weight: bold;
background: red;
color: white;
display: none;
}
div.loadingui {
display:none;
z-index:6000;
position:absolute;
}
div.loadingui div.msgbox {
position: relative;
z-index:6001;
left: 35%;
top:45%;
background: url(images/loading.gif) no-repeat left;
width: 100px;
border: 2px solid #B2D2FF;
text-align: right;
height: auto;
padding:2px;
margin: 0px;
}
/* end loading div */
/* toolbar */
div.userdata {
margin-top: 0px;
background-color : #EAF9F9;
height : 20px;
overflow: hidden;
}
/* end toolbar */
/*Subgrid text mode*/
.subgrid {
height: 100%;
overflow: auto;
}
.tablediv {
background-color: White;
border-spacing: 1px; /*cellspacing:poor IE support for this*/
border-collapse: separate;
width:100%; /* FF hack poor when scroling subgrid */
}
.celldiv {
float: left;
display: table-cell;
border: 1px dotted #CCCCCC;
overflow: auto;
white-space: normal;
}
.celldivth {
float: left; /*fix for buggy browsers*/
border: 1px solid #CCCCCC;
background-color: #99CCFF;
border-bottom: 1px solid #CBC7B8;
text-align: left;
overflow: auto;
}
.rowdiv {
display: table-row;
background: #F9F9F9 none;
color: #000000;
width: 100%;
overflow:auto;
}
/* End Subgrid */
/* InLine editing */
input.editable[type="text"] {
font-size: x-small;
overflow: hidden;
height : 15px;
}
input.editable[type="checkbox"] {
}
textarea.editable {
overflow: hidden;
}
select.editable {
font-size: x-small;
}
/* End Inline Editing */
/*Modal Window */
.modaltext{
text-align : left;
}
.modalwin{
border:1px solid #555555;
background:#F9F9F9;
text-align:left;
margin: 0 auto;
overflow: auto;
}
.modalhead {
background-image: url(images/grid-blue-hd.gif);
height: 20px;
}
.modalcontent {
overflow: auto;
margin-bottom: 9px;
margin-left: 5px;
}
/* end Modal window*/
/* Search window */
input.search {
margin: 2px;
width: 70px;
font-size: 10px;
color: #15428B;
}
select.search {
margin: 2px;
width: 70px;
font-size: 10px;
color: #15428B;
}
.buttonsearch {
width : 50px;
font-size: 10px;
color: #15428B;
}
/*End search */
/* Form edit */
.FormGrid {
margin: 0px;
}
.EditTable {
width: 100%;
}
.FormData { /* tr */
}
#FormError td {
font-size: 90%;
color: #FF0000;
vertical-align: top;
background-color: #f7f7f7;
}
.CaptionTD{ /* td */
font-weight: normal; text-align: left; vertical-align: top;
padding: 1px;
border-top: 1px solid #D4D0C8;
white-space: nowrap;
color: #000000;
}
.DataTD { /* td */
padding: 1px;
border-top: 1px solid #D4D0C8;
vertical-align: top;
}
.navButton{
border-top: 1px solid #D4D0C8;
border-bottom: 1px solid #D4D0C8;
text-align: center;
}
.navButton input{
width:17px;
}
input.EditButton { /* buttons are at footer tr */
font-size: 10px;
color: #15428B;
}
td.EditButton {
text-align: right;
border-top: 1px solid #D4D0C8;
border-bottom: 1px solid #D4D0C8;
}
.FormElement { /* form element - input -text,textarea,checkbox - select */
}
.FormElement {
font-size: 10px;
}
input[type="text"].FormElement{
color: #15428B;
}
input[type="checkbox"].FormElement{
width: 15px;
color: #15428B;
}
input[type="textarea"].FormElement{
color: #15428B;
}
select.FormElement {
font-size: 10px;
color: #15428B;
}
/* End Eorm edit */
/* Delete Dialog */
.DelButton > input { /* buttons are at footer tr */
font-size: 10px;
color: #15428B;
}
.DelButton {
text-align: right;
}
/* End Delete Dialog */
img.jqResize {
position:absolute;
bottom: 0px;
right: 0px;
cursor :se-resize;
}
.dirty-cell {
background: transparent url(images/dirty.gif) no-repeat 0 0;
}
#DelError td {
font-size: 90%;
color: #FF0000;
vertical-align: top;
background-color: #f7f7f7;
}
/* Tree Grid */
.tree-wrap
{
float: left;
position: relative;
height: 18px;
white-space: nowrap;
overflow: hidden;
}
.tree-minus
{
position: absolute;
height: 18px;
width: 16px;
overflow: hidden;
background: url(images/tree_minus.gif) no-repeat;
}
.tree-plus
{
position: absolute;
height: 18px;
width: 16px;
overflow: hidden;
background: url(images/tree_plus.gif) no-repeat;
}
.tree-leaf
{
position: absolute;
height: 18px;
width: 16px;
overflow: hidden;
background: url(images/tree_leaf.gif) no-repeat;
}
.treeclick
{
cursor: pointer;
}
.edit-cell {
background-color: #E1DCF4 !important;
}
.selected-row, .selected-row TD {
background-color: #3d84cc;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 821 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 957 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 925 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 879 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 830 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 833 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 312 B

View File

@@ -1,457 +0,0 @@
.GridHeader {
}
.Header {
width: 100%;
}
.Header th {
font-size: 100%; font-weight: bold; text-align: left;
padding: 2px;
background-image: url(images/headerbg.gif); color: #ffffff;
width: 100%;
white-space: nowrap;
}
.HeaderLeft {
background-image: url(images/headerleft.gif);
}
.HeaderRight {
background-image: url(images/headerright.gif);
}
.HeaderButton {
background-image: url(images/headerbg.gif);
}
.HeaderButton img{
width: 21px;
}
.HeaderLeft img{
width: 4px;
}
.HeaderRight img{
width: 9px;
}
.GridHeader table {margin:0;}
.GridHeader td, tr {padding:0;}
/* Grid */
table.scroll {
border-right: 1px solid #FFFFFF;
table-layout: fixed;
margin-bottom:0;
}
table.scroll tbody tr {
background-color: #eceae3;
}
table.scroll tbody tr.alt{
background-color: #e3dfd1;
}
table.scroll tr.over td{
background-color: #D2B48C;
}
table.scroll tr.selected td {
background-color: #c9b9b1;
color: Black;
}
table.scroll tbody tr td {
font-size: 90%;
padding: 2px;
text-align: left;
border-left: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
height : auto;
}
table.scroll thead tr th {
font-size: 90%;
font-weight: normal;
padding: 2px;
border-left: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
text-align: left;
overflow: hidden;
white-space: nowrap;
background: url(images/grid-blue-hd.gif) transparent repeat-x;
height : 18px;
}
table.scroll thead tr th div img {
width: 9px;
}
table.scroll th div {
overflow: hidden;
/* white-space: nowrap;*/
word-wrap: break-word;
height : 18px;
}
table.scroll th span {
cursor: e-resize;
/* border-right: 1px solid #D6D2C2; */
width: 5px;
float: right;
position: relative;
display: block;
margin: -1px -1px -1px 0px;
height: 18px;
overflow: hidden;
white-space: nowrap;
}
table.scroll thead {
}
/* End Grid */
/* Pager */
div.scroll {
vertical-align: top;
height: 23px;
text-align: center;
white-space: nowrap;
background-image: url(images/grid-blue-ft.gif);
border-right: 1px solid #FFFFFF;
border-left: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
}
div.scroll span {
vertical-align : top;
}
.selbox {
font-size: x-small;
vertical-align : top;
}
input.selbox{
font-size: x-small;
vertical-align : top;
}
.pgbuttons {
margin-top :1px;
}
.nav-table-left {
padding:1px;
float: left;
margin-top:2px;
/* position:absolute;*/
}
.nav-table-right {
padding:1px;
float: right;
margin-top:2px;
}
table.navtable {margin-bottom:0; width: auto;}
table.navtable tbody tr {
background-image: url(images/grid-blue-ft.gif);
}
table.navtable tbody tr td.nav-button {
border: 1px solid #FFFFFF;
white-space: nowrap;
}
table.navtable tbody tr td.nav-hover {
border: 1px solid #c9b9b1;
}
table.tbutton tbody tr td {
border : none;
padding:0px;
}
img.jsHover { /*not used */
border: 1px solid #99CCFF;
}
/* End Pager */
/*multiselect checkbox */
.cbox {
height: 10px;
width: 10px;
/* text-align: center;*/
/*border:1px solid #999;*/
}
/* end multiselect */
/* loading div */
div.loading {
position: absolute;
padding: 3px;
text-align: center;
font-weight: bold;
background: red;
color: white;
display: none;
}
div.loadingui {
display:none;
z-index:6000;
position:absolute;
}
div.loadingui div.msgbox {
position: relative;
z-index:6001;
left: 35%;
top:45%;
background: url(images/loading.gif) no-repeat left;
width: 100px;
border: 2px solid #B2D2FF;
text-align: right;
height: auto;
padding:2px;
margin: 0px;
}
/* end loading div */
/*toolbar */
div.userdata {
margin-top: 0px;
background-color : #e3dfd1;
height : 20px;
overflow: hidden;
}
/* end toolbar */
/*Subgrid text mode*/
.subgrid {
height: 100%;
overflow: auto;
}
.tablediv {
background-color: White;
border-spacing: 1px; /*cellspacing:poor IE support for this*/
border-collapse: separate;
width:100%; /* FF hack poor when scroling subgrid */
}
.celldiv {
float: left;
display: table-cell;
border: 1px dotted #CCCCCC;
overflow: auto;
white-space: normal;
}
.celldivth {
float: left; /*fix for buggy browsers*/
border: 1px solid #CCCCCC;
background-color: #99CCFF;
border-bottom: 1px solid #CBC7B8;
text-align: left;
overflow: auto;
}
.rowdiv {
display: table-row;
background: #F9F9F9 none;
color: #000000;
width: 100%;
overflow:auto;
}
/* End Subgrid */
/* InLine editing */
input.editable[type="text"] {
font-size: x-small;
overflow: hidden;
}
input.editable[type="checkbox"] {
}
textarea.editable {
overflow: hidden;
}
select.editable {
font-size: x-small;
}
/* End Inline Editing */
/*Modal Window */
.modaltext{
text-align : left;
}
.modalwin{
border:1px solid #555555;
background:#F9F9F9;
text-align:left;
margin: 0 auto;
overflow: auto;
}
.modalhead {
background-image: url(images/grid-blue-hd.gif);
height: 20px;
}
.modalcontent {
overflow: auto;
margin-bottom: 9px;
margin-left: 5px;
}
/* end Modal window*/
/* Search window */
input.search {
margin: 2px;
width: 70px;
font-size: 10px;
color: #15428B;
}
select.search {
margin: 2px;
width: 70px;
font-size: 10px;
color: #15428B;
}
.buttonsearch {
width : 50px;
font-size: 10px;
color: #15428B;
}
/*End search */
/* Form edit */
.FormGrid {
margin: 0px;
}
.EditTable {
width: 100%;
}
.FormData { /* tr */
}
#FormError td {
font-size: 90%;
color: #FF0000;
vertical-align: top;
background-color: #f7f7f7;
}
.CaptionTD{ /* td */
font-weight: normal; text-align: left; vertical-align: top;
padding: 1px;
border-top: 1px solid #D4D0C8;
white-space: nowrap;
color: #000000;
}
.DataTD { /* td */
padding: 1px;
border-top: 1px solid #D4D0C8;
vertical-align: top;
}
.navButton{
border-top: 1px solid #D4D0C8;
border-bottom: 1px solid #D4D0C8;
text-align: center;
}
.navButton input{
width:19px;
}
input.EditButton { /* buttons are at footer tr */
font-size: 10px;
color: #15428B;
}
td.EditButton {
text-align: right;
border-top: 1px solid #D4D0C8;
border-bottom: 1px solid #D4D0C8;
}
.FormElement { /* form element - input -text,textarea,checkbox - select */
}
.FormElement {
font-size: 10px;
}
input[type="text"].FormElement{
color: #15428B;
}
input[type="checkbox"].FormElement{
width: 15px;
color: #15428B;
}
input[type="textarea"].FormElement{
color: #15428B;
}
select.FormElement {
font-size: 10px;
color: #15428B;
}
/* End Eorm edit */
/* Delete Dialog */
.DelButton > input { /* buttons are at footer tr */
font-size: 10px;
color: #15428B;
}
.DelButton {
text-align: right;
}
/* End Delete Dialog */
img.jqResize {
position:absolute;
bottom: 0px;
right: 0px;
cursor :se-resize;
}
.dirty-cell {
background: transparent url(images/dirty.gif) no-repeat 0 0;
}
#DelError td {
font-size: 90%;
color: #FF0000;
vertical-align: top;
background-color: #f7f7f7;
}
/* Tree Grid */
.tree-wrap
{
float: left;
position: relative;
height: 18px;
white-space: nowrap;
overflow: hidden;
}
.tree-minus
{
position: absolute;
height: 18px;
width: 16px;
overflow: hidden;
background: url(images/tree_minus.gif) no-repeat;
}
.tree-plus
{
position: absolute;
height: 18px;
width: 16px;
overflow: hidden;
background: url(images/tree_plus.gif) no-repeat;
}
.tree-leaf
{
position: absolute;
height: 18px;
width: 16px;
overflow: hidden;
background: url(images/tree_leaf.gif) no-repeat;
}
.treeclick
{
cursor: pointer;
}
.edit-cell {
background-color: #D2B48C !important;
}
.selected-row, .selected-row TD {
background-color: #c9b9b1;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 832 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 683 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 734 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 235 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 479 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 862 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 634 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 113 B

Some files were not shown because too many files have changed in this diff Show More