commit-gnue
[Top][All Lists]
Advanced

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

[gnue-luca] r24 - in trunk: etc modules/base modules/finance


From: reinhard
Subject: [gnue-luca] r24 - in trunk: etc modules/base modules/finance
Date: Thu, 1 Mar 2007 14:09:20 -0600 (CST)

Author: reinhard
Date: 2007-03-01 14:09:19 -0600 (Thu, 01 Mar 2007)
New Revision: 24

Modified:
   trunk/etc/connections.conf
   trunk/modules/base/base.gcd
   trunk/modules/base/currcalc.gfd
   trunk/modules/finance/acc-main.gfd
Log:
Updated for gnue-forms 0.6.


Modified: trunk/etc/connections.conf
===================================================================
--- trunk/etc/connections.conf  2005-09-01 15:18:02 UTC (rev 23)
+++ trunk/etc/connections.conf  2007-03-01 20:09:19 UTC (rev 24)
@@ -2,7 +2,7 @@
 
 [gnue]
 comment = GNUe-Luca Test Database
-provider = sqlite2
+provider = sqlite3
 dbname = ./luca.db
 
 [appserver]

Modified: trunk/modules/base/base.gcd
===================================================================
--- trunk/modules/base/base.gcd 2005-09-01 15:18:02 UTC (rev 23)
+++ trunk/modules/base/base.gcd 2007-03-01 20:09:19 UTC (rev 24)
@@ -58,7 +58,7 @@
         # Convert amount given in this currency to base currency
         cb = self.convbase or 1
         ct = self.convthis or 1
-        base = self.company.currency
+        base = session.find('parameters')[0].currency
         if not base:
           # Emergency - Base currency not defined
           base = self

Modified: trunk/modules/base/currcalc.gfd
===================================================================
--- trunk/modules/base/currcalc.gfd     2005-09-01 15:18:02 UTC (rev 23)
+++ trunk/modules/base/currcalc.gfd     2007-03-01 20:09:19 UTC (rev 24)
@@ -24,58 +24,40 @@
      $Id: base.gcd 6208 2004-08-25 16:49:04Z reinhard $ -->
 
 <form title="GNUe Currency Calculator">
-  <datasource
-    name="dtsFromCurrency"
-    connection="appserver"
-    table="base_currency"
-    prequery="Y" />
-  <datasource
-    name="dtsToCurrency"
-    connection="appserver"
-    table="base_currency"
-    prequery="Y" />
+  <datasource name="dts_from" connection="appserver" table="base_currency"
+    prequery="Y"/>
+  <datasource name="dts_to" connection="appserver" table="base_currency"
+    prequery="Y"/>
   <logic>
     <block name="blk">
-      <field name="fldFromCode" fk_source="dtsFromCurrency" fk_key="gnue_id"
-        fk_description="base_code" />
-      <field name="fldFromAmount" />
-      <field name="fldToCode" fk_source="dtsToCurrency" fk_key="gnue_id"
-        fk_description="base_code" />
-      <field name="fldToAmount" />
+      <field name="fld_from_code" datatype="text" length="8" 
fk_source="dts_from" fk_key="gnue_id"
+        fk_description="base_code"/>
+      <field name="fld_from_amount" datatype="number" length="14" scale="2"/>
+      <field name="fld_to_code" datatype="text" length="8" fk_source="dts_to" 
fk_key="gnue_id"
+        fk_description="base_code"/>
+      <field name="fld_to_amount" datatype="number" length="14" scale="2" 
editable="N"/>
     </block>
-    <block name="blkFromCurrency" datasource="dtsFromCurrency" />
-    <block name="blkToCurrency" datasource="dtsToCurrency" />
+    <block name="blk_from" datasource="dts_from"/>
+    <block name="blk_to" datasource="dts_to"/>
   </logic>
