"grocery" catchall billing
authormiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 17 Nov 2005 20:22:02 +0000 (20:22 +0000)
committermiker <miker@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 17 Nov 2005 20:22:02 +0000 (20:22 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2060 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/Application/Storage/CDBI.pm
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/Pg/080.schema.money.sql

index 657af02..5c2dec8 100644 (file)
@@ -553,6 +553,9 @@ sub modify_from_fieldmapper {
        money::billable_transaction->has_many( billings => 'money::billing' );
        money::billable_transaction->has_many( payments => 'money::payment' );
 
        money::billable_transaction->has_many( billings => 'money::billing' );
        money::billable_transaction->has_many( payments => 'money::payment' );
 
+       money::grocery->has_many( billings => 'money::billing' );
+       money::grocery->has_many( payments => 'money::payment' );
+
        money::billing->has_a( xact => 'money::billable_transaction' );
        money::payment->has_a( xact => 'money::billable_transaction' );
 
        money::billing->has_a( xact => 'money::billable_transaction' );
        money::payment->has_a( xact => 'money::billable_transaction' );
 
index 6661bac..70e7cb3 100644 (file)
@@ -10,8 +10,14 @@ package money::billable_transaction;
 use base qw/money/;
 __PACKAGE__->table('money_billable_xact');
 __PACKAGE__->columns(Primary => 'id');
 use base qw/money/;
 __PACKAGE__->table('money_billable_xact');
 __PACKAGE__->columns(Primary => 'id');
-__PACKAGE__->columns(Essential => qw/xact_start usr/);
-__PACKAGE__->columns(Others => qw/xact_finish/);
+__PACKAGE__->columns(Essential => qw/xact_start usr xact_finish/);
+#-------------------------------------------------------------------------------
+
+package money::grocery;
+use base qw/money/;
+__PACKAGE__->table('money_grocery');
+__PACKAGE__->columns(Primary => 'id');
+__PACKAGE__->columns(Essential => qw/xact_start usr billing_location note xact_finish/);
 #-------------------------------------------------------------------------------
 
 package money::open_user_summary;
 #-------------------------------------------------------------------------------
 
 package money::open_user_summary;
index 7a0886e..65ab7de 100644 (file)
@@ -1,5 +1,11 @@
 {
        #---------------------------------------------------------------------
 {
        #---------------------------------------------------------------------
+       package money::grocery;
+       
+       money::grocery->table( 'money.grocery' );
+       money::grocery->sequence( 'money.billable_xact_id_seq' );
+
+       #---------------------------------------------------------------------
        package money::billable_transaction;
        
        money::billable_transaction->table( 'money.billable_xact' );
        package money::billable_transaction;
        
        money::billable_transaction->table( 'money.billable_xact' );
index 86e9702..174e98c 100644 (file)
@@ -143,6 +143,7 @@ sub _init {
 
                'Fieldmapper::money::billing'                   => { hint => 'mb'  },
                'Fieldmapper::money::billable_transaction'      => { hint => 'mbt'  },
 
                'Fieldmapper::money::billing'                   => { hint => 'mb'  },
                'Fieldmapper::money::billable_transaction'      => { hint => 'mbt'  },
+               'Fieldmapper::money::grocery'                   => { hint => 'mg'  },
 
                'Fieldmapper::money::open_user_summary'         => { hint       => 'mous',
                                                                     readonly   => 1 },
 
                'Fieldmapper::money::open_user_summary'         => { hint       => 'mous',
                                                                     readonly   => 1 },
index 14cab10..4655150 100644 (file)
@@ -12,6 +12,11 @@ CREATE TABLE money.billable_xact (
 );
 CREATE INDEX m_b_x_open_xacts_idx ON money.billable_xact (usr) WHERE xact_finish IS NULL;
 
 );
 CREATE INDEX m_b_x_open_xacts_idx ON money.billable_xact (usr) WHERE xact_finish IS NULL;
 
+CREATE TABLE money.grocery ( -- Catchall table for local billing
+       billing_location        INT     NOT NULL, -- library creating transaction
+       note                    TEXT
+) INHERITS (money.billable_xact);
+
 CREATE TABLE money.billing (
        id              BIGSERIAL                       PRIMARY KEY,
        xact            BIGINT                          NOT NULL, -- money.billable_xact.id
 CREATE TABLE money.billing (
        id              BIGSERIAL                       PRIMARY KEY,
        xact            BIGINT                          NOT NULL, -- money.billable_xact.id