Index: /pykota/trunk/setup.py
===================================================================
--- /pykota/trunk/setup.py (revision 2638)
+++ /pykota/trunk/setup.py (revision 2662)
@@ -117,4 +117,4 @@
       url = "http://www.librelogiciel.com/software/",
       packages = [ "pykota", "pykota.storages", "pykota.loggers", "pykota.accounters", "pykota.reporters" ],
-      scripts = [ "bin/pykoef", "bin/pkturnkey", "bin/pkbcodes", "bin/pkmail", "bin/pkbanner", "bin/autopykota", "bin/dumpykota", "bin/pykosd", "bin/edpykota", "bin/repykota", "bin/warnpykota", "bin/pykotme", "bin/pkprinters" ],
+      scripts = [ "bin/pkinvoice", "bin/pykoef", "bin/pkturnkey", "bin/pkbcodes", "bin/pkmail", "bin/pkbanner", "bin/autopykota", "bin/dumpykota", "bin/pykosd", "bin/edpykota", "bin/repykota", "bin/warnpykota", "bin/pykotme", "bin/pkprinters" ],
       data_files = data_files)
Index: /pykota/trunk/bin/pkinvoice
===================================================================
--- /pykota/trunk/bin/pkinvoice (revision 2661)
+++ /pykota/trunk/bin/pkinvoice (revision 2662)
@@ -73,7 +73,7 @@
                        to your native language if it is supported by PyKota.
   
-  -V | --vat p         Sets the percent value of the applicable VAT.
-                       The default is 0.0, meaning no VAT information
-                       will be included.
+  -V | --vat p         Sets the percent value of the applicable VAT to be
+                       exposed. The default is 0.0, meaning no VAT
+                       information will be included.
                        
   user1 through userN and group1 through groupN can use wildcards if 
@@ -87,6 +87,6 @@
   Will generate a PDF document containing invoices for all users whose
   account balance is below 15.0 credits. For each user the amount due
-  will be (15.0 - AccountBalance) EURO. No VAT information will be 
-  included.
+  will be (15.0 - AccountBalance) EURO when that value is positive. 
+  No VAT information will be included.
 """) 
         
@@ -127,10 +127,16 @@
         entries = getattr(self.storage, "getMatching%ss" % suffix)(",".join(names))
         nbtotal = len(entries)
-        self.printInfo("Not implemented yet !", "warn")
         for i in range(nbtotal) :
-            # TODO 
-            percent = 100.0 * float(i) / float(nbtotal)
+            entry = entries[i]
+            amount = reference - entry.AccountBalance
+            if amount > 0.0 :
+                # There's something due !
+                ht = ((amount * 10000.0) / (100.0 + vat)) / 100.0
+                sys.stderr.write("%s => Due : %.2f including %.2f VAT\n" % (entry.Name, amount, amount-ht))
+                
             if outfname != "-" :
+                percent = 100.0 * float(i) / float(nbtotal)
                 self.display("\r%.02f%%" % percent)
+                
         if outfname != "-" :        
             self.display("\r100.00%%\r        ")
@@ -142,5 +148,5 @@
         defaults = { "reference" : "0.0",
                      "vat" : "0.0",
-                     "unit" : _("Credits"),
+                     "unit" : N_("Credits"),
                      "output" : "-",
                      "pagesize" : "a4", \
@@ -148,5 +154,5 @@
                      "number" : "1",
                    }
-        short_options = "vho:gr:u:V:p:l:"
+        short_options = "vho:gr:u:V:p:l:n:"
         long_options = ["help", "version", \
                         "groups", "reference=", "unit=", "output=", \
@@ -158,5 +164,5 @@
         
         # parse and checks the command line
-        (options, args) = invoiceGenerator.parseCommandline(sys.argv[1:], short_options, long_options)
+        (options, args) = invoiceGenerator.parseCommandline(sys.argv[1:], short_options, long_options, allownothing=True)
         
         # sets long options
Index: /pykota/trunk/MANIFEST.in
===================================================================
--- /pykota/trunk/MANIFEST.in (revision 2573)
+++ /pykota/trunk/MANIFEST.in (revision 2662)
@@ -2,5 +2,5 @@
 include clean.sh checkdeps.py bin/pykoef bin/pkturnkey bin/pkmail bin/pkbanner
 include bin/autopykota bin/dumpykota bin/cupspykota bin/edpykota bin/warnpykota
-include bin/repykota bin/pykotme bin/pykosd bin/pkprinters bin/pkbcodes 
+include bin/repykota bin/pykotme bin/pykosd bin/pkprinters bin/pkbcodes bin/pkinvoice
 include bin/waitprinter.sh bin/papwaitprinter.sh bin/mailandpopup.sh bin/README
 recursive-include po README *.sh *.po *.mo *.pot