-  <layout xmlns:Char="GNUe:Layout:Char" Char:height="4" Char:width="37">
+  <layout xmlns:s="GNUe:Layout:Sizer">
     <page name="page">
-      <entry name="entFromCode"
-        Char:height="1" Char:width="8" Char:x="1" Char:y="1"
-        block="blk" field="fldFromCode" style="dropdown" />
-      <entry name="entFromAmount"
-        Char:height="1" Char:width="8" Char:x="9" Char:y="1"
-        block="blk" field="fldFromAmount" />
-      <label text="="
-        Char:height="1" Char:width="1" Char:x="18" Char:y="1" />
-      <entry name="entToCode"
-        Char:height="1" Char:width="8" Char:x="20" Char:y="1"
-        block="blk" field="fldToCode" style="dropdown" />
-      <entry name="entToAmount"
-        Char:height="1" Char:width="8" Char:x="28" Char:y="1"
-        block="blk" field="fldToAmount"/>
-      <button name="Calculate"
-        Char:height="1" Char:width="35" Char:x="1" Char:y="3"
-        label="Calculate">
-        <trigger name="trigger" type="ON-ACTION">
-          # FIXME: should not have to manually navigate to current record...
-          dtsFromCurrency.createResultSet ({'gnue_id': blk.fldFromCode.get()})
-          dtsToCurrency.createResultSet ({'gnue_id': blk.fldToCode.get ()})
-
-          f = int (blk.fldFromAmount.get ())
-          b = blkFromCurrency.call ('base_convfrom', {'amount': f})
-          t = blkToCurrency.call ('base_convto', {'amount': b})
-          blk.fldToAmount.set (t)
-        </trigger>
-      </button>
+      <vbox>
+        <hbox block="blk">
+          <entry name="ent_from_code"   field="fld_from_code"/>
+          <entry name="ent_from_amount" field="fld_from_amount"/>
+          <label text="="/>
+          <entry name="ent_to_code"     field="fld_to_code"/>
+          <entry name="ent_to_amount"   field="fld_to_amount"/>
+        </hbox>
+        <button name="btn_calc" label="Calculate">
+          <trigger name="trigger" type="ON-ACTION">
+            f = blk.fld_from_amount.value
+            b = blk_from.call('base_convfrom', {'amount': f})
+            blk.fld_to_amount.value = blk_to.call('base_convto', {'amount': b})
+          </trigger>
+        </button>
+      </vbox>
     </page>
   </layout>
 </form>

Modified: trunk/modules/finance/acc-main.gfd
===================================================================
--- trunk/modules/finance/acc-main.gfd  2005-09-01 15:18:02 UTC (rev 23)
+++ trunk/modules/finance/acc-main.gfd  2007-03-01 20:09:19 UTC (rev 24)
@@ -2,7 +2,7 @@
 
 <!-- Accounting main entry form
 
-     Copyright 2004 Free Software Foundation
+     Copyright 2004-2007 Free Software Foundation
 
      This file is part of GNU Enterprise.
 
@@ -24,172 +24,117 @@
      $Id: base.gcd 6208 2004-08-25 16:49:04Z reinhard $ -->
 
 <form title="GNUe Accounting">
-  <datasource
-    name="dtsPeriodDropdown"
-    connection="appserver"
-    table="gl_period"
+
+  <!-- ==================================================================== -->
+  <!-- Lookup Datasources                                                   -->
+  <!-- ==================================================================== -->
+
+  <datasource name="dts_lkp_period" connection="appserver" table="gl_period"
     prequery="Y">
     <condition>
-      <eq><cfield name="gl_active" /><cconst value="1" /></eq>
+      <eq><cfield name="gl_active"/><cconst value="1"/></eq>
     </condition>
   </datasource>
 
-  <datasource
-    name="dtsDoctypeDropdown"
-    connection="appserver"
-    table="gl_doctype"
-    prequery="Y" />
+  <datasource name="dts_lkp_doctype" connection="appserver" table="gl_doctype"
+    prequery="Y"/>
 
