Index: pykota/trunk/initscripts/ldap/pykota.schema
===================================================================
--- pykota/trunk/initscripts/ldap/pykota.schema (revision 2146)
+++ pykota/trunk/initscripts/ldap/pykota.schema (revision 2317)
@@ -226,4 +226,31 @@
         SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE )
         
+# pykotaPrecomputedJobSize
+attributetype ( 1.3.6.1.4.1.16868.1.1.33 NAME 'pykotaPrecomputedJobSize'
+        DESC 'Precomputed job size in number of pages in the history'
+        EQUALITY integerMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+
+# pykotaPrecomputedJobPrice
+attributetype ( 1.3.6.1.4.1.16868.1.1.34 NAME 'pykotaPrecomputedJobPrice'
+        DESC 'Precomputed Price of a particular job in the history, float'
+        EQUALITY caseIgnoreIA5Match
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+        
+# pykotaMaxJobSize
+attributetype ( 1.3.6.1.4.1.16868.1.1.35 NAME 'pykotaMaxJobSize'
+        DESC 'Maximum size allowed for a job'
+        EQUALITY integerMatch
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+
+# pykotaTemporaryDenied
+attributetype ( 1.3.6.1.4.1.16868.1.1.36 NAME 'pykotaTemporaryDenied'
+        DESC 'Indicates if the user is temporarily denied to print'
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
+
+# pykotaPassThrough
+attributetype ( 1.3.6.1.4.1.16868.1.1.37 NAME 'pykotaPassThrough'
+        DESC 'Indicates if the printer is in pass through mode'
+        SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE )
 
 #        
@@ -235,5 +262,5 @@
         DESC 'PyKota Auxiliary User Account'
         MUST ( uid )
-        MAY  ( pykotaUserName $ pykotaLimitBy $ mail ) )
+        MAY  ( pykotaUserName $ pykotaLimitBy $ mail $ description ) )
         
 # pykotaGroup        
@@ -241,5 +268,5 @@
         DESC 'PyKota Auxiliary Group'
         MUST ( cn )
-        MAY  ( pykotaGroupName $ pykotaLimitBy $ memberUid $ uniqueMember $ member ) )
+        MAY  ( pykotaGroupName $ pykotaLimitBy $ memberUid $ uniqueMember $ member $ description ) )
         
 # pykotaPrinter        
@@ -247,5 +274,5 @@
         DESC 'PyKota Printer'
         MUST ( cn )
-        MAY  ( description $ pykotaPrinterName $ pykotaPricePerPage $ pykotaPricePerJob $ pykotaPrinterCoefficient $ uniqueMember ) )
+        MAY  ( pykotaMaxJobSize $ pykotaPassThrough $ description $ pykotaPrinterName $ pykotaPricePerPage $ pykotaPricePerJob $ pykotaPrinterCoefficient $ uniqueMember ) )
         
 # pykotaUserPQuota        
@@ -253,5 +280,5 @@
         DESC 'PyKota User Quota on a Printer'
         MUST ( cn $ pykotaUserName $ pykotaPrinterName )
-        MAY  ( pykotaPageCounter $ pykotaLifePageCounter $ pykotaSoftLimit $ pykotaHardLimit $ pykotaDateLimit $ pykotaWarnCount ) )
+        MAY  ( pykotaMaxJobSize $ pykotaTemporaryDenied $ pykotaPageCounter $ pykotaLifePageCounter $ pykotaSoftLimit $ pykotaHardLimit $ pykotaDateLimit $ pykotaWarnCount ) )
         
 # pykotaGroupPQuota        
@@ -259,5 +286,5 @@
         DESC 'PyKota Group Quota on a Printer'
         MUST ( cn $ pykotaGroupName $ pykotaPrinterName )
-        MAY  ( pykotaSoftLimit $ pykotaHardLimit $ pykotaDateLimit ) )
+        MAY  ( pykotaMaxJobSize $ pykotaSoftLimit $ pykotaHardLimit $ pykotaDateLimit ) )
         
 # pykotaJob        
