commit-gnue
[Top][All Lists]
Advanced

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

r100 - in gnue-invoice: . forms schema


From: kilo
Subject: r100 - in gnue-invoice: . forms schema
Date: Tue, 26 Oct 2004 06:02:59 -0500 (CDT)

Author: kilo
Date: 2004-10-26 06:02:58 -0500 (Tue, 26 Oct 2004)
New Revision: 100

Modified:
   gnue-invoice/forms/INV_Head.gfd
   gnue-invoice/news
   gnue-invoice/schema/invoice.gcd
   gnue-invoice/todo
Log:
GNUe Invoice
Display product price.

Modified: gnue-invoice/forms/INV_Head.gfd
===================================================================
--- gnue-invoice/forms/INV_Head.gfd     2004-10-23 22:23:18 UTC (rev 99)
+++ gnue-invoice/forms/INV_Head.gfd     2004-10-26 11:02:58 UTC (rev 100)
@@ -38,10 +38,8 @@
               master="dtsINV_Head" masterlink="gnue_id" table="INV_Item"/>
   <datasource name="dts_ITEM_Item" connection="invoice" prequery="Y"
               table="ITEM_Item"/>
-  <!-- <datasource name="dtsITEM_Item" connection="invoice" 
detaillink="gnue_id"
-              master="dtsINV_Item" masterlink="INV_product" 
table="ITEM_Item"/> -->
+  <datasource name="dtsITEM_Item" connection="invoice" table="ITEM_Item"/>
 
-
   <!--*****************************************************
                       Named triggers
   ******************************************************-->
@@ -50,7 +48,16 @@
     blkFree.dateDue.set(dateDue)
   </trigger>
 
+  <trigger name="getItemPrice" type="NAMED">
+    price = blkINV_Item.call("INV_itemPrice", {})
+    blkFree.itemPrice.set(price)
+  </trigger>
 
+  <trigger name="calcItemPriceTotal" type="NAMED">
+    price = blkINV_Item.call("INV_calcItemPrice", 
{'quantity':blkINV_Item.fldInvQuantity.get()})
+    blkFree.itemPriceTotal.set(price)
+  </trigger>
+
   <logic>
     <!--***************************************************
                         Invoice head
@@ -114,18 +121,17 @@
       <field name="dateIssued" readonly="Y" typecast="date"/>
       <field name="dateDue" readonly="Y" typecast="date"/>
       <field name="valueTotalGross" readonly="Y" typecast="number"/>
+      <field name="itemPrice" readonly="Y" typecast="number"/>
+      <field name="itemPriceTotal" readonly="Y" typecast="number"/>
 
       <!--Setting generated and computed initial data-->
       <trigger type="ON-NEWRECORD" name="onnewrecord">
         print "blkFree::OnNewRecord"
 
         self.valueTotalGross.set(0)
+        self.itemPriceTotal.set(0)
         self.dateIssued.set(blkINV_Head.fldInvDateissued.get())
         self.dateDue.set(blkINV_Head.fldInvDatedue.get())
-
-        #newNumber = blkINV_Head.call("INV_newNumber", {})
-        #if newNumber:
-        #  self.number.set(newNumber)
       </trigger>
     </block>
 
@@ -151,17 +157,12 @@
       </trigger>
     </block>
 
+  </logic>
 
-    <!--***************************************************
-                        Product info
-    ****************************************************-->
-<!--     <block name="blkITEM_Item" datasource="dtsitem_item">
-      <field name="fldItemPrice" field="ITEM_price" maxLength="10" 
typecast="number"/>
-    </block> -->
- </logic>
 
-
-
+  <!--*****************************************************
+                          Form layout
+  ******************************************************-->
   <layout xmlns:Char="GNUe:Layout:Char" Char:height="18" Char:width="49">
     <page name="Page1">
       <label name="lblInv Number:" Char:height="1" Char:width="7" Char:x="1"
@@ -247,11 +248,17 @@
 
       <entry name="entInvProduct" Char:height="1" Char:width="28" Char:x="2"
              Char:y="12" block="blkINV_Item" field="fldInvProduct"