-  <datasource
-    name="dtsCreditDropdown"
-    connection="appserver"
-    table="gl_account"
+  <datasource name="dts_lkp_credit" connection="appserver" table="gl_account"
     prequery="Y">
     <condition>
-      <eq><cfield name="gl_active" /><cconst value="1" /></eq>
+      <eq><cfield name="gl_active"/><cconst value="1"/></eq>
     </condition>
   </datasource>
 
-  <datasource
-    name="dtsDebitDropdown"
-    connection="appserver"
-    table="gl_account"
+  <datasource name="dts_lkp_debit" connection="appserver" table="gl_account"
     prequery="Y">
     <condition>
-      <eq><cfield name="gl_active" /><cconst value="1" /></eq>
+      <eq><cfield name="gl_active"/><cconst value="1"/></eq>
     </condition>
   </datasource>
 
-  <datasource
-    name="dtsCurrencyDropdown"
-    connection="appserver"
-    table="base_currency"
-    prequery="Y" />
+  <datasource name="dts_lkp_currency" connection="appserver"
+    table="base_currency" prequery="Y"/>
 
-  <datasource name="dtsPeriod" connection="appserver" table="gl_period" />
-  <datasource name="dtsBatch" connection="appserver" table="gl_batch"
-    master="dtsPeriod" masterlink="gnue_id" detaillink="gl_period">
+  <!-- ==================================================================== -->
+  <!-- Main Datasources                                                     -->
+  <!-- ==================================================================== -->
+
+  <datasource name="dts_batch" connection="appserver" table="gl_batch"
+    master="dts_lkp_period" masterlink="gnue_id" detaillink="gl_period">
   </datasource>
 
-  <datasource name="dtsBatchitem" connection="appserver" table="gl_batchitem"
-    master="dtsBatch" masterlink="gnue_id" detaillink="gl_batch">
+  <datasource name="dts_batchitem" connection="appserver" table="gl_batchitem"
+    master="dts_batch" masterlink="gnue_id" detaillink="gl_batch">
     <sortorder>
       <sortfield name="gl_serial" />
     </sortorder>
   </datasource>
 
+  <!-- ==================================================================== -->
+  <!-- Logic                                                                -->
+  <!-- ==================================================================== -->
+
   <logic>
     <block name="blk">
-      <field name="fldPeriod" fk_source="dtsPeriodDropdown" fk_key="gnue_id"
-        fk_description="gl_name">
-        <trigger type="POST-CHANGE">
+      <field name="fld_period" datatype="text" length="17" 
fk_source="dts_lkp_period" fk_key="gnue_id" fk_description="gl_name">
+        <trigger type="PRE-FOCUSOUT">
           <![CDATA[
-            # FIXME: This is necessary because a dropdown-source (without
-            # block) cannot be a master.
-            period_id = blk.fldPeriod.get ()
-            if period_id and (period_id != blkPeriod.fldId):
-              dtsPeriod.createResultSet ({'gnue_id': period_id}, readOnly = 
True, query = True)
-              # Most of the time, the user will want to continue to enter
-              # transactions at the end of the batch
-              blkBatchitem.lastRecord ()
-              if not blkBatchitem.isEmpty ():
-                blkBatchitem.newRecord ()
-              # POST-CHANGE is also called on keypress in a dropdown, thus
-              # we may not change the focus
-              # setFocus (blkBatchitem.fldDoctype)
+            # Most of the time, the user will want to continue to enter
+            # transactions at the end of the batch
+            blk_batchitem.lastRecord ()
+            if not blk_batchitem.isEmpty ():
+              blk_batchitem.newRecord ()
           ]]>
         </trigger>
       </field>
     </block>
 
-    <block name="blkPeriod" datasource="dtsPeriod">
-      <field name="fldId" field="gnue_id" />
-    </block>
+    <block name="blk_period" datasource="dts_lkp_period"/>
 