@@ -265,5 +292,5 @@
         DESC 'An entry in the job history for a printer'
         MUST ( cn $ pykotaUserName $ pykotaPrinterName $ pykotaJobId )
-        MAY  ( pykotaBillingCode $ pykotaPrinterPageCounter $ pykotaJobSize $ pykotaAction $ pykotaJobPrice $ pykotaFileName $ pykotaTitle $ pykotaCopies $ pykotaOptions $ pykotaHostName $ pykotaJobSizeBytes $ pykotaMD5Sum $ pykotaPages ) )
+        MAY  ( pykotaPrecomputedJobPrice $ pykotaPrecomputedJobSize $ pykotaBillingCode $ pykotaPrinterPageCounter $ pykotaJobSize $ pykotaAction $ pykotaJobPrice $ pykotaFileName $ pykotaTitle $ pykotaCopies $ pykotaOptions $ pykotaHostName $ pykotaJobSizeBytes $ pykotaMD5Sum $ pykotaPages ) )
         
 # pykotaAccountBalance
@@ -278,4 +305,10 @@
         MAY ( pykotaPrinterName ) ) 
         
+# pykotaBilling
+objectclass ( 1.3.6.1.4.1.16868.1.2.10 NAME 'pykotaBilling' SUP top AUXILIARY
+        DESC 'Allowed billing codes'
+        MUST ( cn $ pykotaBillingCode )
+        MAY ( pykotaPageCounter $ pykotaBalance ) )
+        
 # pykotaObject - Use it if you have to 
 objectclass ( 1.3.6.1.4.1.16868.1.2.9 NAME 'pykotaObject' SUP top STRUCTURAL
Index: pykota/trunk/initscripts/postgresql/pykota-postgresql.sql
===================================================================
--- pykota/trunk/initscripts/postgresql/pykota-postgresql.sql (revision 2303)
+++ pykota/trunk/initscripts/postgresql/pykota-postgresql.sql (revision 2317)
@@ -53,4 +53,5 @@
                    lifetimepaid FLOAT DEFAULT 0.0,
                    limitby TEXT DEFAULT 'quota',
+                   description TEXT,
                    overcharge FLOAT NOT NULL DEFAULT 1.0);
                    
@@ -60,4 +61,5 @@
 CREATE TABLE groups(id SERIAL PRIMARY KEY NOT NULL,
                     groupname TEXT UNIQUE NOT NULL,
+                    description TEXT,
                     limitby TEXT DEFAULT 'quota');
                     
@@ -69,5 +71,7 @@
                       description TEXT,
                       priceperpage FLOAT DEFAULT 0.0,
-                      priceperjob FLOAT DEFAULT 0.0);
+                      priceperjob FLOAT DEFAULT 0.0,
+                      passthrough BOOLEAN DEFAULT 'f',
+                      maxjobsize INT4);
                     
 --
@@ -82,4 +86,6 @@
                         hardlimit INT4,
                         datelimit TIMESTAMP,
+                        maxjobsize INT4,
+                        temporarydenied BOOLEAN DEFAULT 'f',
                         warncount INT4 DEFAULT 0); 
 CREATE INDEX userpquota_u_id_ix ON userpquota (userid);
@@ -107,4 +113,6 @@
                         pages TEXT,
                         billingcode TEXT,
+                        precomputedjobsize INT4,
+                        precomputedjobprice FLOAT,
                         jobdate TIMESTAMP DEFAULT now(),
                         CONSTRAINT checkUserPQuota FOREIGN KEY (userid, printerid) REFERENCES userpquota(userid, printerid));
@@ -122,4 +130,5 @@
                          softlimit INT4,
                          hardlimit INT4,
+                         maxjobsize INT4,
                          datelimit TIMESTAMP);
 CREATE INDEX grouppquota_g_id_ix ON grouppquota (groupid);
@@ -158,12 +167,20 @@
                            CONSTRAINT coeffconstraint UNIQUE (printerid, label));
 
