Changed 'payment' to 'tender', since the payment term has been heavily overloaded. Tender represents legal tender, and replaces what used to be monetary source. I'm not terribly fond of the name, especially the plural form. However, for now at least, it can be distinct from other types of 'payment' and we can change it later if we come up with a better name. Also, added a name to ledger, since one was being manually created at runtime in several spots. This should allow us to consolidate the naming convention to a single spot.

git-svn-id: file:///svn-source/pmgr/branches/yafr_20090716@366 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
abijah
2009-07-22 23:35:41 +00:00
parent c596dfa5f0
commit 8cf8f65474
2 changed files with 10 additions and 7 deletions

View File

@@ -927,6 +927,8 @@ DROP TABLE IF EXISTS `pmgr_ledgers`;
CREATE TABLE `pmgr_ledgers` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(90) NOT NULL,
`account_id` INT(10) UNSIGNED NOT NULL,
`sequence` INT(10) UNSIGNED DEFAULT 1,
@@ -1094,14 +1096,14 @@ CREATE TABLE `pmgr_statement_entries` (
-- ----------------------------------------------------------------------
-- ----------------------------------------------------------------------
-- TABLE pmgr_payments
-- TABLE pmgr_tenders
DROP TABLE IF EXISTS `pmgr_payments`;
CREATE TABLE `pmgr_payments` (
DROP TABLE IF EXISTS `pmgr_tenders`;
CREATE TABLE `pmgr_tenders` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
-- name may (or may not) be used to clarify in reports
-- for example, 'Check #1234' as the payment name.
-- for example, 'Check #1234' as the legal tender name.
`name` VARCHAR(80) DEFAULT NULL,
-- REVISIT <AP>: 20090716
@@ -1136,7 +1138,7 @@ CREATE TABLE `pmgr_payments` (
`data4` VARCHAR(80) DEFAULT NULL,
-- The ledger entry this physical payment applies to
-- The ledger entry this legal tender applies to
`ledger_entry_id` INT(10) UNSIGNED NOT NULL,
-- The deposit transaction that included these monies
`deposit_transaction_id` INT(10) UNSIGNED DEFAULT NULL,

View File

@@ -505,6 +505,7 @@ $result = query($db_handle, $query);
foreach $row (@$result) {
addRow('ledgers', {
'account_id' => $row->{'id'},
'name' => $row->{'id'} . '-1',
'comment' => undef });
$newdb{'lookup'}{'account'}{$row->{'name'}}
@@ -1161,7 +1162,7 @@ foreach $row (@{query($sdbh, $query)}) {
= $newdb{'tables'}{'double_entries'}{'autoid'};
# Add the physical payment
addRow('payments', {
addRow('tenders', {
'ledger_entry_id' => $newdb{'lookup'}{'receipt'}{$row->{'ReceiptNum'}}{$row->{'PaymentType'}}{'debit_entry_id'},
'name' => $newdb{'lookup'}{'receipt'}{$row->{'ReceiptNum'}}{$row->{'PaymentType'}}{'name'},
'type' => $newdb{'lookup'}{'receipt'}{$row->{'ReceiptNum'}}{$row->{'PaymentType'}}{'type'},
@@ -1170,7 +1171,7 @@ foreach $row (@{query($sdbh, $query)}) {
});
$newdb{'lookup'}{'receipt'}{$row->{'ReceiptNum'}}{$row->{'PaymentType'}}{'payment_id'}
= $newdb{'tables'}{'payments'}{'autoid'};
= $newdb{'tables'}{'tenders'}{'autoid'};
}