[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
r122 - in gnue-invoice: . forms schema
From: |
kilo |
Subject: |
r122 - in gnue-invoice: . forms schema |
Date: |
Fri, 19 Nov 2004 05:11:54 -0600 (CST) |
Author: kilo
Date: 2004-11-19 05:11:54 -0600 (Fri, 19 Nov 2004)
New Revision: 122
Modified:
gnue-invoice/forms/INV_Head.gfd
gnue-invoice/news
gnue-invoice/schema/invoice.gcd
Log:
GNUe Invoice.
Moved total value counting to server side.
Modified: gnue-invoice/forms/INV_Head.gfd
===================================================================
--- gnue-invoice/forms/INV_Head.gfd 2004-11-19 10:40:11 UTC (rev 121)
+++ gnue-invoice/forms/INV_Head.gfd 2004-11-19 11:11:54 UTC (rev 122)
@@ -81,16 +81,15 @@
<field name="fldInvPrinted" field="INV_printed" maxLength="3"
readonly="Y" typecast="number"/>
<field name="fldInvValuetotalGross" field="INV_valueTotalGross"
- maxLength="10" readonly="Y" typecast="number"/>
+ maxLength="10" typecast="number"/>
- <!--Display gross total, stored dates and # of prints
+ <!--Display stored dates and # of prints
upon viewing an invoice-->
<trigger type="POST-QUERY" name="postquery">
print "blkINV_Head::PostQuery"
blkFreeHead.number.set(self.fldInvNumber.get())
blkFreeHead.dateIssued.set(self.fldInvDateissued.get())
blkFreeHead.dateDue.set(self.fldInvDatedue.get())
- blkFreeHead.valueTotalGross.set(self.fldInvValuetotalGross.get())
</trigger>
<!--Copy generated and computed data to the DB-->
@@ -110,13 +109,11 @@
<field name="number" readonly="Y" />
<field name="dateIssued" readonly="Y" typecast="date"/>
<field name="dateDue" readonly="Y" typecast="date"/>
- <field name="valueTotalGross" readonly="Y" typecast="number"/>
-
+
<!--Setting generated and computed initial data-->
<trigger type="ON-NEWRECORD" name="onnewrecord">
print "blkFreeHead::OnNewRecord"
- self.valueTotalGross.set(0)
self.dateIssued.set(blkINV_Head.fldInvDateissued.get())
self.dateDue.set(blkINV_Head.fldInvDatedue.get())
</trigger>
@@ -142,10 +139,8 @@
<!--Count totals -->
<trigger type="POST-COMMIT" name="postcommit">
- #valueTotalGross = blkINV_Head.call("INV_getvalueTotalGross", {})
- #print "blkINV_Item::PostCommit", valueTotalGross
- #if valueTotalGross:
- #blkFreeHead.valueTotalGross.set(valueTotalGross)
+ #Calling a calculated property will cause it to refresh
+ blkINV_Head.call("INV_getvalueTotalGross", {})
</trigger>
</block>
@@ -207,8 +202,8 @@
<label name="lblValuetotalGross:" c:height="1" c:width="12" c:x="1"
c:y="9"
text="Value total:"/>
<entry name="entInvValuetotalGross" c:height="1" c:width="10" c:x="16"
c:y="9"
- block="blkFreeHead" field="valueTotalGross" style="label"/>
-
+ block="blkINV_Head" field="fldInvValuetotalGross" style="label"/>
+
<box name="BoxItem" c:height="8" c:width="50" c:x="1" c:y="10"
label="Items"/>
<button name="btnEditItem" c:height="1" c:width="7" c:x="14" c:y="11"
Modified: gnue-invoice/news
===================================================================
--- gnue-invoice/news 2004-11-19 10:40:11 UTC (rev 121)
+++ gnue-invoice/news 2004-11-19 11:11:54 UTC (rev 122)
@@ -7,7 +7,8 @@
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.
-
+* Counting of invoice total value is now also happens on server side
+
New features / changes by 2004.11.16
* Modified the 'Edit...' button's width. It is 7 now. It always should
have been...
Modified: gnue-invoice/schema/invoice.gcd
===================================================================
--- gnue-invoice/schema/invoice.gcd 2004-11-19 10:40:11 UTC (rev 121)
+++ gnue-invoice/schema/invoice.gcd 2004-11-19 11:11:54 UTC (rev 122)
@@ -28,10 +28,10 @@
Stores information about methods and terms of payment.
Also used for calculating the invoice's due date.
***************************************************-->
- <class name="PaymentMethod" comment="">
- <property name="name" type="string(35)"
comment="" />
- <property name="channel" type="string(35)"
nullable="False" comment="cash, transfer, etc." />
- <property name="dueDays" type="number(3)"
nullable="False" comment="number of days before payment is due" />
+ <class name="PaymentMethod" comment="Payment methods and terms">
+ <property name="name" type="string(35)"
comment="" />
+ <property name="channel" type="string(35)" nullable="False"
comment="cash, transfer, etc." />
+ <property name="dueDays" type="number(3)" nullable="False"
comment="number of days before payment is due" />
</class>
@@ -39,20 +39,20 @@
Represents an invoice item, ie a line on an invoice
************************************************-->
<class name="Item" comment="One item (line) on an invoice">
- <property name="head" type="INV_Head" nullable="False"
comment="link with invoice head" />
- <property name="product" type="ITEM_Item" nullable="False"
comment="" />
- <property name="quantity" type="number(10,2)" nullable="False"
comment="" />
- <property name="note" type="string" comment="" />
+ <property name="head" type="INV_Head" nullable="False"
comment="link with invoice head" />
+ <property name="product" type="ITEM_Item" nullable="False"
comment="" />
+ <property name="quantity" type="number(10,2)" nullable="False"
comment="" />
+ <property name="note" type="string"
comment="" />
- <property name="valueNet" type="number(10,2)" >
+ <property name="valueNet" type="number(10,2)" >
return self.product and (self.quantity * self.product.ITEM_price) or 0
</property>
- <property name="valueVAT" type="number(10,2)" >
+ <property name="valueVAT" type="number(10,2)" >
return self.product and
self.product.ITEM_vat.TAX_vatFromNet(inNet=self.valueNet) or 0
</property>
- <property name="valueGross" type="number(10,2)" >
+ <property name="valueGross" type="number(10,2)" >
return self.product and
self.product.ITEM_vat.TAX_grossFromNet(inNet=self.valueNet) or 0
</property>
</class>
@@ -71,8 +71,8 @@
<property name="dateDelivery" type="date"
nullable="False" comment="" />
<property name="dateIssued" type="date"
nullable="False" comment="Date when invoice was generated" />
<property name="dateDue" type="date"
nullable="False" comment="Date the payment is due" />
- <property name="note" type="string" comment="" />
- <property name="printed" type="number(3)" comment="# of
printed copies" />
+ <property name="note" type="string"
comment="" />
+ <property name="printed" type="number(3)"
comment="# of printed copies" />
<property name="valueTotalNet" type="number(10,2)" >
items = find('INV_Item', {'INV_head':self.gnue_id}, [], ['INV_valueNet'])
@@ -105,10 +105,10 @@
total = 0.0
if len(items):
+ #total = sum(items)
for a in items:
total += a.INV_valueGross
- #total = sum(items)
print 'INV_Head::valueTotalGross #item:%d total:%f' % (len(items),total)
return total
</property>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- r122 - in gnue-invoice: . forms schema,
kilo <=