/[papo]/papo/forms/client.gfd
ViewVC logotype

Diff of /papo/forms/client.gfd

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

revision 1.47 by charlie, Tue Apr 1 15:32:11 2003 UTC revision 1.48 by mhepp, Thu Apr 3 19:37:30 2003 UTC
# Line 5  Line 5 
5    <datasource name="searchDataSource" cache="1"/>    <datasource name="searchDataSource" cache="1"/>
6    
7    <datasource name="clientResultDataSource" database="papo"    <datasource name="clientResultDataSource" database="papo"
8                table="_entity_data, _alien_entity_data, _persona_data, _client_data, entity_type_uid_conf, _entity_uid_data"                table="_entity_data, _alien_entity_data, _persona_data, _client_data,  _entity_uid_data"
9                order_by="_entity_data.name">                order_by="_entity_data.name">
10        <!-- modified database -->
11        <!-- entity_type_uid_conf, -->
12        <!-- modified database -->
13      <condition>      <condition>
14        <and>        <and>
15          <eq>          <eq>
# Line 25  Line 28 
28           <cfield name="_entity_data._table"/>           <cfield name="_entity_data._table"/>
29            <cfield name="_entity_uid_data.entity"/>            <cfield name="_entity_uid_data.entity"/>
30          </eq>          </eq>
31    
32          <!-- use the configured code -->          <!-- use the configured code -->
33          <eq>          <!-- modified database -->
34           <cfield name="_entity_data.entity_type"/>      
35           <cfield name="entity_type_uid_conf.entity_type"/>          <!--    <eq> -->
36          </eq>          <!--          <cfield name="_entity_data.entity_type"/> -->
37            <!--          <cfield name="entity_type_uid_conf.entity_type"/> -->
38            <!--         </eq> -->
39    
40            <eq>
41              <cconst value="7"/>
42              <cfield name="entity_type_uid_conf.entity_type"/>
43            </eq>
44    
45    
46    
47            <!-- /modified database -->
48          <eq>          <eq>
49           <cfield name="_entity_uid_data.entity_uid_type"/>           <cfield name="_entity_uid_data.entity_uid_type"/>
50           <cfield name="entity_type_uid_conf.entity_uid_type"/>           <cfield name="entity_type_uid_conf.entity_uid_type"/>
51          </eq>          </eq>
52    
53    
54          <!-- eocc: end of commented code -->          <!-- eocc: end of commented code -->
55          <null>          <null>
56            <cfield name="_entity_data._end_t"/>            <cfield name="_entity_data._end_t"/>
# Line 54  Line 71 
71      </condition>      </condition>
72    </datasource>    </datasource>
73    
74    <!--abm-->
75    <datasource name="clientDataSource" database="papo"    <datasource name="clientDataSource" database="papo"
76                table="entity, _entity_data, alien_entity, _alien_entity_data, persona, _persona_data, client, _client_data, entity_type_uid_conf"                table="entity, _entity_data, alien_entity, _alien_entity_data, persona, _persona_data, client, _client_data, entity_type_uid_conf"
77                historytable="_entity_data, _alien_entity_data, _persona_data, _client_data">                historytable="_entity_data, _alien_entity_data, _persona_data, _client_data">
# Line 103  Line 121 
121      </condition>      </condition>
122    </datasource>    </datasource>
123    
124       <!--         parte de multi entities -->
125    
126          
127      <datasource name="entityTypesDataSource" database="papo"
128        detaillink="_entity_types_data.entity" master="clientDataSource"
129        masterlink="entity.id" table="entity_types, _entity_types_data" historytable="_entity_types_data">
130        <condition>
131        <and>
132          <eq>
133            <cfield name="entity_types.id"/>
134            <cfield name="_entity_types_data._table"/>
135          </eq>
136          <null>
137             <cfield name="_entity_types_data._end_t"/>
138          </null>
139        </and>
140        </condition>
141      </datasource>
142    
143    <!-- limite de credito -->
144    
145    
146    <datasource name="creditLimit1DataSource" database="papo"    <datasource name="creditLimit1DataSource" database="papo"
147      detaillink="_credit_limit_data.entity" master="clientDataSource"      detaillink="_credit_limit_data.entity" master="clientDataSource"
148      masterlink="entity.id" table="credit_limit, _credit_limit_data" historytable="_credit_limit_data">      masterlink="entity.id" table="credit_limit, _credit_limit_data" historytable="_credit_limit_data">
# Line 243  Line 283 
283      </condition>      </condition>
284    </datasource>    </datasource>
285    
   <datasource name="addressDataSource"  
     database="papo" table="address, _address_data" historytable="_address_data"  
     master="clientDataSource" masterlink="entity.id" detaillink="_address_data.entity">  
     <condition>  
     <and>  
       <eq>  
         <cfield name="address.id"/>  
         <cfield name="_address_data._table"/>  
       </eq>  
       <null>  
         <cfield name="_address_data._end_t"/>  
       </null>  
     </and>  
     </condition>  
   </datasource>  
