commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

r176 - gnue-invoice/schema


From: kilo
Subject: r176 - gnue-invoice/schema
Date: Mon, 3 Jan 2005 06:49:15 -0600 (CST)

Author: kilo
Date: 2005-01-03 06:49:14 -0600 (Mon, 03 Jan 2005)
New Revision: 176

Modified:
   gnue-invoice/schema/invoice-en.gsd
   gnue-invoice/schema/invoice-hu.gsd
   gnue-invoice/schema/invoice.gcd
Log:
GNUe Invoice.
Extended class that holds seller info.

Modified: gnue-invoice/schema/invoice-en.gsd
===================================================================
--- gnue-invoice/schema/invoice-en.gsd  2004-12-31 12:57:36 UTC (rev 175)
+++ gnue-invoice/schema/invoice-en.gsd  2005-01-03 12:49:14 UTC (rev 176)
@@ -565,14 +565,17 @@
         <column field="gnue_id" key="Y" type="string(32)"/>
         <column field="gnue_modifydate" type="datetime"/>
         <column field="gnue_modifyuser" type="string(8)"/>
+        <column field="INV_code" type="string(8)"/>
+        <column field="INV_name" type="string(35)"/>
         <column field="INV_addr1" type="string(35)"/>
         <column field="INV_addr2" type="string(35)"/>
         <column field="INV_addr3" type="string(35)"/>
-        <column field="INV_code" type="string(8)"/>
+        <column field="INV_phone" type="string(35)"/>
+        <column field="INV_taxID" type="string(35)"/>
         <column field="INV_currency" type="string(3)"/>
-        <column field="INV_name" type="string(35)"/>
+        <column field="INV_accBank" type="string(35)"/>
+        <column field="INV_accNum" type="string(35)"/>
         <column field="INV_numPrint" type="number(2)"/>
-        <column field="INV_taxID" type="string(35)"/>
       </definition>
       <rows>
         <row>

Modified: gnue-invoice/schema/invoice-hu.gsd
===================================================================
--- gnue-invoice/schema/invoice-hu.gsd  2004-12-31 12:57:36 UTC (rev 175)
+++ gnue-invoice/schema/invoice-hu.gsd  2005-01-03 12:49:14 UTC (rev 176)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <schema author="gnue-gsdgen" title="Appserver Data Dump" version="1.0">
   <data>
     <tabledata name="ITEM_ItemType_dump" tablename="ITEM_ItemType">
@@ -528,14 +528,17 @@
         <column field="gnue_id" key="Y" type="string(32)"/>
         <column field="gnue_modifydate" type="datetime"/>
         <column field="gnue_modifyuser" type="string(8)"/>
+        <column field="INV_code" type="string(8)"/>
+        <column field="INV_name" type="string(35)"/>
         <column field="INV_addr1" type="string(35)"/>
         <column field="INV_addr2" type="string(35)"/>
         <column field="INV_addr3" type="string(35)"/>
-        <column field="INV_code" type="string(8)"/>
+        <column field="INV_phone" type="string(35)"/>
+        <column field="INV_taxID" type="string(35)"/>
         <column field="INV_currency" type="string(3)"/>
-        <column field="INV_name" type="string(35)"/>
+        <column field="INV_accBank" type="string(35)"/>
+        <column field="INV_accNum" type="string(35)"/>
         <column field="INV_numPrint" type="number(2)"/>
-        <column field="INV_taxID" type="string(35)"/>
       </definition>
       <rows>
         <row>
@@ -544,14 +547,17 @@
           <value field="gnue_id">14888688109001455455880376865506</value>
           <value field="gnue_modifydate">2004-12-10 13:05:42.00</value>
           <value field="gnue_modifyuser"></value>
-          <value field="INV_addr1">1 Goat Avenue</value>
-          <value field="INV_addr2">Thwap City, GN, 12345</value>
-          <value field="INV_addr3">Universe</value>
           <value field="INV_code">1</value>
-          <value field="INV_currency">USD</value>
-          <value field="INV_name">GNUe Blame Derek Ltd.</value>
+          <value field="INV_name">BÉRADÓ'88 KFT.</value>
+          <value field="INV_addr1">6725 Szeged, Vitéz u. 13-15.</value>
+          <value field="INV_addr2"></value>
+          <value field="INV_addr3"></value>
+          <value field="INV_phone">62/547-968</value>
+          <value field="INV_taxID">11392503-2-06</value>
+          <value field="INV_currency">HUF</value>
+          <value field="INV_accBank">Szöreg és Vid.Taksz.</value>
+          <value field="INV_accNum">57400217-10120570</value>
           <value field="INV_numPrint">2</value>
-          <value field="INV_taxID">12345678</value>
         </row>
       </rows>
     </tabledata>

