Fixed the customer selection update for receipts, and added a mechanism to automatically update the oustanding charges grid after entering the receipt.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716/site@496 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-08-06 18:08:21 +00:00
parent b900e49f54
commit a2aa612a5e
2 changed files with 28 additions and 11 deletions

View File

@@ -423,8 +423,8 @@ class CustomersController extends AppController {
$this->layout = null;
$this->autoLayout = false;
$this->autoRender = false;
//Configure::write('debug', '0');
//header("Content-type: text/xml;charset=utf-8");
Configure::write('debug', '0');
header("Content-type: text/xml;charset=utf-8");
App::import('Helper', 'Xml');
$xml = new XmlHelper();
@@ -432,16 +432,22 @@ class CustomersController extends AppController {
// Find the unreconciled entries, then manipulate the structure
// slightly to accomodate the format necessary for XML Helper.
$unreconciled = $this->Customer->unreconciledCharges($id);
foreach ($unreconciled['entries'] AS &$entry)
$entry = array_intersect_key($entry['StatementEntry'],
array('id'=>1));
$unreconciled = array('entries' =>
array_intersect_key($unreconciled['debit'],
array('entry'=>1, 'balance'=>1)));
array('entry' => $unreconciled['entries'],
'balance' => $unreconciled['summary']['balance']));
// XML Helper will dump an empty tag if the array is empty
if (!count($unreconciled['entries']['entry']))
if (empty($unreconciled['entries']['entry']))
unset($unreconciled['entries']['entry']);
//pr($unreconciled);
//$reconciled = $cust->reconcileNewStatementEntry($cust_id, 'credit', $amount);
/* pr(compact('unreconciled')); */
/* echo htmlspecialchars($xml->serialize($unreconciled)); */
/* $this->render('/fake'); */
$opts = array();
//$opts['format'] = 'tags';