view-izing the base payment table and adding the "payment_type" field
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Jul 2005 18:16:40 +0000 (18:16 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Jul 2005 18:16:40 +0000 (18:16 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1341 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI/money.pm
Open-ILS/src/perlmods/OpenILS/Application/Storage/Driver/Pg/dbi.pm
Open-ILS/src/perlmods/OpenILS/Utils/Fieldmapper.pm
Open-ILS/src/sql/Postgres/080.schema.money.sql

index 32c2568..1f3daa6 100644 (file)
@@ -48,7 +48,7 @@ package money::payment;
 use base qw/money/;
 __PACKAGE__->table('money_payment');
 __PACKAGE__->columns(Primary => 'id');
-__PACKAGE__->columns(Essential => qw/xact amount payment_ts/);
+__PACKAGE__->columns(Essential => qw/xact amount payment_ts payment_type/);
 __PACKAGE__->columns(Others => qw/note/);
 #-------------------------------------------------------------------------------
 
index 5c13c91..c42791d 100644 (file)
@@ -14,8 +14,7 @@
        #---------------------------------------------------------------------
        package money::payment;
        
-       money::payment->table( 'money.payment' );
-       money::payment->sequence( 'money.payment_id_seq' );
+       money::payment->table( 'money.payment_view' );
 
        #---------------------------------------------------------------------
        package money::cash_payment;
index 9b55f88..98fab9d 100644 (file)
@@ -128,7 +128,9 @@ sub _init {
                                                                                             fixed_fields => 1 } },
                #'Fieldmapper::biblio::record_marc'             => { hint => 'brx'  }, # now it's inside record_entry
 
-               'Fieldmapper::money::payment'                   => { hint => 'mp'  },
+               'Fieldmapper::money::payment'                   => { hint => 'mp',
+                                                                    readonly   => 1 },
+
                'Fieldmapper::money::cash_payment'              => { hint => 'mcp'  },
                'Fieldmapper::money::check_payment'             => { hint => 'mckp'  },
                'Fieldmapper::money::credit_payment'            => { hint => 'mcrp'  },
index 2328c33..19ee3b1 100644 (file)
@@ -32,6 +32,12 @@ CREATE TABLE money.payment (
 );
 CREATE INDEX m_p_xact_idx ON money.payment (xact);
 
+CREATE OR REPLACE VIEW money.payment_view AS
+       SELECT  p.*,c.relname AS payment_type
+         FROM  money.payment p
+               JOIN pg_class c ON (p.tableoid = c.oid);
+
+
 CREATE OR REPLACE VIEW money.billable_xact_summary AS
        SELECT  xact.id AS id,
                xact.usr AS usr,