/[papo]/papo/forms/priceType-new.gfd
ViewVC logotype

Diff of /papo/forms/priceType-new.gfd

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mhepp, Fri Oct 4 22:13:24 2002 UTC revision 1.3 by apronotti, Fri Nov 1 16:09:47 2002 UTC
# Line 2  Line 2 
2  <!DOCTYPE form SYSTEM "gnue-forms.dtd">  <!DOCTYPE form SYSTEM "gnue-forms.dtd">
3    
4  <form tabbed="top" title="Listas de Precios"  <form tabbed="top" title="Listas de Precios"
5    height="30" width="84">    height="23" width="74">
6    <datasource name="searchDataSource" cache="1"/>    <datasource name="searchDataSource" cache="1"/>
7    <datasource database="papo" name="priceTypeDataSource" table="pricetype"/>    <datasource database="papo" name="priceTypeResultDataSource" table="price_type, _price_type_data" historytable="_price_type_data">
8        <condition>
9        <and>
10          <eq>
11            <cfield name="price_type.id"/>
12            <cfield name="_price_type_data._table"/>
13          </eq>
14          <null>
15             <cfield name="_price_type_data._end_t"/>
16          </null>
17        </and>
18        </condition>
19      </datasource>
20    
21      <datasource database="papo" name="priceTypeDataSource" table="price_type, _price_type_data" historytable="_price_type_data">
22        <condition>
23        <and>
24          <eq>
25            <cfield name="price_type.id"/>
26            <cfield name="_price_type_data._table"/>
27          </eq>
28          <null>
29             <cfield name="_price_type_data._end_t"/>
30          </null>
31        </and>
32        </condition>
33      </datasource>
34    
35      <datasource database="papo" name="parentPriceTypeDataSource" table="_price_type_data">
36        <condition>
37        <and>
38          <null>
39            <cfield name="_price_type_data.parent"/>
40          </null>
41          <null>
42             <cfield name="_price_type_data._end_t"/>
43          </null>
44        </and>
45        </condition>
46      </datasource>
47    
48    <datasource name="productDataSource" database="papo"    <datasource name="productDataSource" database="papo"
49      table="product"/>      table="product, _product_data" historytable="_product_data">
50    <datasource name="nil" cache="1"/>      <condition>
51        <and>
52          <eq>
53            <cfield name="product.id"/>
54            <cfield name="_product_data._table"/>
55          </eq>
56          <null>
57             <cfield name="_product_data._end_t"/>
58          </null>
59        </and>
60        </condition>
61      </datasource>
62    
63      <trigger name="askForChangesTrigger" type="NAMED">
64        import hack
65        hack.confirmPageChanges(self, self.commitTrigger, priceTypeBlock)
66      </trigger>
67    
68      <trigger name="commitTrigger" type="NAMED">
69        if priceTypeBlock.getCurrentRecord().isInserted():
70          priceTypeBlock.commit()
71          priceTypeBlock.jumpRecord(2)
72          tmpId = str(priceTypeBlock.priceTypeIdEntry)
73          priceTypeBlock.processRollback()
74          priceTypeBlock.initQuery()
75          priceTypeBlock.priceTypeIdEntry = tmpId
76          priceTypeBlock.processQuery()
77        else:
78          priceTypeBlock.commit()
79      </trigger>
80    
81      <trigger name="priceTypeDeleteTrigger" type="NAMED">
82        if str(priceTypeBlock.priceTypeIdEntry) == "1":
83          genericBox('La lista base no se puede borrar',['OK'])
84        else:
85          priceTypeBlock.deleteRecord()
86          priceTypeBlock.commit()
87      </trigger>
88    
89      <trigger name="priceTypeRollbackTrigger" type="NAMED">
90        import hack
91        hack.rollback(priceTypeBlock)
92      </trigger>
93    
94      <trigger type="NAMED" name="searchTrigger">
95        priceTypeResultBlock.processRollback()
96        priceTypeResultBlock.initQuery()
97        priceTypeResultBlock.nameListEntry = ("%s" % searchPriceListBlock.searchNameEntry)+"%"
98        priceTypeResultBlock.processQuery()
99      </trigger>
100    
101  <page name="Búsqueda">  <page name="Listas de Precios">
102     <trigger type="Pre-Focusout">
103       priceTypeBlock.processRollback()
104       if priceTypeResultBlock.getRecordCount() > 0 and not priceTypeResultBlock.getCurrentRecord().isEmpty():
105         priceTypeBlock.initQuery()
106         priceTypeBlock.priceTypeIdEntry = ("%s" % priceTypeResultBlock.priceTypeIdREntry)
107         print "priceTypeBlock.priceTypeIdEntry", priceTypeBlock.priceTypeIdEntry
108         print "priceTypeResultBlock.priceTypeIdREntry",priceTypeResultBlock.priceTypeIdREntry
109         priceTypeBlock.processQuery()
110     </trigger>
111   <block name="searchPriceListBlock" datasource="searchDataSource" transparentBlock="">   <block name="searchPriceListBlock" datasource="searchDataSource" transparentBlock="">
112          <label text="Lista de precios a buscar"          <label text="Lista de precios a buscar"
113            x="1" y="1"/>            x="1" y="1"/>
114          <entry name="searchNameEntry"          <entry name="searchNameEntry"
115            x="1" y="2" width="35">            x="1" y="2" width="35">
           <trigger type="Pre-Focusout">  
            resultPriceTypeBlock.processRollback()  
            resultPriceTypeBlock.initQuery()  
            resultPriceTypeBlock.nameListEntry = ("%s" % searchPriceListBlock.searchNameEntry)+"%"  
            resultPriceTypeBlock.processQuery()  
           </trigger>  
