Added ACH and Concession entry. Like everything else, I haven't tested too robustly, but it does seem to work. I might want to change the monetary source id for Concession. Right now each concession gets its own monetary source, but we could probably use a common one without issue.

git-svn-id: file:///svn-source/pmgr/branches/invoice_receipt_20090629@284 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-09 06:10:00 +00:00
parent 5a4cfb0581
commit 1afaede12a
3 changed files with 51 additions and 28 deletions

View File

@@ -37,14 +37,14 @@ Operations to be functional
X - Create Customer ID/Account
X - Add Contact information to Customer
X - Move Customer into Unit
- Enter Rent Concessions given
X - Enter Rent Concessions given
X - Asses Rent Charges
X - Asses Late Charges
X - Asses Security Deposits
X - Receive and record Checks
X - Receive and record Money Orders
X - Receive and record Cash
- Receive and record ACH Deposits
X - Receive and record ACH Deposits
- Handle NSF checks
- Assess NSF Fees
- Determine Lease Paid-Through status

View File

@@ -180,12 +180,16 @@ class Transaction extends AppModel {
$this->LedgerEntry->MonetarySource->MonetaryType
->nameToID($entry['monetary_type_name']);
$entry['MonetarySource']['name'] =
$this->LedgerEntry->MonetarySource->MonetaryType
->nameToID($entry['monetary_type_name']);
if (!isset($entry['MonetarySource']['monetary_type_id'])) {
$entry['MonetarySource']['name'] = 'Other';
$entry['MonetarySource']['monetary_type_id'] =
$this->LedgerEntry->MonetarySource->MonetaryType
->nameToID('Other Non-Tillable');
} else {
$entry['MonetarySource']['name'] = $entry['monetary_type_name'];
}
// Give it a fancy name based on the check number
$entry['MonetarySource']['name'] = $entry['monetary_type_name'];
if ($entry['monetary_type_name'] === 'Check' ||
$entry['monetary_type_name'] === 'Money Order') {
$entry['MonetarySource']['name'] .=
@@ -193,6 +197,18 @@ class Transaction extends AppModel {
}
}
// Determine which account we'll use for the ledger entry
$account_name = $entry['monetary_type_name'];
// REVISIT <AP>: 20090708
// I _hate_ hardcoding values, but I'm not sure how
// else to handle this at the moment. I'm pretty sure
// what needs to happen is for the account information
// to be figured out programatically on the receipt
// presentation page, and then those values would flow
// back after entry to here.
if ($account_name === 'ACH')
$account_name = 'Bank';
// This entry of physical money is part of the receipt transaction
// debit: Cash/Check/Etc credit: Receipt
@@ -200,7 +216,7 @@ class Transaction extends AppModel {
// Receipt must debit the "money" asset (bank, cash, check, etc)...
$entry['debit_ledger_id']
= $A->currentLedgerID($A->nameToID($entry['monetary_type_name']));
= $A->currentLedgerID($A->nameToID($account_name));
// ...and credit the Receipt ledger
$entry['credit_ledger_id']

View File

@@ -168,20 +168,25 @@ function addPaymentSource(flash) {
'<FIELDSET CLASS="payment subset">' +
'<LEGEND>Payment #%{id} (%{remove})</LEGEND>' +
'<DIV ID="payment-type-div-%{id}">' +
'<DIV ID="payment-div-%{id}">' +
<?php
$types = array();
foreach(array('Cash', 'Check', 'Money Order', /*'ACH', 'Credit Card'*/) AS $name)
$types[preg_replace("/ /", "", strtolower($name))] = $name;
foreach(array('Cash', 'Check', 'Money Order', 'ACH', /*'Credit Card'*/ 'Concession') AS $name) {
$type = preg_replace("/ /", "", strtolower($name));
$acct = $name;
/* if ($acct === 'ACH') */
/* $acct = 'Bank'; */
$types[] = array('key' => $type, 'name' => $name, 'acct' => $acct);
}
foreach ($types AS $type => $name) {
foreach ($types AS $type) {
$div = '<DIV>';
$div .= '<INPUT TYPE="radio" NAME="data[LedgerEntry][%{id}][monetary_type_name]"';
$div .= ' ONCLICK="switchPaymentType(%{id}, \\\''.$type.'\\\')"';
$div .= ' CLASS="payment-type-%{id}" ID="payment-type-'.$type.'-%{id}"';
$div .= ' VALUE="'.$name.'" ' . ($name == 'Cash' ? 'CHECKED ' : '') . '/>';
$div .= ' <LABEL FOR="payment-type-'.$type.'-%{id}">'.$name.'</LABEL>';
$div .= ' ONCLICK="switchPaymentType(\\\'payment-type-div\\\', %{id}, \\\''.$type['key'].'\\\')"';
$div .= ' CLASS="payment-radio-%{id}" ID="payment-radio-%{id}-'.$type['key'].'"';
$div .= ' VALUE="'.$type['acct'].'" ' . ($type['name'] == 'Cash' ? 'CHECKED ' : '') . '/>';
$div .= ' <LABEL FOR="payment-radio-%{id}-'.$type['key'].'">'.$type['name'].'</LABEL>';
$div .= '</DIV>';
echo "'$div' +\n";
}
@@ -196,12 +201,9 @@ function addPaymentSource(flash) {
'</DIV>' +
<?php
foreach ($types AS $type => $name) {
if ($type == 'cash')
continue;
foreach ($types AS $type) {
$div = '<DIV';
$div .= ' ID="payment-'.$type.'-div-%{id}"';
$div .= ' ID="payment-type-div-%{id}-'.$type['key'].'"';
$div .= ' CLASS="payment-type-div-%{id}"';
$div .= ' STYLE="display:none;">';
$div .= '</DIV>';
@@ -213,14 +215,16 @@ function addPaymentSource(flash) {
);
}
function switchPaymentType(paymentid, type) {
$(".payment-type-div-"+paymentid).slideUp();
$(".payment-type-div-"+paymentid).html('');
function switchPaymentType(paymentid_base, paymentid, type) {
$("."+paymentid_base+"-"+paymentid).slideUp();
$("."+paymentid_base+"-"+paymentid).html('');
var html;
switch(type)
{
case 'cash':
break;
return;
case 'check':
html =
@@ -283,13 +287,16 @@ function switchPaymentType(paymentid, type) {
'</DIV>';
break;
case 'concession':
return;
default:
html = '<DIV><H2>INVALID TYPE ('+type+')</H2></DIV>';
html = '<H2>INVALID TYPE ('+type+')</H2>';
break;
}
$("#payment-"+type+"-div-"+paymentid).html(html);
$("#payment-"+type+"-div-"+paymentid).slideDown();
$("#"+paymentid_base+"-"+paymentid+"-"+type).html(html);
$("#"+paymentid_base+"-"+paymentid+"-"+type).slideDown();
}