286    
287    <datasource name="telephoneDataSource"  
288      database="papo" table="telephone, _telephone_data" historytable="_telephone_data"  
289      master="clientDataSource" masterlink="entity.id" detaillink="_telephone_data.entity">  
290      <condition>  
291      <and>  
292        <eq>  <!-- modified database -->
293          <cfield name="telephone.id"/>   <!--  <datasource name="addressDataSource" -->
294          <cfield name="_telephone_data._table"/>  <!--     database="papo" table="address, _address_data" historytable="_address_data" -->
295        </eq>  <!--     master="clientDataSource" masterlink="entity.id" detaillink="_address_data.entity"> -->
296        <null>  <!--     <condition> -->
297          <cfield name="_telephone_data._end_t"/>  <!--     <and> -->
298        </null>  <!--       <eq> -->
299      </and>  <!--         <cfield name="address.id"/> -->
300      </condition>  <!--         <cfield name="_address_data._table"/> -->
301    </datasource>  <!--       </eq> -->
302    <!--       <null> -->
303    <!--         <cfield name="_address_data._end_t"/> -->
304    <!--       </null> -->
305    <!--     </and> -->
306    <!--     </condition> -->
307    <!--   </datasource> -->
308    
309    <!--   <datasource name="telephoneDataSource" -->
310    <!--     database="papo" table="telephone, _telephone_data" historytable="_telephone_data" -->
311    <!--     master="clientDataSource" masterlink="entity.id" detaillink="_telephone_data.entity"> -->
312    <!--     <condition> -->
313    <!--     <and> -->
314    <!--       <eq> -->
315    <!--         <cfield name="telephone.id"/> -->
316    <!--         <cfield name="_telephone_data._table"/> -->
317    <!--       </eq> -->
318    <!--       <null> -->
319    <!--         <cfield name="_telephone_data._end_t"/> -->
320    <!--       </null> -->
321    <!--     </and> -->
322    <!--     </condition> -->
323    <!--   </datasource> -->
324    <!-- /modified database -->
325    
326    <datasource name="printClientDataSource" database="papo"    <datasource name="printClientDataSource" database="papo"
327                table="_entity_data, _alien_entity_data, _persona_data, _client_data, entity_type_uid_conf, _entity_uid_data"                table="_entity_data, _alien_entity_data, _persona_data, _client_data, entity_type_uid_conf, _entity_uid_data"
# Line 296  Line 344 
344           <cfield name="_entity_data._table"/>           <cfield name="_entity_data._table"/>
345            <cfield name="_entity_uid_data.entity"/>            <cfield name="_entity_uid_data.entity"/>
346          </eq>          </eq>
347    
348          <!-- use the configured code -->          <!-- use the configured code -->
349          <eq>          
350           <cfield name="_entity_data.entity_type"/>          <!-- modified database -->
351           <cfield name="entity_type_uid_conf.entity_type"/>          <!--    <eq> -->
352          </eq>          <!--          <cfield name="_entity_data.entity_type"/> -->
353            <!--          <cfield name="entity_type_uid_conf.entity_type"/> -->
354            <!--         </eq> -->
355            
356            <eq>
357              <cconst value="7"/>
358              <cfield name="entity_type_uid_conf.entity_type"/>
359            </eq>
360           <!-- /modified database -->
361    
362          <eq>          <eq>
363           <cfield name="_entity_uid_data.entity_uid_type"/>           <cfield name="_entity_uid_data.entity_uid_type"/>
364           <cfield name="entity_type_uid_conf.entity_uid_type"/>           <cfield name="entity_type_uid_conf.entity_uid_type"/>
# Line 325  Line 383 
383      </condition>      </condition>
384    </datasource>    </datasource>
385    
386    <datasource name="printAddressDataSource"  
387     <datasource name="printAddressDataSource"
388      database="papo" table="_address_data">      database="papo" table="_address_data">
389      <condition>      <condition>
390      <and>      <and>
# Line 336  Line 395 
395      </condition>      </condition>
396    </datasource>    </datasource>
397    
398    <datasource name="printTelephoneDataSource"  <!-- modified database -->
399      database="papo" table="_telephone_data">  
400    <!--   <datasource name="printTelephoneDataSource" -->
401    <!--     database="papo" table="_telephone_data"> -->
402    <!--     <condition> -->
403    <!--     <and> -->
404    <!--       <null> -->
405    <!--         <cfield name="_telephone_data._end_t"/> -->
406    <!--       </null> -->
407    <!--     </and> -->
408    <!--     </condition> -->
409    <!--   </datasource> -->
410    <!-- /modified database -->
411    
412    
413    <!-- address  -->
414      <datasource name="addressDataSource"
415        database="papo" table="address, _address_data" historytable="_address_data"
416        master="clientDataSource" masterlink="entity.id" detaillink="_address_data.entity">
417        <condition>
418        <and>
419          <eq>
420            <cfield name="address.id"/>
421            <cfield name="_address_data._table"/>
422          </eq>
423          <null>
424            <cfield name="_address_data._end_t"/>
425          </null>
426        </and>
427        </condition>
428      </datasource>
429    
430     <datasource database="papo" name="addressTypeResultDataSource"
431     table="address_type, _address_type_data" historytable="_address_type_data">
432      <condition>      <condition>
433      <and>      <and>
434          <eq>
435            <cfield name="address_type.id"/>
436            <cfield name="_address_type_data._table"/>
437          </eq>
438        <null>        <null>
439          <cfield name="_telephone_data._end_t"/>           <cfield name="_address_type_data._end_t"/>
440        </null>        </null>
441      </and>      </and>
442      </condition>      </condition>
443    </datasource>    </datasource>
444      <!-- attribute  -->
445    
446     <datasource name="attributeDataSource"
447        database="papo" table="entity_attribute, _entity_attribute_data" historytable="_entity_attribute_data"
448        master="clientDataSource" masterlink="entity.id" detaillink="_entity_attribute_data.entity">
449        <condition>
450        <and>
451          <eq>
452            <cfield name="entity_attribute.id"/>
453            <cfield name="_entity_attribute_data._table"/>
454          </eq>
455          <null>
456            <cfield name="_entity_attribute_data._end_t"/>
457          </null>
458        </and>
459        </condition>
460      </datasource>
461    
462     <datasource database="papo" name="categoryTypeResultDataSource"
463     table="category_type, _category_type_data, _category_entity_type_data" historytable="_category_type_data">
464        <condition>
465        <and>
466          <eq>
467            <cfield name="category_type.id"/>
468            <cfield name="_category_type_data._table"/>
469          </eq>
470            <!-- cliente es el 7-->
471            <eq>
472              <cconst value="7"/>
473              <cfield name="_category_entity_type_data.entity_type"/>
474            </eq>
475            <eq>
476              <cfield name="category_type.id"/>
477              <cfield name="_category_entity_type_data.category_type"/>
478            </eq>
479            <null>
480              <cfield name="_category_type_data._end_t"/>
481            </null>
482            <null>
483              <cfield name="_category_entity_type_data._end_t"/>
484            </null>
485          </and>
486        </condition>
487      </datasource>
488      
489      <datasource database="papo" name="categoryAtributeResultDataSource"
490        table="category_attribute, _category_attribute_data" historytable="_category_attribute_data">
491        <condition>
492          <and>
493            <eq>
494              <cfield name="category_attribute.id"/>
495              <cfield name="_category_attribute_data._table"/>
496            </eq>
497            <null>
498              <cfield name="_category_attribute_data._end_t"/>
499            </null>
500          </and>
501        </condition>
502      </datasource>
503    <!-- TRIGGERS -->
504    
505    <!-- abm -->
506    
507    <trigger name="commitTrigger" type="NAMED"><![CDATA[    <trigger name="commitTrigger" type="NAMED"><![CDATA[
508      print 'commitTrigger'      print 'commitTrigger'
# Line 366  Line 523 
523      if isOk:      if isOk:
524        if clientBlock.getCurrentRecord().isInserted():        if clientBlock.getCurrentRecord().isInserted():
525          # entity_type 7 es cliente          # entity_type 7 es cliente
526          clientBlock.clientEntityTypeEntry = 7          #clientBlock.clientEntityTypeEntry = 7
527          creditLimit1Block.newRecord()          creditLimit1Block.newRecord()
528          creditLimit1Block.movementTypeEntry = 1          creditLimit1Block.movementTypeEntry = 1
529          creditLimit1Block.creditLimitEntry = "0.0"          creditLimit1Block.creditLimitEntry = "0.0"
# Line 386  Line 543 
543          clientBlock.clientIdEntry = tmpId          clientBlock.clientIdEntry = tmpId
544          clientBlock.processQuery()          clientBlock.processQuery()
545          callTrigger("showClientPriceTypeTrigger")          callTrigger("showClientPriceTypeTrigger")
546            # modified database
547            entityTypesBlock.clientEntityEntry = str(clientBlock.clientIdEntry)
548            entityTypesBlock.clientEntityTypeEntry = 7
549            # le doy de alta a las 4 direcciones basicas
550            addressBlock.addressTypeIdEntry = 1
551            addressBlock.nextRecord()
552            addressBlock.addressTypeIdEntry = 2
553            addressBlock.nextRecord()
554            addressBlock.addressTypeIdEntry = 3
555            addressBlock.nextRecord()
556            addressBlock.addressTypeIdEntry = 4
557            entityTypesBlock.commit()
558            # modified database
559                    
560        else:        else:
561          clientBlock.commit()          clientBlock.commit()
562      else:      else:
# Line 416  Line 587 
587      hack.confirmPageChanges(self, 'commitTrigger', clientBlock)      hack.confirmPageChanges(self, 'commitTrigger', clientBlock)
588    ]]></trigger>    ]]></trigger>
589    
590    <trigger name="telephoneDeleteTrigger" type="NAMED"><![CDATA[  <!-- modified database -->
     telephoneBlock.deleteRecord()  
     telephoneBlock.commit()  
   ]]></trigger>  