-    <block name="blkBatch" datasource="dtsBatch">
-      <field name="fldSerial" field="gl_serial" />
+    <block name="blk_batch" datasource="dts_batch">
+      <field name="fld_serial" field="gl_serial" datatype="number" length="6" 
scale="0" editable="N"/>
     </block>
 
-    <block name="blkBatchitem" datasource="dtsBatchitem"
-      rows="10" rowSpacer="1"
-      autoCommit="True" autoNextRecord="True">
-      <field name="fldDoctype" field="gl_doctype"
-        fk_source="dtsDoctypeDropdown"
-        fk_key="gnue_id" fk_description="gl_code" />
-      <field name="fldNumber" field="gl_number" typecast="number" />
-      <field name="fldDate" field="gl_date" typecast="date" />
-      <field name="fldCreditNumber" field="gl_credit"
-        fk_source="dtsCreditDropdown"
-        fk_key="gnue_id" fk_description="gl_number" />
-      <field name="fldCreditName" field="gl_credit"
-        fk_source="dtsCreditDropdown"
-        fk_key="gnue_id" fk_description="gl_name" />
-      <field name="fldDebitNumber" field="gl_debit"
-        fk_source="dtsDebitDropdown"
-        fk_key="gnue_id" fk_description="gl_number" />
-      <field name="fldDebitName" field="gl_debit"
-        fk_source="dtsDebitDropdown"
-        fk_key="gnue_id" fk_description="gl_name" />
-      <field name="fldCurrency" field="gl_currency"
-        fk_source="dtsCurrencyDropdown"
-        fk_key="gnue_id" fk_description="base_code" />
-      <field name="fldAmountt" field="gl_amountt" typecast="number" />
-      <field name="fldComment" field="gl_comment" />
+    <block name="blk_batchitem" datasource="dts_batchitem" autoCommit="Y" 
autoNextRecord="Y">
+      <field name="fld_number"  field="gl_number"  datatype="text"   
length="17" scale="0"/>
+      <field name="fld_date"    field="gl_date"    datatype="date"/>
+      <field name="fld_amountt" field="gl_amountt" datatype="number" 
length="14" scale="2"/>
+      <field name="fld_empty"/>
+      <field name="fld_comment" field="gl_comment"/>
+      <field name="fld_doctype"       field="gl_doctype"  
fk_source="dts_lkp_doctype"  fk_key="gnue_id" fk_description="gl_code"/>
+      <field name="fld_credit_number" field="gl_credit"   
fk_source="dts_lkp_credit"   fk_key="gnue_id" fk_description="gl_number"/>
+      <field name="fld_credit_name"   field="gl_credit"   
fk_source="dts_lkp_credit"   fk_key="gnue_id" fk_description="gl_name"/>
+      <field name="fld_debit_number"  field="gl_debit"    
fk_source="dts_lkp_debit"    fk_key="gnue_id" fk_description="gl_number"/>
+      <field name="fld_debit_name"    field="gl_debit"    
fk_source="dts_lkp_debit"    fk_key="gnue_id" fk_description="gl_name"/>
+      <field name="fld_currency"      field="gl_currency" 
fk_source="dts_lkp_currency" fk_key="gnue_id" fk_description="base_code"/>
     </block>
   </logic>
 
-  <layout xmlns:Char="GNUe:Layout:Char" Char:height="25" Char:width="100">
+  <layout xmlns:s="GNUe:Layout:Sizer">
     <page name="page">
