[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r121 - in gnue-invoice: . forms schema
From: |
kilo |
Subject: |
r121 - in gnue-invoice: . forms schema |
Date: |
Fri, 19 Nov 2004 04:40:11 -0600 (CST) |
Author: kilo
Date: 2004-11-19 04:40:11 -0600 (Fri, 19 Nov 2004)
New Revision: 121
Modified:
gnue-invoice/forms/INV_Head.gfd
gnue-invoice/news
gnue-invoice/schema/invoice.gcd
Log:
GNUe Invoice.
Moved logic wrt invoice lines to server-side.
Modified: gnue-invoice/forms/INV_Head.gfd
===================================================================
--- gnue-invoice/forms/INV_Head.gfd 2004-11-19 09:42:49 UTC (rev 120)
+++ gnue-invoice/forms/INV_Head.gfd 2004-11-19 10:40:11 UTC (rev 121)
@@ -48,17 +48,7 @@
blkFreeHead.dateDue.set(dateDue)
</trigger>
- <trigger name="calcItemPriceTotal" type="NAMED">
- #Calculate and display the line's total value
- if (blkINV_Item.fldInvProductPrice is not None) and
(blkINV_Item.fldInvQuantity is not None):
- print blkINV_Item.fldInvProductPrice.get(),
blkINV_Item.fldInvQuantity.get()
- price = float(blkINV_Item.fldInvProductPrice.get())
- quantity = float(blkINV_Item.fldInvQuantity.get())
- total = price * quantity
- blkFreeItem.itemPriceTotal.set(total)
- </trigger>
-
<logic>
<!--***************************************************
Invoice head
@@ -146,9 +136,9 @@
fk_description="ITEM_price" fk_key="gnue_id"
fk_source="dts_ITEM_Item" readonly="Y" />
<field name="fldInvQuantity" field="INV_quantity" maxLength="10"
- typecast="number">
- <!--<trigger type="POST-CHANGE" name="postchange"
src="calcItemPriceTotal" />-->
- </field>
+ typecast="number" />
+ <field name="fldInvValueGross" field="INV_valueGross"
+ typecast="number" readonly="Y"/>
<!--Count totals -->
<trigger type="POST-COMMIT" name="postcommit">
@@ -159,19 +149,6 @@
</trigger>
</block>
- <!--***************************************************************
- Free item block
- Fields to display generated/computed invoice line data on the form
- ****************************************************************-->
- <block name="blkFreeItem" rows="5">
- <field name="itemPriceTotal" readonly="Y" typecast="number"/>
-
- <!--Setting generated and computed initial data-->
- <trigger type="ON-NEWRECORD" name="onnewrecord">
- self.itemPriceTotal.set(0) #TODO: is it needed here???
- </trigger>
- </block>
-
</logic>
@@ -245,12 +222,12 @@
<entry name="entInvProduct" c:height="1" c:width="28" c:x="2" c:y="12"
block="blkINV_Item" field="fldInvProduct" style="dropdown" />
- <entry name="entItemPrice" c:height="1" c:width="6" c:x="31" c:y="12"
+ <entry name="entItemPrice" c:height="1" c:width="6" c:x="31" c:y="12"
block="blkINV_Item" field="fldInvProductPrice" style="label" />
- <entry name="entInvQuantity" c:height="1" c:width="5" c:x="38" c:y="12"
+ <entry name="entInvQuantity" c:height="1" c:width="5" c:x="38" c:y="12"
block="blkINV_Item" field="fldInvQuantity"/>
<entry name="entItemPriceTotal" c:height="1" c:width="10" c:x="44"
c:y="12"
- block="blkFreeItem" field="itemPriceTotal" style="label" />
+ block="blkINV_Item" field="fldInvValueGross" style="label" />
</page>
</layout>
Modified: gnue-invoice/news
===================================================================
--- gnue-invoice/news 2004-11-19 09:42:49 UTC (rev 120)
+++ gnue-invoice/news 2004-11-19 10:40:11 UTC (rev 121)
@@ -5,6 +5,8 @@
New features / changes by 2004.11.19
* Applied changes due to correctly working dropdowns at last committed
to GNUe. It simplified the main form a little bit.
+* Moved more business logic to the AppServer. All logic in connection with
+ invoice lines is now processed on the server side.
New features / changes by 2004.11.16
* Modified the 'Edit...' button's width. It is 7 now. It always should
Modified: gnue-invoice/schema/invoice.gcd
===================================================================
--- gnue-invoice/schema/invoice.gcd 2004-11-19 09:42:49 UTC (rev 120)
+++ gnue-invoice/schema/invoice.gcd 2004-11-19 10:40:11 UTC (rev 121)
@@ -45,34 +45,16 @@
<property name="note" type="string" comment="" />
<property name="valueNet" type="number(10,2)" >
- net = self.quantity * self.product.ITEM_price
- print 'INV_Item::valueNet %f' % net
- return net
+ return self.product and (self.quantity * self.product.ITEM_price) or 0
</property>
<property name="valueVAT" type="number(10,2)" >
- vat = self.product.ITEM_vat.TAX_vatFromNet(inNet=self.valueNet)
- print 'INV_Item::valueVAT %f' % vat
- return vat
+ return self.product and
self.product.ITEM_vat.TAX_vatFromNet(inNet=self.valueNet) or 0
</property>
<property name="valueGross" type="number(10,2)" >
- gross = self.product.ITEM_vat.TAX_grossFromNet(inNet=self.valueNet)
- print 'INV_Item::valueGross %f' % gross
- return gross
+ return self.product and
self.product.ITEM_vat.TAX_grossFromNet(inNet=self.valueNet) or 0
</property>
-
- <!--****************************
- 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>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r121 - in gnue-invoice: . forms schema,
kilo <=