591    
592    <trigger name="telephoneRollbackTrigger" type="NAMED"><![CDATA[  <!--   <trigger name="telephoneDeleteTrigger" type="NAMED"><![CDATA[ -->
593      import hack  <!--     telephoneBlock.deleteRecord() -->
594      hack.rollback(telephoneBlock)  <!--     telephoneBlock.commit() -->
595    ]]></trigger>  <!--   ]]></trigger> -->
596    
597    <!--   <trigger name="telephoneRollbackTrigger" type="NAMED"><![CDATA[ -->
598    <!--     import hack -->
599    <!--     hack.rollback(telephoneBlock) -->
600    <!--   ]]></trigger> -->
601    
602    <!-- /modified database -->
603    <trigger name="addressDeleteTrigger" type="NAMED"><![CDATA[    <trigger name="addressDeleteTrigger" type="NAMED"><![CDATA[
604      addressBlock.deleteRecord()      addressBlock.deleteRecord()
605      addressBlock.commit()      addressBlock.commit()
# Line 434  Line 608 
608    <trigger name="addressRollbackTrigger" type="NAMED"><![CDATA[    <trigger name="addressRollbackTrigger" type="NAMED"><![CDATA[
609      import hack      import hack
610      hack.rollback(addressBlock)      hack.rollback(addressBlock)
611        callTrigger('addressTypeNameSearchTrigger')
612    ]]></trigger>    ]]></trigger>
613    
614    
615    <trigger name="creditLimitRollbackTrigger" type="NAMED"><![CDATA[    <trigger name="creditLimitRollbackTrigger" type="NAMED"><![CDATA[
616      # why this is different from the others?      # why this is different from the others?
617      creditLimit1Block.processRollback(1)      creditLimit1Block.processRollback(1)
# Line 449  Line 625 
625      rollback(clientTaxProfileBlock)      rollback(clientTaxProfileBlock)
626    ]]></trigger>    ]]></trigger>
627    
628    <trigger name="printTrigger" type="NAMED"><![CDATA[  <!-- impresión -->
629    
630     <trigger name="printTrigger" type="NAMED"><![CDATA[
631    callTrigger('startWaitingModeTrigger')    callTrigger('startWaitingModeTrigger')
632    import gnue.common.GConditions as GConditions    import gnue.common.GConditions as GConditions
633    import string    import string
# Line 473  Line 651 
651    line = "\n\nListado de Clientes\n\n\n"    line = "\n\nListado de Clientes\n\n\n"
652    table.append(line)    table.append(line)
653    
654    line = "| " + printTitle("Codigo",14) + " | "    line = "| " + printTitle("Codigo",14) + " | "
655    line += printTitle("Nombre",20) + " | "    line += printTitle("Nombre",20) + " | "
656    line += printTitle("Direccion",20) + " | "    line += printTitle("Direccion",20) + " | "
657    line += printTitle("Telefono",20) + " |"    line += printTitle("Telefono",20) + " |"
658    lineLen = len(line)    lineLen = len(line)
659    table.append(line)    table.append(line)
# Line 490  Line 668 
668    more = clientResulSet.firstRecord();    more = clientResulSet.firstRecord();
669    
670    while more:    while more:
671          #agregar condicion de busquedq de direccion
672              
673        addressCondition = GConditions.GCondition()        addressCondition = GConditions.GCondition()
674        eq = GConditions.GCeq(addressCondition)        tmpAnd = GConditions.GCand(addressCondition)
675        GConditions.GCField(eq,"_address_data.entity")        eq1 = GConditions.GCeq(tmpAnd)
676        GConditions.GCConst(eq,str(clientResulSet.current.getField("_entity_data._table")))        GConditions.GCField(eq1,"_address_data.entity")
677          GConditions.GCConst(eq1,str(clientResulSet.current.getField("_entity_data._table")))
678          eq2 = GConditions.GCeq(tmpAnd)
679          GConditions.GCField(eq2,"_address_data.address_type")
680          GConditions.GCConst(eq2,"1")
681    
682        addressResulSet = printAddressDataSource.createResultSet(addressCondition)        addressResulSet = printAddressDataSource.createResultSet(addressCondition)
683        anAddress = addressResulSet.firstRecord()        anAddress = addressResulSet.firstRecord()
684        addresses = []        addresses = []
685                
686        while anAddress:        while anAddress:
687            addresses.append(addressResulSet.current.getField("address"))            addresses.append(addressResulSet.current.getField("address"))
688            anAddress = addressResulSet.nextRecord()            anAddress = addressResulSet.nextRecord()
689              
690          #ver que pasa con el telef
691              
692          #telephoneCondition = GConditions.GCondition()
693          #eq = GConditions.GCeq(telephoneCondition)
694          #GConditions.GCField(eq,"_telephone_data.entity")
695          #GConditions.GCConst(eq,str(clientResulSet.current.getField("_entity_data._table")))
696          #telephoneResulSet = printTelephoneDataSource.createResultSet(telephoneCondition)
697          #anTelephone = telephoneResulSet.firstRecord()
698          #telephones = []
699    
700          #while anTelephone:
701          #    telephones.append(telephoneResulSet.current.getField("telephone"))
702          #    anTelephone = telephoneResulSet.nextRecord()
703    
704        telephoneCondition = GConditions.GCondition()        # ahora telefono es una direccion de address_type = '2'
705        eq = GConditions.GCeq(telephoneCondition)  
706        GConditions.GCField(eq,"_telephone_data.entity")        addressCondition = GConditions.GCondition()
707        GConditions.GCConst(eq,str(clientResulSet.current.getField("_entity_data._table")))        tmpAnd = GConditions.GCand(addressCondition)
708        telephoneResulSet = printTelephoneDataSource.createResultSet(telephoneCondition)        eq1 = GConditions.GCeq(tmpAnd)
709          GConditions.GCField(eq1,"_address_data.entity")
710          GConditions.GCConst(eq1,str(clientResulSet.current.getField("_entity_data._table")))
711          eq2 = GConditions.GCeq(tmpAnd)
712          GConditions.GCField(eq2,"_address_data.address_type")
713          GConditions.GCConst(eq2,"2")
714          telephoneResulSet = printAddressDataSource.createResultSet(addressCondition)
715        anTelephone = telephoneResulSet.firstRecord()        anTelephone = telephoneResulSet.firstRecord()
716        telephones = []        telephones = []
717    
718        while anTelephone:        while anTelephone:
719            telephones.append(telephoneResulSet.current.getField("telephone"))            telephones.append(telephoneResulSet.current.getField("address"))
720            anTelephone = telephoneResulSet.nextRecord()            anTelephone = telephoneResulSet.nextRecord()
721    
722        line = "| " +printField(clientResulSet.current.getField("_entity_uid_data.uid"),14)+ " | "        line = "| " +printField(clientResulSet.current.getField("_entity_uid_data.uid"),14)+ " | "
723        line += printField(clientResulSet.current.getField("_entity_data.name"),20) + " | "        line += printField(clientResulSet.current.getField("_entity_data.name"),20) + " | "
724        line += printField(addresses.pop(),20) + " | "        if addresses:
725        line += printField(telephones.pop(),20) + " |"            line += printField(addresses.pop(),20) + " | "
726          else:
727              line += printField(" ",20) + " | "
728          if telephones:
729              line += printField(telephones.pop(),20) + " |"
730          else:
731              line += printField(" ",20) + " | "    
732        table.append(line)        table.append(line)
733                
734        while addresses or telephones:        while addresses or telephones:
735            line = "| " + printField(" ",14) + " | "            line = "| " + printField(" ",14) + " | "
736            line += printField(" ",20) + " | "            line += printField(" ",20) + " | "
737            if addresses:                          if addresses:
738                line += printField(addresses.pop(),20) + " | "                line += printField(addresses.pop(),20) + " | "
739            else:            else:
740                line += printField(" ",20) + " | "                line += printField(" ",20) + " | "
# Line 545  Line 755 
755        
756    ]]></trigger>    ]]></trigger>
757    
758    <!-- /impresion -->
759    
760    <trigger type="NAMED" name="searchTrigger"><![CDATA[    <trigger type="NAMED" name="searchTrigger"><![CDATA[
761    try:    try:
762        from gnue.forms.GFEvent import GFEvent        from gnue.forms.GFEvent import GFEvent
# Line 573  Line 785 
785    
786    ]]></trigger>    ]]></trigger>
787    
788    
789    
790      <trigger type="NAMED" name="clientPageFocusInTrigger"><![CDATA[      <trigger type="NAMED" name="clientPageFocusInTrigger"><![CDATA[
791      if str(clientResultBlock.clientIdREntry)!='':      if str(clientResultBlock.clientIdREntry)!='':
792        # this is needed for updating some fields, like price_type there below        # this is needed for updating some fields, like price_type there below
# Line 627  Line 841 
841      setStatusText("Listo")      setStatusText("Listo")
842    ]]></trigger>    ]]></trigger>
843    
844    <page name="Clientes">  
845    <!-- address tab -->
846     <trigger name="addressTypeNameSearchTrigger" type="NAMED"><![CDATA[
847       print "trigger de busqueda de nombres"
848       addressBlock.firstRecord()
849       for index in range(addressBlock.getRecordCount()):
850            if str(addressBlock.addressTypeIdEntry) != "":
851                addressTypeResultBlock.processRollback()
852                addressTypeResultBlock.initQuery()
853                addressTypeResultBlock.addressTypeResultIdEntry= str(addressBlock.addressTypeIdEntry)
854                addressTypeResultBlock.processQuery()
855                addressBlock.addressTypeNameEntry= str(addressTypeResultBlock.addressTypeResultNameEntry)
856            addressBlock.nextRecord()
857      ]]></trigger>
858    
859    
860        <!-- new_schema_begin -->
861              <trigger type="NAMED" name="callAddressTypeTrigger"><![CDATA[
862                  try:
863                    # gnue version <= 0.4
864                    from gnue.forms.GFEvent import GFEvent
865                  except ImportError:
866                    # gnue version >= 0.5
867                    from gnue.common.events.Event import Event as GFEvent
868    
869                  # busy clock
870                  form._object.dispatchEvent(GFEvent('beginWAIT'))
871                  setStatusText('buscando...')
872    
873                  def setAddressType (recNo):
874                    if recNo>=0:
875                      addressTypeResultBlock.jumpRecord (recNo)
876                      addressBlock.addressTypeIdEntry= str(addressTypeResultBlock.addressTypeResultIdEntry)
877                      addressBlock.addressTypeNameEntry= str(addressTypeResultBlock.addressTypeResultNameEntry)
878    
879                  # look for the name...
880                  addressTypeResultBlock.processRollback ()
881                  addressTypeResultBlock.initQuery ()
882                  addressTypeResultBlock.addressTypeResultNameEntry= str(addressBlock.addressTypeNameEntry)+'%'
883                  addressTypeResultBlock.processQuery ()
884    
885                  # are there too much results?
886                  resultCount= addressTypeResultBlock.getRecordCount ()
887                  if resultCount>1:
888                    # do the select-man
889                    runForm ('addressTypeSelect.gfd', {
890                      'data':addressTypeResultBlock,
891                      'callback': setAddressType
892                    })
893                  elif resultCount==1:
894                    setAddressType (0)
895    
896                  setStatusText('Ok')
897                  form._object.dispatchEvent(GFEvent('endWAIT'))
898              ]]></trigger>
899              <!-- new_schema_end -->
900    <!-- categorias -->
901    
902     <trigger name="attributeNameSearchTrigger" type="NAMED"><![CDATA[
903       print "trigger de busqueda de nombres"
904       attributeBlock.firstRecord()
905       for index in range(attributeBlock.getRecordCount()):
906            if str(attributeBlock.categoryAtributeIdEntry) != "":
907                categoryAtributeResultBlock.processRollback()
908                categoryAtributeResultBlock.initQuery()
909                categoryTypeResultBlock.processRollback()
910                categoryTypeResultBlock.initQuery()
911                categoryAtributeResultBlock.categoryAtributeResultIdEntry= str(attributeBlock.categoryAtributeIdEntry)
912                categoryAtributeResultBlock.processQuery()
913                attributeBlock.categoryAtributeNameEntry= str(categoryAtributeResultBlock.categoryAtributeResultNameEntry)
914                categoryTypeResultBlock.categoryTypeResultIdEntry = str(categoryAtributeResultBlock.categoryAtributeResultTypeIdEntry)
915                attributeBlock.categoryTypeIdEntry= str(categoryAtributeResultBlock.categoryAtributeResultTypeIdEntry)
916                categoryTypeResultBlock.processQuery()
917                attributeBlock.categoryTypeNameEntry= str(categoryTypeResultBlock.categoryTypeResultNameEntry)
918            attributeBlock.nextRecord()
919      ]]></trigger>
920    
921    <!-- pantallites de busquede category-->
922    
923              <trigger type="NAMED" name="callCategoryTypeTrigger"><![CDATA[
924                  try:
925                    # gnue version <= 0.4
926                    from gnue.forms.GFEvent import GFEvent
927                  except ImportError:
928                    # gnue version >= 0.5
929                    from gnue.common.events.Event import Event as GFEvent
930    
931                  # busy clock
932                  form._object.dispatchEvent(GFEvent('beginWAIT'))
933                  setStatusText('buscando...')
934    
935                  def setCategoryType (recNo):
936                    if recNo>=0:
937                      categoryTypeResultBlock.jumpRecord (recNo)
938                      attributeBlock.categoryTypeIdEntry= str(categoryTypeResultBlock.categoryTypeResultIdEntry)
939                      attributeBlock.categoryTypeNameEntry= str(categoryTypeResultBlock.categoryTypeResultNameEntry)
940    
941                  # look for the name...
942                  categoryTypeResultBlock.processRollback ()
943                  categoryTypeResultBlock.initQuery ()
944                  categoryTypeResultBlock.categoryTypeResultNameEntry= str(attributeBlock.categoryTypeNameEntry)+'%'
945                  categoryTypeResultBlock.processQuery ()
946    
947                  # are there too much results?
948                  resultCount= categoryTypeResultBlock.getRecordCount ()
949                  if resultCount>1:
950                    # do the select-man
951                    runForm ('categoryTypeSelect.gfd', {
952                      'data':categoryTypeResultBlock,
953                      'callback': setCategoryType
954                    })
955                  elif resultCount==1:
956                    setCategoryType (0)
957    
958                  setStatusText('Ok')
959                  form._object.dispatchEvent(GFEvent('endWAIT'))
960              ]]></trigger>
961    
962    <!-- pantallites de busquede category_attribute-->
963    
964              <trigger type="NAMED" name="callCategoryAtributeTrigger"><![CDATA[
965                  try:
966                    # gnue version <= 0.4
967                    from gnue.forms.GFEvent import GFEvent
968                  except ImportError:
969                    # gnue version >= 0.5
970                    from gnue.common.events.Event import Event as GFEvent
971    
972                  # busy clock
973                  form._object.dispatchEvent(GFEvent('beginWAIT'))
974                  setStatusText('buscando...')
975    
976                  def setCategoryAtribute (recNo):
977                    if recNo>=0:
978                      categoryAtributeResultBlock.jumpRecord (recNo)
979                      attributeBlock.categoryAtributeIdEntry= str(categoryAtributeResultBlock.categoryAtributeResultIdEntry)
980                      attributeBlock.categoryAtributeNameEntry= str(categoryAtributeResultBlock.categoryAtributeResultNameEntry)
981    
982                  # look for the name...
983                  categoryAtributeResultBlock.processRollback ()
984                  categoryAtributeResultBlock.initQuery ()
985                  categoryAtributeResultBlock.categoryAtributeResultNameEntry= str(attributeBlock.categoryAtributeNameEntry)+'%'
986                  categoryAtributeResultBlock.categoryAtributeResultTypeIdEntry= str(attributeBlock.categoryTypeIdEntry)
987                  categoryAtributeResultBlock.processQuery ()
988    
989                  # are there too much results?
990                  resultCount= categoryAtributeResultBlock.getRecordCount ()
991                  if resultCount>1:
992                    # do the select-man
993                    runForm ('categoryAtributeSelect.gfd', {
994                      'data':categoryAtributeResultBlock,
995                      'callback': setCategoryAtribute
996                    })
997                  elif resultCount==1:
998                    setCategoryAtribute (0)
999    
1000                  setStatusText('Ok')
1001                  form._object.dispatchEvent(GFEvent('endWAIT'))
1002              ]]></trigger>
1003    
1004      <trigger name="categoryDeleteTrigger" type="NAMED"><![CDATA[
1005        attributeBlock.deleteRecord()
1006        attributeBlock.commit()
1007      ]]></trigger>
1008    
1009      <trigger name="categoryRollbackTrigger" type="NAMED"><![CDATA[
1010        import hack
1011        hack.rollback(attributeBlock)
1012      ]]></trigger>
1013    
1014    
1015    
1016    
1017    
1018    
1019    
1020    <!-- PAGES -->
1021    
1022      <page name="Búsqueda">
1023      <trigger type="Pre-Focusout"><![CDATA[      <trigger type="Pre-Focusout"><![CDATA[
1024       clientBlock.processRollback()       clientBlock.processRollback()
1025       if clientResultBlock.getRecordCount() > 0 and not clientResultBlock.getCurrentRecord().isEmpty():       if clientResultBlock.getRecordCount() > 0 and not clientResultBlock.getCurrentRecord().isEmpty():
# Line 636  Line 1028 
1028         clientBlock.processQuery()         clientBlock.processQuery()
1029      ]]></trigger>      ]]></trigger>
1030    
1031    <!-- búsqueda -->
1032      <block name="clientSearchBlock" datasource="searchDataSource" transparentBlock="" restrictInsert="">      <block name="clientSearchBlock" datasource="searchDataSource" transparentBlock="" restrictInsert="">
1033        <label text="Datos a buscar:" x="1" y="1"/>        <label text="Datos a buscar:" x="1" y="1"/>
1034        <label text="Nombre o razón social" x="1" y="2" />        <label text="Nombre o razón social" x="1" y="2" />
# Line 656  Line 1049 
1049      </block>      </block>
1050    </page>    </page>
1051    
1052    <page name="Cliente">    <page name="Gestión">
1053      <!-- new_schema_begin -->      <!-- new_schema_begin -->
1054      <block name="searchingPriceTypeBlock" datasource="priceTypeDataSource">      <block name="searchingPriceTypeBlock" datasource="priceTypeDataSource">
1055        <entry name="idEntry" field="_table"        <entry name="idEntry" field="_table"
# Line 680  Line 1073 
1073            x="1" y="2"/>            x="1" y="2"/>
1074        </block>        </block>
1075    
1076    <!-- abm -->
1077        <block name="clientBlock" datasource="clientDataSource"        <block name="clientBlock" datasource="clientDataSource"
1078          restrictInsert="y" transparentBlock="y">          restrictInsert="y" transparentBlock="y">
1079          <button name="newButton" label="Nuevo" trigger="newTrigger"          <button name="newButton" label="Nuevo" trigger="newTrigger"
1080            x="42" y="2" width="9" height="1">            x="42" y="2" width="9" height="1">
1081            <trigger name="newTrigger" type="NAMED"><![CDATA[            <trigger name="newTrigger" type="NAMED"><![CDATA[
1082              from hack import confirmRollback              from hack import confirmRollback
   
1083              confirmRollback (self, clientBlock, 'commitTrigger', clientBlock.nameEntry)              confirmRollback (self, clientBlock, 'commitTrigger', clientBlock.nameEntry)
1084                #form.genericBox ('desea buscar entre entidades existentes', ['Aceptar'],['Cancelar'] )
1085            ]]></trigger>            ]]></trigger>
1086          </button>          </button>
1087          <entry name="clientIdEntry" field="entity.id" hidden="y"          <entry name="clientIdEntry" field="entity.id" hidden="y"
1088            x="1" y="1" width="20"/>            x="1" y="1" width="20"/>
1089          <entry name="clientEntityTypeEntry" field="_entity_data.entity_type" hidden="y"          <!-- modified database -->
1090            x="1" y="1" width="20"/>          <!--   <entry name="clientEntityTypeEntry" field="_entity_data.entity_type" hidden="y" -->
1091            <!--           x="1" y="1" width="20"/> -->
1092            <!-- /modified database -->
1093          <label text="Nombre o Razón Social"          <label text="Nombre o Razón Social"
1094            x="1" y="3"/>            x="1" y="3"/>
1095          <entry name="nameEntry" field="_entity_data.name"          <entry name="nameEntry" field="_entity_data.name"
# Line 710  Line 1106 
1106            x="1" y="8" width="35"/>            x="1" y="8" width="35"/>
1107          <button x="37" y="8" width="10" trigger="searchPriceTypeTrigger"          <button x="37" y="8" width="10" trigger="searchPriceTypeTrigger"
1108            label="Buscar" name="priceTypeBtn" height="1">            label="Buscar" name="priceTypeBtn" height="1">
1109    
1110            <!-- new_schema_begin -->            <!-- new_schema_begin -->
1111            <trigger type="NAMED" name="searchPriceTypeTrigger"><![CDATA[            <trigger type="NAMED" name="searchPriceTypeTrigger"><![CDATA[
1112              def setPriceType (recNo):              def setPriceType (recNo):
# Line 785  Line 1182 
1182          <button x="21" y="19" trigger="clientRollbackTrigger" width="9" label="Cancelar"          <button x="21" y="19" trigger="clientRollbackTrigger" width="9" label="Cancelar"
1183                  name="clientRollbackBtn" height="1"/>                  name="clientRollbackBtn" height="1"/>
1184        </block>        </block>
1185      </box>        <!-- entity types -->
1186    </page>        <block name="entityTypesBlock" datasource="entityTypesDataSource" >
1187            <entry name="clientEntityTypeEntry" field="_entity_types_data.entity_type"  
1188    <page name="Direcciones">            x="40" y="4" width="4" hidden=""/>
1189    <trigger type="Pre-Focusout" src="askForChangesTrigger"/>          <entry name="clientEntityEntry" field="_entity_types_data.entity"  
1190      <box label="Direcciones"            x="40" y="4" width="4" hidden=""/>
      x="0" y="0" height="5" width="64">  
      <block name="addressClientBlock" datasource="clientDataSource">  
         <label text="Nombre o Razón Social"  
           x="1" y="1"/>  
         <entry name="name" field="_entity_data.name" readonly=""  
           x="1" y="2" width="40">  
         </entry>  
      </block>  
     </box>  
     <box label="Direcciones"  
       x="0" y="5" height="15" width="64">  
       <block name="addressBlock" datasource="addressDataSource">  
         <label text="Direcciones"  
           x="1" y="1"/>  
         <entry name="address" field="_address_data.address" rows="4"  
           x="1" y="2" width="39"/>  
         <scrollbar page="4"  
           x="41" y="2" width="1" height="4"/>  
         <button x="1" y="12" trigger="commitTrigger" width="9" label="Aceptar"  
                 name="addressCommitBtn" height="1"/>  
         <button x="11" y="12" trigger="addressDeleteTrigger" width="9" label="Borrar"  
                 name="addressDeleteBtn" height="1"/>  
         <button x="21" y="12" trigger="addressRollbackTrigger" width="9" label="Cancelar"  
                 name="addressRollbackBtn" height="1"/>  
1191        </block>        </block>
1192          
1193      </box>      </box>
1194    </page>    </page>
1195    
1196    <page name="Teléfonos">  <!-- modified database -->
1197    <trigger type="Pre-Focusout" src="askForChangesTrigger"/>  
1198      <box label="Teléfonos"  <!--   <page name="Direcciones"> -->
1199          x="0" y="0" height="5" width="64">  <!--   <trigger type="Pre-Focusout" src="askForChangesTrigger"/> -->
1200       <block name="clientTelephoneBlock" datasource="clientDataSource">  <!--     <box label="Direcciones" -->
1201          <label text="Nombre o Razón Social"  <!--      x="0" y="0" height="5" width="64"> -->
1202            x="1" y="1"/>  <!--      <block name="addressClientBlock" datasource="clientDataSource"> -->
1203          <entry name="name" field="_entity_data.name" readonly=""  <!--         <label text="Nombre o Razón Social" -->
1204            x="1" y="2" width="40"/>  <!--           x="1" y="1"/> -->
1205       </block>  <!--         <entry name="name" field="_entity_data.name" readonly="" -->
1206      </box>  <!--           x="1" y="2" width="40"> -->
1207      <box label="Teléfonos"  <!--         </entry> -->
1208        x="0" y="5" height="15" width="64">  <!--      </block> -->
1209        <block name="telephoneBlock" datasource="telephoneDataSource">  <!--     </box> -->
1210          <label text="Teléfonos"  <!--     <box label="Direcciones" -->
1211            x="1" y="1"/>  <!--       x="0" y="5" height="15" width="64"> -->
1212          <entry name="telephone" field="_telephone_data.telephone" rows="4"  <!--       <block name="addressBlock" datasource="addressDataSource"> -->
1213            x="1" y="2" width="39"/>  <!--         <label text="Direcciones" -->
1214          <scrollbar page="4"  <!--           x="1" y="1"/> -->
1215            x="41" y="2" width="1" height="4"/>  <!--         <entry name="address" field="_address_data.address" rows="4" -->
1216          <button x="1" y="12" trigger="commitTrigger" width="9" label="Aceptar"  <!--           x="1" y="2" width="39"/> -->
1217                  name="telephoneCommitBtn" height="1"/>  <!--         <scrollbar page="4" -->
1218          <button x="11" y="12" trigger="telephoneDeleteTrigger" width="9" label="Borrar"  <!--           x="41" y="2" width="1" height="4"/> -->
1219                  name="telephoneDeleteBtn" height="1"/>  <!--         <button x="1" y="12" trigger="commitTrigger" width="9" label="Aceptar" -->
1220          <button x="21" y="12" trigger="telephoneRollbackTrigger" width="9" label="Cancelar"  <!--                 name="addressCommitBtn" height="1"/> -->
1221                  name="telephoneRollbackBtn" height="1"/>  <!--         <button x="11" y="12" trigger="addressDeleteTrigger" width="9" label="Borrar" -->
1222        </block>  <!--                 name="addressDeleteBtn" height="1"/> -->
1223      </box>  <!--         <button x="21" y="12" trigger="addressRollbackTrigger" width="9" label="Cancelar" -->
1224    </page>  <!--                 name="addressRollbackBtn" height="1"/> -->
1225    <!--       </block> -->
1226    <!--     </box> -->
1227    <!--   </page> -->
1228    
1229    <!--   <page name="Teléfonos"> -->
1230    <!--   <trigger type="Pre-Focusout" src="askForChangesTrigger"/> -->
1231    <!--     <box label="Teléfonos" -->
1232    <!--         x="0" y="0" height="5" width="64"> -->
1233    <!--      <block name="clientTelephoneBlock" datasource="clientDataSource"> -->
1234    <!--         <label text="Nombre o Razón Social" -->
1235    <!--           x="1" y="1"/> -->
1236    <!--         <entry name="name" field="_entity_data.name" readonly="" -->
1237    <!--           x="1" y="2" width="40"/> -->
1238    <!--      </block> -->
1239    <!--     </box> -->
1240    <!--     <box label="Teléfonos" -->
1241    <!--       x="0" y="5" height="15" width="64"> -->
1242    <!--       <block name="telephoneBlock" datasource="telephoneDataSource"> -->
1243    <!--         <label text="Teléfonos" -->
1244    <!--           x="1" y="1"/> -->
1245    <!--         <entry name="telephone" field="_telephone_data.telephone" rows="4" -->
1246    <!--           x="1" y="2" width="39"/> -->
1247    <!--         <scrollbar page="4" -->
1248    <!--           x="41" y="2" width="1" height="4"/> -->
1249    <!--         <button x="1" y="12" trigger="commitTrigger" width="9" label="Aceptar" -->
1250    <!--                 name="telephoneCommitBtn" height="1"/> -->
1251    <!--         <button x="11" y="12" trigger="telephoneDeleteTrigger" width="9" label="Borrar" -->
1252    <!--                 name="telephoneDeleteBtn" height="1"/> -->
1253    <!--         <button x="21" y="12" trigger="telephoneRollbackTrigger" width="9" label="Cancelar" -->
1254    <!--                 name="telephoneRollbackBtn" height="1"/> -->
1255    <!--       </block> -->
1256    <!--     </box> -->
1257    <!--   </page> -->
1258    <!-- /modified database -->
1259    
1260    
1261    <page name="Límites crédito">    <page name="Límites crédito">
1262    <trigger type="Pre-Focusout" src="askForChangesTrigger"/>    <trigger type="Pre-Focusout" src="askForChangesTrigger"/>
# Line 932  Line 1341 
1341                  name="uidRollbackBtn" height="1"/>                  name="uidRollbackBtn" height="1"/>
1342      </box>      </box>
1343    </page>    </page>
1344    
1345    <!-- direcciones -->
1346      <page name="Direcciones">
1347        <trigger type="Pre-Focusin" src="addressTypeNameSearchTrigger"/>
1348        <trigger type="Pre-Focusout" src="askForChangesTrigger"/>
1349        <box label="Direcciones"
1350         x="0" y="0" height="5" width="84">
1351         <block name="addressClientBlock" datasource="clientDataSource">
1352            <label text="Nombre o Razón Social"
1353              x="1" y="1"/>
1354            <entry name="name" field="_entity_data.name" readonly=""
1355              x="1" y="2" width="40">
1356            </entry>
1357         </block>
1358        </box>
1359        <box label="Direcciones"
1360          x="0" y="5" height="15" width="84">
1361          <block name="addressBlock" datasource="addressDataSource">
1362            <label text="type" x="1" y="1"/>
1363            <label text="valor" x="27" y="1"/>
1364            <label text="obsevacion" x="57" y="1"/>
1365            <entry name="addressTypeIdEntry" field="_address_data.address_type" rows="8"
1366              x="1" y="2" width="2" hidden=""  />  
1367            <entry name="addressTypeNameEntry" rows="8"
1368              x="1" y="2" width="20"/>
1369            <entry name="addressValueEntry" field="_address_data.address" rows="8"
1370              x="30" y="2" width="30"/>
1371            <entry name="addressCommentEntry" field="_address_data.comment" rows="8"
1372              x="60" y="2" width="20"/>
1373            <scrollbar page="8"
1374              x="81" y="2" width="1" height="8"/>
1375            <button x="1" y="12" trigger="commitTrigger" width="9" label="Aceptar"
1376                    name="addressCommitBtn" height="1"/>
1377            <button x="11" y="12" trigger="addressDeleteTrigger" width="9" label="Borrar"
1378                    name="addressDeleteBtn" height="1"/>
1379            <button x="21" y="12" trigger="addressRollbackTrigger" width="9" label="Cancelar"
1380                    name="addressRollbackBtn" height="1"/>
1381            <button x="22" y="2" trigger="callAddressTypeTrigger" width="7" label="Buscar"
1382              name="addressTypeBtn" height="8"/>
1383          </block>
1384    
1385          <block name="addressTypeResultBlock"  datasource="addressTypeResultDataSource">
1386            <entry name="addressTypeResultIdEntry" field="_address_type_data._table"
1387              x="75" y="4" width="2" hidden=""/>
1388            <entry name="addressTypeResultNameEntry" field="_address_type_data.name"
1389              x="78" y="4" width="20"  hidden=""/>
1390          </block>
1391        </box>
1392      </page>
1393    <!-- categorias -->
1394      <page name="Categorias">
1395           <trigger type="Pre-Focusin" src="attributeNameSearchTrigger"/>
1396        <!--     <trigger type="Pre-Focusout" src="askForChangesTrigger"/> -->
1397        <box label="Direcciones"
1398          x="0" y="0" height="5" width="84">
1399          <block name="categoryClientBlock" datasource="clientDataSource">
1400            <label text="Nombre o Razón Social"
1401              x="1" y="1"/>
1402            <entry name="categoryClientName" field="_entity_data.name" readonly=""
1403              x="1" y="2" width="40">
1404            </entry>
1405          </block>
1406        </box>
1407        <box label="Categorias"
1408          x="0" y="5" height="15" width="84">
1409          <block name="attributeBlock" datasource="attributeDataSource">
1410            <label text="category" x="1" y="1"/>
1411            <label text="attribute" x="30" y="1"/>
1412            <entry name="categoryTypeIdEntry" rows="8"
1413              x="1" y="2" hidden=""/>  
1414            <entry name="categoryTypeNameEntry" rows="8"
1415              x="1" y="2" width="20"/>
1416            <entry name="categoryAtributeIdEntry" field="_entity_attribute_data.category_attribute" rows="8"
1417              x="23" y="2" hidden=""/>
1418            <entry name="categoryAtributeNameEntry"  rows="8"
1419              x="30" y="2" width="20"/>
1420            <scrollbar page="8"
1421              x="60" y="2" width="1" height="8"/>
1422            <button x="1" y="12" trigger="commitTrigger" width="9" label="Aceptar"
1423                    name="categoryCommitBtn" height="1"/>
1424             <button x="11" y="12" trigger="categoryDeleteTrigger" width="9" label="Borrar"
1425                     name="categoryDeleteBtn" height="1"/>
1426             <button x="21" y="12" trigger="categoryRollbackTrigger" width="9" label="Cancelar"
1427                     name="categoryRollbackBtn" height="1"/>
1428            <button x="22" y="2" trigger="callCategoryTypeTrigger" width="7" label="Buscar"
1429              name="categoryTypeBtn" height="8"/>
1430            <button x="51" y="2" trigger="callCategoryAtributeTrigger" width="7" label="Buscar"
1431              name="categoryAtributeBtn" height="8"/>
1432          </block>
1433          <block name="categoryTypeResultBlock"  datasource="categoryTypeResultDataSource">
1434            <entry name="categoryTypeResultIdEntry" field="_category_type_data._table"
1435              x="55" y="2" width="2" hidden=""/>
1436            <entry name="categoryTypeResultNameEntry" field="_category_type_data.name"
1437              x="58" y="2" width="20" hidden=""/>
1438          </block>
1439          <block name="categoryAtributeResultBlock"  datasource="categoryAtributeResultDataSource">
1440            <entry name="categoryAtributeResultIdEntry" field="_category_attribute_data._table"
1441              x="55" y="8" width="2" hidden=""/>    
1442            <entry name="categoryAtributeResultTypeIdEntry" field="_category_attribute_data.category_type"
1443              x="58" y="8" width="2" hidden=""/>    
1444            <entry name="categoryAtributeResultNameEntry" field="_category_attribute_data.name"
1445              x="61" y="8" width="20" hidden=""/>
1446          </block>
1447          
1448        </box>
1449      </page>
1450    
1451  </form>  </form>
1452    
1453    
1454    
1455    
1456    
1457    
1458    
1459    
1460    

Legend:
Removed from v.1.47  
changed lines
  Added in v.1.48

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