-      <label text="Period:"
-        Char:height="1" Char:width="7" Char:x="1" Char:y="1" />
-      <entry name="entPeriod"
-        Char:height="1" Char:width="17" Char:x="10" Char:y="1"
-        block="blk" field="fldPeriod" style="dropdown" />
-      <label text="Batch:"
-        Char:height="1" Char:width="8" Char:x="29" Char:y="1" />
-      <entry name="entBatch"
-        Char:height="1" Char:width="17" Char:x="38" Char:y="1"
-        block="blkBatch" field="fldSerial" style="label" />
+      <vbox>
+        <entry name="ent_period" label="Period:" block="blk"       
field="fld_period"/>
+        <entry name="ent_batch"  label="Batch:"  block="blk_batch" 
field="fld_serial"/>
 
-      <label text="Document:"
-        Char:height="1" Char:width="9" Char:x="1" Char:y="3" />
-      <label text="Date:"
-        Char:height="1" Char:width="5" Char:x="19" Char:y="3" />
-      <label text="Credit:"
-        Char:height="1" Char:width="7" Char:x="29" Char:y="3" />
-      <label text="Debit:"
-        Char:height="1" Char:width="6" Char:x="59" Char:y="3" />
-
-      <entry name="entDoctype"
-        Char:height="1" Char:width="8" Char:x="1" Char:y="4"
-        block="blkBatchitem" field="fldDoctype" style="dropdown" />
-      <entry name="entNumber"
-        Char:height="1" Char:width="10" Char:x="9" Char:y="4"
-        block="blkBatchitem" field="fldNumber" />
-      <entry name="entDate"
-        Char:height="1" Char:width="10" Char:x="19" Char:y="4"
-        block="blkBatchitem" field="fldDate" displaymask="%x" inputmask="%x"/>
-      <entry name="entCreditNumber"
-        Char:height="1" Char:width="10" Char:x="29" Char:y="4"
-        block="blkBatchitem" field="fldCreditNumber" style="dropdown" />
-      <entry name="entCreditName"
-        Char:height="1" Char:width="15" Char:x="39" Char:y="4"
-        block="blkBatchitem" field="fldCreditName" style="dropdown" />
-      <entry name="entDebitNumber"
-        Char:height="1" Char:width="10" Char:x="54" Char:y="4"
-        block="blkBatchitem" field="fldDebitNumber" style="dropdown" />
-      <entry name="entDebitName"
-        Char:height="1" Char:width="15" Char:x="64" Char:y="4"
-        block="blkBatchitem" field="fldDebitName" style="dropdown" />
-      <entry name="entCurrency"
-        Char:height="1" Char:width="8" Char:x="79" Char:y="4"
-        block="blkBatchitem" field="fldCurrency" style="dropdown" />
-      <entry name="entAmountt"
-        Char:height="1" Char:width="12" Char:x="87" Char:y="4"
-        block="blkBatchitem" field="fldAmountt" />
-      <entry name="entComment"
-        Char:height="1" Char:width="70" Char:x="29" Char:y="5"
-        block="blkBatchitem" field="fldComment" />
+        <grid block="blk_batchitem" rows="10">
+          <gridline>
+            <entry name="ent_doctype"       label="Doc Type"   
field="fld_doctype"/>
+            <entry name="ent_number"        label="Doc Number" 
field="fld_number"/>
+            <entry name="ent_date"          label="Date"       
field="fld_date"/>
+            <entry name="ent_credit_number" label="Credit"     
field="fld_credit_number"/>
+            <entry name="ent_credit_name"                      
field="fld_credit_name"/>
+            <entry name="ent_debit_number"  label="Debit"      
field="fld_debit_number"/>
+            <entry name="ent_debit_name"                       
field="fld_debit_name"/>
+            <entry name="ent_currency"                         
field="fld_currency"/>
+            <entry name="ent_amountt"       label="Amount"     
field="fld_amountt"/>
+          </gridline>
+          <gridline>
+            <entry name="ent_empty" field="fld_empty" style="label" 
s:span="3"/>
+            <entry name="ent_comment"                          
field="fld_comment" s:span="6"/>
+          </gridline>
+        </grid>
+      </vbox>
     </page>
   </layout>
 </form>





reply via email to

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