Added some changes to try and resolve some accounting problems. However, I may be about to redo the accounting stuff altogether.
git-svn-id: file:///svn-source/pmgr/branches/initial_20090526@67 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -435,7 +435,7 @@ foreach $row (@$result) {
|
||||
my $cid = $tenant_map{$row->{'TenantID'}}{'id'};
|
||||
|
||||
$query = "INSERT INTO pmgr_contacts
|
||||
(`id`, `first_name`, `middle_name`, `last_name`, `display_name`, `id_num`, `id_state`)
|
||||
(`id`, `first_name`, `middle_name`, `last_name`, `display_name`, `id_local`, `id_local_state`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
($cid, $row->{'FirstName'}, $row->{'MiddleName'}, $row->{'LastName'},
|
||||
@@ -739,6 +739,186 @@ foreach $row (@$result) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$query = "INSERT INTO pmgr_charges
|
||||
(`id`, `charge_type_id`, `lease_id`,
|
||||
`charge_date`, `charge_to_date`,
|
||||
`amount`, `tax`, `total`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(1000, $charge_type_map{'Security Deposit'}, 17,
|
||||
'2009-05-05', undef,
|
||||
10, 0, 10,
|
||||
'Fake security deposit for testing purposes')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_charges
|
||||
(`id`, `charge_type_id`, `lease_id`,
|
||||
`charge_date`, `charge_to_date`,
|
||||
`amount`, `tax`, `total`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(1001, $charge_type_map{'Rent'}, 17,
|
||||
'2009-05-01', '2009-05-31',
|
||||
100, 5, 105,
|
||||
'Fake charge for testing purposes')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_charges
|
||||
(`id`, `charge_type_id`, `lease_id`,
|
||||
`charge_date`, `charge_to_date`,
|
||||
`amount`, `tax`, `total`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(1002, $charge_type_map{'Late Fee'}, 17,
|
||||
'2009-05-11', undef,
|
||||
25, 0, 25,
|
||||
'Fake late charge for testing purposes')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_receipts
|
||||
(`id`, `stamp`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(2000, '2009-05-15', 'Fake receipt #1')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3000, 2000, 1, 15, 'Fake receipt #1 payment #1')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3001, 2000, 2, 10, 'Fake receipt #1 payment #2')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3002, 2000, 3, 5, 'Fake receipt #1 payment #3')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_charges_receipts
|
||||
(`charge_id`, `receipt_id`, `amount`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(1000, 2000, 10)
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_charges_receipts
|
||||
(`charge_id`, `receipt_id`, `amount`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(1001, 2000, 20)
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
|
||||
$query = "INSERT INTO pmgr_receipts
|
||||
(`id`, `stamp`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(2100, '2009-05-18', 'Fake receipt #2')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3100, 2100, 5, 30, 'Fake receipt #2 payment #1')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3101, 2100, 6, 20, 'Fake receipt #2 payment #2')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_charges_receipts
|
||||
(`charge_id`, `receipt_id`, `amount`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(1001, 2100, 50)
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
|
||||
$query = "INSERT INTO pmgr_receipts
|
||||
(`id`, `stamp`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(2200, '2009-05-22', 'Fake receipt #3')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3200, 2200, 1, 10, 'Fake receipt #3 payment #1')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3201, 2200, 2, 5, 'Fake receipt #3 payment #2')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3202, 2200, 7, 20, 'Fake receipt #3 payment #3')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_payments
|
||||
(`id`, `receipt_id`, `payment_type_id`, `amount`, `comment`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(3203, 2200, 8, 15, 'Fake receipt #3 payment #4')
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_charges_receipts
|
||||
(`charge_id`, `receipt_id`, `amount`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(1001, 2200, 35)
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
$query = "INSERT INTO pmgr_charges_receipts
|
||||
(`charge_id`, `receipt_id`, `amount`)
|
||||
VALUES (" .
|
||||
join(", ", map({defined $_ ? "'$_'" : "NULL"}
|
||||
(1002, 2200, 15)
|
||||
)) . ")";
|
||||
query($db_handle, $query) || die("Unable to insert");
|
||||
|
||||
|
||||
__END__
|
||||
|
||||
######################################################################
|
||||
|
||||
Reference in New Issue
Block a user