-             style="dropdown"/>
-      <entry name="entInvQuantity" Char:height="1" Char:width="5" Char:x="31"
-             Char:y="12" block="blkINV_Item" field="fldInvQuantity" />
-<!--       <entry name="entItemPrice" Char:height="1" Char:width="10" 
Char:x="37"
-             Char:y="12" block="blkITEM_Item" field="fldItemPrice" /> -->
+             style="dropdown">
+        <trigger type="POST-FOCUSOUT" name="postfocusout" src="getItemPrice" />
+      </entry>
+      <entry name="entItemPrice" Char:height="1" Char:width="6" Char:x="31"
+             Char:y="12" block="blkFree" field="itemPrice" style="label" />
+      <entry name="entInvQuantity" Char:height="1" Char:width="5" Char:x="38"
+             Char:y="12" block="blkINV_Item" field="fldInvQuantity">
+        <!-- <trigger type="POST-FOCUSOUT" name="postfocusout" 
src="calcItemPriceTotal" /> -->
+      </entry>
+      <entry name="entItemPriceTotal" Char:height="1" Char:width="10" 
Char:x="343"
+             Char:y="12" block="blkFree" field="itemPriceTotal" style="label" 
/>
     </page>
   </layout>
 </form>

Modified: gnue-invoice/news
===================================================================
--- gnue-invoice/news   2004-10-23 22:23:18 UTC (rev 99)
+++ gnue-invoice/news   2004-10-26 11:02:58 UTC (rev 100)
@@ -2,6 +2,9 @@
 *************************
 GNUe Invoice - Project CV
 *************************
+New features / changes by 2004.10.26
+* Display the product/service price when selecting from dropdown. It only
+    works when the dropdown loses focus.
 
 New features / changes by 2004.10.23
 * Automatic value sanity checks in INV_Head class' OnValidate

Modified: gnue-invoice/schema/invoice.gcd
===================================================================
--- gnue-invoice/schema/invoice.gcd     2004-10-23 22:23:18 UTC (rev 99)
+++ gnue-invoice/schema/invoice.gcd     2004-10-26 11:02:58 UTC (rev 100)
@@ -65,6 +65,26 @@
       print 'INV_Item::valueGross %f' % gross
       return gross
     </property>
+
+    <!--***********************
+    Return price of the product
+    ************************-->
+    <procedure name="itemPrice" type="number(10,2)" >
+        price = self.product.ITEM_price
+        return price
+    </procedure>
+
+    <!--****************************
+    Return price * quantity, or None
+    *****************************-->
+    <procedure name="calcItemPrice" type="number(10,2)" >
+      <parameter name="quantity" type="number(10,2)" />
+        if (self.product is not None) and (quantity is not None):
+          price = self.product.ITEM_price * quantity
+          return price
+        else
+          return None
+    </procedure>
   </class>
 
 

Modified: gnue-invoice/todo
===================================================================
--- gnue-invoice/todo   2004-10-23 22:23:18 UTC (rev 99)
+++ gnue-invoice/todo   2004-10-26 11:02:58 UTC (rev 100)
@@ -4,11 +4,11 @@
 *************************************
 
 
-DISPLAY INVOICE NUMBER
-======================
-    During the fill up of the invoice, the presumed invoice number should be
-    displayed. Noone can be sure that it will be the real invoice number,
-    it is only given there for information.
+DISPLAY THE PRICE OF A PRODUCT/SERVICE
+======================================
+    When selecting a product/service for the invoice item, we should display
+    its price, and based on the quantity the user enters, display the sum
+    of that invoice item too.
 
     Status: in progress
 
@@ -25,8 +25,8 @@
 
 PROPERLY INITIALIZE DATE DUE ENTRY
 ==================================
-    It is not cleared after a commit... it shows the previously committed
-    invoice's due date.
+    When producing several invoices continously, it is not cleared after
+    a commit... it shows the previously committed invoice's due date.
 
     Status: not started
 
@@ -45,6 +45,15 @@
     Status: not started
 
 
+DISPLAY INVOICE NUMBER
+======================
+    During the fill up of the invoice, the presumed invoice number should be
+    displayed. Noone can be sure that it will be the real invoice number,
+    it is only given there for information.
+
+    Status: not started
+
+
 MULTIPLE SELLERS
 ================
     Store seller as a special kind of PARTY_Party. By storing the seller





reply via email to

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