116          </entry>          </entry>
117            <button x="36" y="2" trigger="searchTrigger" width="9" label="Buscar"
118                    name="searchBtn" height="1"/>
119    
120       </block>       </block>
121       <block name="resultPriceTypeBlock" datasource="priceTypeDataSource">       <block name="priceTypeResultBlock" datasource="priceTypeResultDataSource">
122            <entry name="priceTypeIdREntry" field="price_type.id" hidden="" x="1" y="1" width="20" />
123          <label text="Resultado" x="1" y="3"/>          <label text="Resultado" x="1" y="3"/>
124          <entry name="nameListEntry" field="name"          <entry name="nameListEntry" field="_price_type_data.name"
125            x="1" y="4" width="40" rows="12"/>            x="1" y="4" width="40" rows="12"/>
126          <scrollbar page="12"          <scrollbar page="12"
127            x="42" y="4" width="1" height="12"/>            x="42" y="4" width="1" height="12"/>
128       </block>       </block>
129    </page>    </page>
   
130    
131    
132    <page name="Edicion de lista">    <page name="Lista de Precios">
133      <trigger type="Pre-Focusout" src="askForChangesTrigger"/>
134    <box label="Lista de Precios"    <box label="Lista de Precios"
135    x="0" y="0" height="18" width="44">    x="0" y="0" height="20" width="64">
136       <block name="b2" datasource="priceTypeDataSource">       <block name="priceTypeBlock" datasource="priceTypeDataSource">
137            <entry name="priceTypeIdEntry" field="price_type.id" hidden="" x="1" y="1" width="20" />
138          <label text="Nombre de la Lista de Precios"          <label text="Nombre de la Lista de Precios"
139            x="1" y="1"/>            x="1" y="1"/>
140          <entry name="name" field="name"          <entry name="nameEntry" field="_price_type_data.name"
141            x="1" y="2" width="40"/>            x="1" y="2" width="40"/>
142    
143          <label text="lista activa"          <label text="lista activa"
144            x="1" y="3"/>            x="1" y="3"/>
145          <entry name="comm" field="is_active"  x="1" y="4" width="1"/>          <entry name="isActiveEntry" field="_price_type_data.is_active"  x="1" y="4" width="1"/>
146            <label text="Esta lista esta basada en la lista ..."
147              x="1" y="5"/>
148            <entry x="1" y="6" field="_price_type_data.parent"
149              name="taxProfileEntry"
150              width="35" style="dropdown" foreign_key="parentPriceTypeDataSource._table"
151              foreign_key_description="name" />
152            <button x="1" y="17" trigger="commitTrigger" width="9" label="Aceptar"
153                    name="priceTypeCommitBtn" height="1"/>
154            <button x="11" y="17" trigger="priceTypeDeleteTrigger" width="9" label="Borrar"
155                    name="priceTypeDeleteBtn" height="1"/>
156            <button x="21" y="17" trigger="priceTypeRollbackTrigger" width="9" label="Cancelar"
157                    name="priceTypeRollbackBtn" height="1"/>
158    
159       </block>       </block>
160     </box>     </box>
161    
162    </page>    </page>
163    
164   <page name="carga modificacion de precios">   <page name="carga modificacion de precios">
165      <trigger type="Pre-Focusout" src="askForChangesTrigger"/>
166     <box label="Lista de precios" x="0" y="0" height="5" width="84">     <box label="Lista de precios" x="0" y="0" height="5" width="84">
167        <block name="priceTipeBlock" datasource="pricetypeDataSource">        <block name="pricePriceTypeBlock" datasource="priceTypeDataSource">
168          <label name="priceTipeLbl" text="tipo de lista" x="1" y="1"/>          <label name="priceTypeLbl" text="tipo de lista" x="1" y="1"/>
169          <entry name="priceTipename"  field="name" x="1" y="2" width="40"/>          <entry name="priceTypename"  field="_price_type_data.name" readonly="" x="1" y="2" width="40"/>
170          <entry name="priceTipeid" field="id"  x="40" y="2" width="10" hidden=""/>          <entry name="priceTypeId" field="price_type.id"  x="40" y="2" width="10" hidden=""/>
171        </block>        </block>
172      </box>      </box>
173  <!-- búsqueda -->  <!-- búsqueda -->
# Line 65  Line 176 
176   <datasource name="searchProductByCodeDataSource" cache="1"/>   <datasource name="searchProductByCodeDataSource" cache="1"/>
177      <trigger name="searchProductTrigger" type="NAMED">      <trigger name="searchProductTrigger" type="NAMED">
178        #armado de la lista de recorrido del arbol        #armado de la lista de recorrido del arbol
179        search_id= priceTipeBlock.priceTipeid        search_id= pricePriceTypeBlock.priceTypeId
180        priceListsChain=[]        priceListsChain=[]
181        while search_id >= 1 :        while search_id >= 1 :
182            treePriceTypeBlock.initQuery()            treePriceTypeBlock.initQuery()
# Line 103  Line 214 
214        priceModifyBlock.firstRecord()        priceModifyBlock.firstRecord()
215        for index in range(priceModifyBlock.getRecordCount()):        for index in range(priceModifyBlock.getRecordCount()):
216           if ("%s" % priceModifyBlock.priceModifyPriceListEntry) != ("%s" % priceModifyBlock.priceModifyPricePreviousListEntry):           if ("%s" % priceModifyBlock.priceModifyPriceListEntry) != ("%s" % priceModifyBlock.priceModifyPricePreviousListEntry):
217              if ("%s" % priceTipeBlock.priceTipeid ) == ("%s" % priceModifyBlock.priceModifyPriceListIdListEntry ):              if ("%s" % pricePriceTypeBlock.priceTypeId ) == ("%s" % priceModifyBlock.priceModifyPriceListIdListEntry ):
218                  priceCommitDataBlock.processRollback()                  priceCommitDataBlock.processRollback()
219                  priceCommitDataBlock.initQuery()                  priceCommitDataBlock.initQuery()
220                  priceCommitDataBlock.priceCommitProductIdEntry = ("%s" % priceModifyBlock.priceModifyProductIdListEntry)                  priceCommitDataBlock.priceCommitProductIdEntry = ("%s" % priceModifyBlock.priceModifyProductIdListEntry)
221                  priceCommitDataBlock.priceCommitPriceTypeEntry = ("%s" % priceTipeBlock.priceTipeid  )                  priceCommitDataBlock.priceCommitPriceTypeEntry = ("%s" % pricePriceTypeBlock.priceTypeId  )
222                  priceCommitDataBlock.processQuery()                  priceCommitDataBlock.processQuery()
223                  priceCommitDataBlock.priceCommitPriceEntry     = ("%s" % priceModifyBlock.priceModifyPriceListEntry)                  priceCommitDataBlock.priceCommitPriceEntry     = ("%s" % priceModifyBlock.priceModifyPriceListEntry)
224                  priceCommitDataBlock.commit()                  priceCommitDataBlock.commit()
# Line 116  Line 227 
227                  priceCommitDataBlock.processRollback()                  priceCommitDataBlock.processRollback()
228                  priceCommitDataBlock.newRecord()                  priceCommitDataBlock.newRecord()
229                  priceCommitDataBlock.priceCommitProductIdEntry = ("%s" % priceModifyBlock.priceModifyProductIdListEntry)                  priceCommitDataBlock.priceCommitProductIdEntry = ("%s" % priceModifyBlock.priceModifyProductIdListEntry)
230                  priceCommitDataBlock.priceCommitPriceTypeEntry = ("%s" % priceTipeBlock.priceTipeid  )                  priceCommitDataBlock.priceCommitPriceTypeEntry = ("%s" % pricePriceTypeBlock.priceTypeId  )
231                  priceCommitDataBlock.priceCommitPriceEntry     = ("%s" % priceModifyBlock.priceModifyPriceListEntry)                    priceCommitDataBlock.priceCommitPriceEntry     = ("%s" % priceModifyBlock.priceModifyPriceListEntry)  
232                  priceCommitDataBlock.commit()                  priceCommitDataBlock.commit()
233                  print "inserta"                  print "inserta"
# Line 124  Line 235 
235        #esto es una chanchada, proximamente llamar al trigger "searchProductTrigger"        #esto es una chanchada, proximamente llamar al trigger "searchProductTrigger"
236        #armado de la lista de recorrido del arbol        #armado de la lista de recorrido del arbol
237        #armado de la lista de recorrido del arbol        #armado de la lista de recorrido del arbol
238        search_id= priceTipeBlock.priceTipeid        search_id= pricePriceTypeBlock.priceTypeId
239        priceListsChain=[]        priceListsChain=[]
240        while search_id >= 1 :        while search_id >= 1 :
241            treePriceTypeBlock.initQuery()            treePriceTypeBlock.initQuery()
# Line 186  Line 297 
297  </box>  </box>
298  <!-- Parte oculta  -->  <!-- Parte oculta  -->
299      <!--búsqueda del arbol de lista de precios  -->      <!--búsqueda del arbol de lista de precios  -->
300      <datasource database="papo" name="treePriceTypeDataSource" table="pricetype"/>      <datasource database="papo" name="treePriceTypeDataSource" table="_price_type_data"/>
301        <block name="treePriceTypeBlock" datasource="treePriceTypeDataSource">        <block name="treePriceTypeBlock" datasource="treePriceTypeDataSource">
302          <entry name="treePriceTypeParentId"  field="parent" x="1"          <entry name="treePriceTypeParentId"  field="parent" x="1"
303          y="2" width="40"  hidden=""/>          y="2" width="40"  hidden=""/>
# Line 194  Line 305 
305        </block>        </block>
306      <!--/busqueda del arbol de lista de precios raiz -->      <!--/busqueda del arbol de lista de precios raiz -->
307      <datasource database="papo" name="productResultDataSource"      <datasource database="papo" name="productResultDataSource"
308        table="productcodetype,productcode,product,price,pricetype"        table="product_code_type, _product_code_type_data, product_code, _product_code_data, product, _product_data, price, _price_data, price_type, _price_type_data"
309        order_by = "product.name,pricetype.id desc" >        historytable="_product_code_type_data, _product_code_data, _product_data , _price_data, _price_type_data"
310          order_by = "_product_data.canonical_name,price_type.id desc" >
311      <condition>      <condition>
312        <and>        <and>
313          <eq>          <eq>
314            <cfield name="productcodetype.id"/>            <cfield name="product_code_type.id"/>
315            <cfield name="productcode.type"/>            <cfield name="_product_code_type_data._table"/>
316            </eq>
317            <eq>
318              <cfield name="product_code.id"/>
319              <cfield name="_product_code_data._table"/>
320          </eq>          </eq>
321          <eq>          <eq>
322            <cfield name="product.id"/>            <cfield name="product.id"/>
323            <cfield name="productcode.product"/>            <cfield name="_product_data._table"/>
324            </eq>
325            <eq>
326              <cfield name="price.id"/>
327              <cfield name="_price_data._table"/>
328            </eq>
329            <eq>
330              <cfield name="price_type.id"/>
331              <cfield name="_price_type_data._table"/>
332            </eq>
333    
334            <eq>
335              <cfield name="product_code_type.id"/>
336              <cfield name="_product_code_type_data._table"/>
337            </eq>
338            <eq>
339              <cfield name="product.id"/>
340              <cfield name="_product_code_data.product"/>
341          </eq>          </eq>
342          <eq>          <eq>
343            <cfield name="product.id"/>            <cfield name="product.id"/>
344            <cfield name="price.product"/>            <cfield name="_price_data.product"/>
345          </eq>          </eq>
346          <eq>          <eq>
347            <cfield name="pricetype.id"/>            <cfield name="price_type.id"/>
348            <cfield name="price.type"/>            <cfield name="_price_data.price_type"/>
349          </eq>          </eq>
350          <null>            <null>  
351             <cfield name="price.end_t"/>             <cfield name="_price_data._end_t"/>
352          </null>          </null>
353        </and>        </and>
354      </condition>      </condition>
355    </datasource>    </datasource>
356       <block  name="resultProductBlock" datasource="productResultDataSource">       <block  name="resultProductBlock" datasource="productResultDataSource">
357          <entry name="productNameListEntry" field="product.name" x="1" y="1" width="15" rows="2" hidden=""/>          <entry name="productNameListEntry" field="_product_data.canonical_name" x="1" y="1" width="15" rows="2" hidden=""/>
358          <entry name="productIdListEntry" field="product.id" x="15" y="1" width="5" rows="2" hidden=""/>          <entry name="productIdListEntry" field="_product_data.id" x="15" y="1" width="5" rows="2" hidden=""/>
359          <entry name="productCodeListEntry" field="productcode.code" x="20" y="1" width="10" rows="2" hidden=""/>          <entry name="productCodeListEntry" field="_product_code_data.code" x="20" y="1" width="10" rows="2" hidden=""/>
360          <entry name="productCodeTypeListEntry" field="productcode.type" x="30" y="1" width="5" rows="2" hidden=""/>          <entry name="productCodeTypeListEntry" field="_product_code_data.product_code_type" x="30" y="1" width="5" rows="2" hidden=""/>
361          <entry name="productPriceTypeListEntry" field="pricetype.name" x="35 " y="1" width="10" rows="2" hidden=""/>          <entry name="productPriceTypeListEntry" field="_price_type_data.name" x="35 " y="1" width="10" rows="2" hidden=""/>
362          <entry name="productPriceTypeIdListEntry" field="pricetype.id" x="45" y="1" width="5" rows="2" hidden=""/>          <entry name="productPriceTypeIdListEntry" field="_price_type_data.id" x="45" y="1" width="5" rows="2" hidden=""/>
363          <entry name="productPriceListEntry" field="price.unit_price"          <entry name="productPriceListEntry" field="_price_data.unit_price"
364          x="50" y="1" width="20" rows="2" hidden=""/>          x="50" y="1" width="20" rows="2" hidden=""/>
365        </block>        </block>
366     <!-- /parte oculta-->     <!-- /parte oculta-->
# Line 258  Line 391 
391      </box>      </box>
392  <!-- /ingreso visible -->  <!-- /ingreso visible -->
393  <!-- carga oculta-->  <!-- carga oculta-->
394      <datasource database="papo" name="priceCommitDataSource" table="price" >      <datasource database="papo" name="priceCommitDataSource" table="price, _price_data" historytable="_price_data">
395        <condition>        <condition>
396          <and>
397            <eq>
398              <cfield name="price.id"/>
399              <cfield name="_price_data._table"/>
400            </eq>
401          <null>            <null>  
402            <cfield name="price.end_t"/>            <cfield name="_price_data._end_t"/>
403          </null>          </null>
404          </and>
405        </condition>        </condition>
406      </datasource>      </datasource>
407         <block name="priceCommitDataBlock" datasource="priceCommitDataSource">         <block name="priceCommitDataBlock" datasource="priceCommitDataSource">
408          <entry name="priceCommitProductIdEntry"  field="product" x="1" y="2" width="20" hidden=""/>          <entry name="priceCommitProductIdEntry"  field="_price_data.product" x="1" y="2" width="20" hidden=""/>
409          <entry name="priceCommitPriceTypeEntry"  field="type" x="20" y="2" width="20" hidden=""/>          <entry name="priceCommitPriceTypeEntry"  field="_price_data.price_type" x="20" y="2" width="20" hidden=""/>
410          <entry name="priceCommitPriceEntry"  field="unit_price" x="40" y="2" width="20" hidden=""/>          <entry name="priceCommitPriceEntry"  field="_price_data.unit_price" x="40" y="2" width="20" hidden=""/>
411        </block>        </block>
412    
413  <!-- /carga oculta-->  <!-- /carga oculta-->

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26