Modified: gnue-invoice/schema/invoice.gcd
===================================================================
--- gnue-invoice/schema/invoice.gcd     2004-12-31 12:57:36 UTC (rev 175)
+++ gnue-invoice/schema/invoice.gcd     2005-01-03 12:49:14 UTC (rev 176)
@@ -31,8 +31,11 @@
     <property name="addr1"      type="string(35)"                       
comment=""/>
     <property name="addr2"      type="string(35)"                       
comment=""/>
     <property name="addr3"      type="string(35)"                       
comment=""/>
+    <property name="phone"      type="string(35)"                       
comment=""/>
     <property name="taxID"      type="string(35)"                       
comment=""/>
     <property name="currency"   type="string(3)"                        
comment="base currency"/>
+    <property name="accBank"    type="string(35)"                       
comment="Name of bank"/>
+    <property name="accNum"     type="string(35)"                       
comment=""/>
     <property name="numPrint"   type="number(2)"                        
comment="number of invoices printed by default"/>
   </class>
 
@@ -88,28 +91,19 @@
     <property name="printed"        type="number(3)"                           
     comment="# of printed copies" />
     <property name="reverted"       type="boolean"                             
     comment="If true, no more reverted copies can be made" />
 
-    <property name="valueTotalNet"  type="number(10,2)" >
+    <property name="totalNet"  type="number(10,2)" >
       items = find('INV_Item', {'INV_head':self.gnue_id}, [], ['INV_valueNet'])
-      total = sum([i.INV_valueNet for i in items])
-      
-      print 'INV_Head::valueTotalNet #item:%d total:%f' % (len(items),total)
-      return total
+      return sum([i.INV_valueNet for i in items])
     </property>
 
-    <property name="valueTotalVAT"  type="number(10,2)" >
+    <property name="totalVAT"  type="number(10,2)" >
       items = find('INV_Item', {'INV_head':self.gnue_id}, [], ['INV_valueVAT'])
-      total = sum([i.INV_valueVAT for i in items])
-      
-      print 'INV_Head::valueTotalVAT #item:%d total:%f' % (len(items),total)
-      return total
+      return sum([i.INV_valueVAT for i in items])
     </property>
 
-    <property name="valueTotalGross"    type="number(10,2)" >
+    <property name="totalGross"    type="number(10,2)" >
       items = find('INV_Item', {'INV_head':self.gnue_id}, [], 
['INV_valueGross'])
-      total = sum([i.INV_valueGross for i in items])
-      
-      print 'INV_Head::valueTotalGross #item:%d total:%f' % (len(items),total)
-      return total
+      return sum([i.INV_valueGross for i in items])
     </property>
 
     <!--******************************************************
@@ -119,6 +113,14 @@
     <property name="buyerName"  type="string(35)" >
       return self.buyer and self.buyer.ORG_shortName or ''
     </property>
+    
+    <!--******************************************************************
+    Return a string ('REVERTED' or empty) for the invoice report to print.
+    This way the same report can print both normal and reverted invoices.
+    *******************************************************************-->
+    <property name="revertedString" type="string">
+      return self.reverted and "REVERTED" or ''
+    </property>
 
     <!--************************************
     Returns summed Net, VAT or Gross values,
@@ -147,7 +149,7 @@
     <!--*******************
     Reverts a given invoice
     ********************-->
-    <procedure name="revert"    type="boolean">
+    <procedure name="revert"    type="string(20)">
       <parameter name="invId"   type="id"/>
       invList = find('INV_Head', {'gnue_id': invId}, [], [])
       try:
@@ -175,11 +177,11 @@
             itemNew.INV_note        = item.INV_note
 
           session.commit()
-          return True
+          return invNew.INV_number
         else:
-          return False
+          return None
       except:
-        return False
+        return None
     </procedure>
 
     <!--******************************************************
@@ -219,7 +221,6 @@
     Sanity checks
     **********-->
     <procedure name="OnValidate">
-      print "INV_Head::OnValidate"
       import mx.DateTime
 
       if self.number is None:
@@ -247,20 +248,19 @@
     Setting default values
     *******************-->
     <procedure name="OnInit">
-      print "INV_Head::OnInit"
       import mx.DateTime
       self.dateIssued = mx.DateTime.today().date
       print 'INV_Head::OnInit - dateIssued set to %s' % self.dateIssued
 
       #NULL does not behave well on the form, so better set it to '0'.
       self.printed = 0
+        
+      self.reverted = False
       
       sellerList = find('INV_Company', {'INV_code': '1'}, [], [])
       if len(sellerList):
         self.seller = sellerList[0]
         print 'INV_Head::OnInit - Seller is %s' % self.seller.INV_name
-        
-      self.reverted = False
     </procedure>
 
   </class>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]