+-- 
+-- Create the table for the billing codes
+--
+CREATE TABLE billingcodes (id SERIAL PRIMARY KEY NOT NULL,
+                           label TEXT UNIQUE NOT NULL,
+                           balance FLOAT DEFAULT 0.0,
+                           pagecounter INT4 DEFAULT 0);
+
 --                        
 -- Set some ACLs                        
 --
-REVOKE ALL ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients FROM public;                        
-REVOKE ALL ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq FROM public;
+REVOKE ALL ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients, billingcodes FROM public;
+REVOKE ALL ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq, billingcodes_id_seq FROM public;
 
-GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients TO pykotaadmin;
-GRANT SELECT, UPDATE ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq TO pykotaadmin;
-GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients TO pykotauser;
+GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients, billingcodes TO pykotaadmin;
+GRANT SELECT, UPDATE ON users_id_seq, groups_id_seq, printers_id_seq, userpquota_id_seq, grouppquota_id_seq, jobhistory_id_seq, payments_id_seq, coefficients_id_seq, billingcodes_id_seq TO pykotaadmin;
+GRANT SELECT ON users, groups, printers, userpquota, grouppquota, groupsmembers, printergroupsmembers, jobhistory, payments, coefficients, billingcodes TO pykotauser;
 
Index: pykota/trunk/initscripts/postgresql/upgrade-to-1.23.sql
===================================================================
--- pykota/trunk/initscripts/postgresql/upgrade-to-1.23.sql (revision 2317)
+++ pykota/trunk/initscripts/postgresql/upgrade-to-1.23.sql (revision 2317)
@@ -0,0 +1,64 @@
+--
+-- PyKota - Print Quotas for CUPS and LPRng
+--
+-- (c) 2003, 2004, 2005 Jerome Alet <alet@librelogiciel.com>
+-- This program is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU General Public License as published by
+-- the Free Software Foundation; either version 2 of the License, or
+-- (at your option) any later version.
+--
+-- This program is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+-- GNU General Public License for more details.
+-- 
+-- You should have received a copy of the GNU General Public License
+-- along with this program; if not, write to the Free Software
+-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+--
+-- $Id$
+--
+--
+--
+-- This script has to be used if you already
+-- have a pre-1.23alpha12 version of PyKota to upgrade
+-- your database schema. 
+--
+-- YOU DON'T NEED TO USE IT IF YOU'VE JUST INSTALLED PYKOTA
+--
+                        
+--                         
+-- Modify the old database schema
+--
+ALTER TABLE users ADD COLUMN description TEXT;
+ALTER TABLE groups ADD COLUMN description TEXT;
+ALTER TABLE userpquota ADD COLUMN maxjobsize INT4;
+ALTER TABLE userpquota ADD COLUMN temporarydenied BOOLEAN;
+ALTER TABLE userpquota ALTER COLUMN temporarydenied SET DEFAULT 'f';
+ALTER TABLE grouppquota ADD COLUMN maxjobsize INT4;
+ALTER TABLE printers ADD COLUMN maxjobsize INT4;
+ALTER TABLE printers ADD COLUMN passthrough BOOLEAN;
+ALTER TABLE printers ALTER COLUMN passthrough SET DEFAULT 'f';
+ALTER TABLE jobhistory ADD COLUMN precomputedjobsize INT4;
+ALTER TABLE jobhistory ADD COLUMN precomputedjobprice FLOAT;
+
+--
+-- Now updates existing datas
+--
+-- Just to be sure
+UPDATE userpquota SET temporarydenied='f';
+UPDATE printers SET passthrough='f';
+
+-- 
+-- Create the table for the billing codes
+--
+CREATE TABLE billingcodes (id SERIAL PRIMARY KEY NOT NULL,
+                           label TEXT UNIQUE NOT NULL,
+                           balance FLOAT DEFAULT 0.0,
+                           pagecounter INT4 DEFAULT 0);
+
+REVOKE ALL ON billingcodes FROM public;                        
+REVOKE ALL ON billingcodes_id_seq FROM public;
+GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON billingcodes TO pykotaadmin;
+GRANT SELECT, UPDATE ON billingcodes_id_seq TO pykotaadmin;
+GRANT SELECT ON billingcodes TO pykotauser;
