/[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.40 by apronotti, Wed Mar 12 20:01:16 2003 UTC revision 1.41 by styxman, Fri Mar 14 23:35:51 2003 UTC
# Line 1  Line 1 
1  <?xml version="1.0" encoding="ISO-8859-1"?>  <?xml version="1.0" encoding="ISO-8859-1"?>
2    
3  <form tabbed="top" title="Clientes" height="18" width="84">  <form tabbed="top" title="Clientes" height="20" width="84">
 <!--   <maintoolbar enabled=""/> -->  
4    <datasource name="focusDataSource" cache="1"/>    <datasource name="focusDataSource" cache="1"/>
5    <datasource name="searchDataSource" cache="1"/>    <datasource name="searchDataSource" cache="1"/>
6    <datasource name="clientResultDataSource" database="papo"    <datasource name="clientResultDataSource" database="papo"
# Line 25  Line 24 
24           <cfield name="_entity_data._table"/>           <cfield name="_entity_data._table"/>
25            <cfield name="_entity_uid_data.entity"/>            <cfield name="_entity_uid_data.entity"/>
26          </eq>          </eq>
27            <!-- use the configured code -->
28          <eq>          <eq>
29           <cfield name="_entity_data.entity_type"/>           <cfield name="_entity_data.entity_type"/>
30           <cfield name="entity_type_uid_conf.entity_type"/>           <cfield name="entity_type_uid_conf.entity_type"/>
# Line 33  Line 33 
33           <cfield name="_entity_uid_data.entity_uid_type"/>           <cfield name="_entity_uid_data.entity_uid_type"/>
34           <cfield name="entity_type_uid_conf.entity_uid_type"/>           <cfield name="entity_type_uid_conf.entity_uid_type"/>
35          </eq>          </eq>
36            <!-- eocc: end of commented code -->
37          <null>          <null>
38            <cfield name="_entity_data._end_t"/>            <cfield name="_entity_data._end_t"/>
39          </null>          </null>
# Line 53  Line 54 
54    </datasource>    </datasource>
55    
56    <datasource name="clientDataSource" database="papo"    <datasource name="clientDataSource" database="papo"
57                table="entity, _entity_data, alien_entity, _alien_entity_data, persona, _persona_data, client, _client_data"                table="entity, _entity_data, alien_entity, _alien_entity_data, persona, _persona_data, client, _client_data, entity_type_uid_conf"
58                historytable="_entity_data, _alien_entity_data, _persona_data, _client_data">                historytable="_entity_data, _alien_entity_data, _persona_data, _client_data">
59      <condition>      <condition>
60        <and>        <and>
# Line 129  Line 130 
130      </condition>      </condition>
131    </datasource>    </datasource>
132    
133      <datasource name="entityUID_Code_DataSource" database="papo"
134        detaillink="_entity_uid_data.entity" master="clientDataSource"
135        masterlink="entity.id" table="entity_uid, _entity_uid_data" historytable="_entity_uid_data">
136        <condition>
137          <and>
138            <eq>
139              <cfield name="entity_uid.id"/>
140              <cfield name="_entity_uid_data._table"/>
141            </eq>
142            <eq>
143              <cfield name="_entity_uid_data.entity_uid_type"/>
144              <cconst value="3"/>
145            </eq>
146            <null>
147              <cfield name="_entity_uid_data._end_t"/>
148            </null>
149          </and>
150        </condition>
151      </datasource>
152    
153    <datasource name="entityUID_CUIT_DataSource" database="papo"    <datasource name="entityUID_CUIT_DataSource" database="papo"
154      detaillink="_entity_uid_data.entity" master="clientDataSource"      detaillink="_entity_uid_data.entity" master="clientDataSource"
155      masterlink="entity.id" table="entity_uid, _entity_uid_data" historytable="_entity_uid_data">      masterlink="entity.id" table="entity_uid, _entity_uid_data" historytable="_entity_uid_data">
156      <condition>      <condition>
157      <and>        <and>
158        <eq>          <eq>
159          <cfield name="entity_uid.id"/>            <cfield name="entity_uid.id"/>
160          <cfield name="_entity_uid_data._table"/>            <cfield name="_entity_uid_data._table"/>
161        </eq>          </eq>
162        <eq>          <eq>
163          <cfield name="_entity_uid_data.entity_uid_type"/>            <cfield name="_entity_uid_data.entity_uid_type"/>
164          <cconst value="1"/>            <cconst value="1"/>
165        </eq>          </eq>
166        <null>          <null>
167           <cfield name="_entity_uid_data._end_t"/>            <cfield name="_entity_uid_data._end_t"/>
168        </null>          </null>
169      </and>        </and>
170      </condition>      </condition>
171    </datasource>    </datasource>
172    
# Line 153  Line 174 
174      detaillink="_entity_uid_data.entity" master="clientDataSource"      detaillink="_entity_uid_data.entity" master="clientDataSource"
175      masterlink="entity.id" table="entity_uid, _entity_uid_data" historytable="_entity_uid_data">      masterlink="entity.id" table="entity_uid, _entity_uid_data" historytable="_entity_uid_data">
176      <condition>      <condition>
177      <and>        <and>
178        <eq>          <eq>
179          <cfield name="entity_uid.id"/>            <cfield name="entity_uid.id"/>
180          <cfield name="_entity_uid_data._table"/>            <cfield name="_entity_uid_data._table"/>
181        </eq>          </eq>
182        <eq>          <eq>
183          <cfield name="_entity_uid_data.entity_uid_type"/>            <cfield name="_entity_uid_data.entity_uid_type"/>
184          <cconst value="2"/>            <cconst value="2"/>
185        </eq>          </eq>
186        <null>          <null>
187           <cfield name="_entity_uid_data._end_t"/>            <cfield name="_entity_uid_data._end_t"/>
188        </null>          </null>
189      </and>        </and>
190      </condition>      </condition>
191    </datasource>    </datasource>
192    
# Line 255  Line 276 
276    
277    <trigger name="commitTrigger" type="NAMED"><![CDATA[    <trigger name="commitTrigger" type="NAMED"><![CDATA[
278      print 'commitTrigger'      print 'commitTrigger'
279    
280        isOk= 1
281        message= ''
282        # mandatory fields
283        if not str(clientBlock.nameEntry):
284          message+= 'Debe ingresar un nombre\n'
285          isOk= 0
286      if not str(clientBlock.priceTypeEntry):      if not str(clientBlock.priceTypeEntry):
287          clientBlock.priceTypeEntry = "1"        message+= 'Debe seleccionar una Lista de Precios\n'
288      if clientBlock.getCurrentRecord().isInserted():        isOk= 0
289        if not str(clientTaxProfileBlock.taxProfileEntry):
290          message+= 'Debe ingresar un categoría de IVA\n'
291          isOk= 0
292        
293        if isOk:
294          if clientBlock.getCurrentRecord().isInserted():
295          # entity_type 7 es cliente          # entity_type 7 es cliente
296          clientBlock.clientEntityTypeEntry = 7          clientBlock.clientEntityTypeEntry = 7
297          creditLimit1Block.newRecord()          creditLimit1Block.newRecord()
298          creditLimit1Block.movementTypeEntry = 1          creditLimit1Block.movementTypeEntry = 1
299          creditLimit1Block.creditLimitEntry = "0.0"          creditLimit1Block.creditLimitEntry = "0.0"
300          clientUID_CUIT_Block.newRecord()          clientUID_CUIT_Block.newRecord()
301            # 1 es CUIT
302          clientUID_CUIT_Block.uid_CUIT_TypeEntry = 1          clientUID_CUIT_Block.uid_CUIT_TypeEntry = 1
303          clientUID_IB_Block.newRecord()          clientUID_IB_Block.newRecord()
304            # 2 es Ingresos Brutos
305          clientUID_IB_Block.uid_IB_TypeEntry = 2          clientUID_IB_Block.uid_IB_TypeEntry = 2
306          clientTaxProfileBlock.newRecord()          # clientTaxProfileBlock.newRecord()
307          clientBlock.commit()          clientBlock.commit()
308            # porque esto?
309            $ para que los labels de la ultima pagina se actualizen apropiadamente
310          tmpId = str(clientBlock.clientIdEntry)          tmpId = str(clientBlock.clientIdEntry)
311          clientBlock.processRollback()          clientBlock.processRollback()
312          clientBlock.initQuery()          clientBlock.initQuery()
313          clientBlock.clientIdEntry = tmpId          clientBlock.clientIdEntry = tmpId
314          clientBlock.processQuery()          clientBlock.processQuery()
315      else:        else:
316          clientBlock.commit()          clientBlock.commit()
317      callTrigger("showClientPriceTypeTrigger")        # callTrigger("showClientPriceTypeTrigger")
318        else:
319          form.genericBox (message+'Los datos no han sido grabados', ['Aceptar'])
320    ]]></trigger>    ]]></trigger>
321    
322    <trigger name="clientDeleteTrigger" type="NAMED"><![CDATA[    <trigger name="clientDeleteTrigger" type="NAMED"><![CDATA[
# Line 291  Line 331 
331    
332    <trigger name="askForChangesTrigger" type="NAMED"><![CDATA[    <trigger name="askForChangesTrigger" type="NAMED"><![CDATA[
333      import hack      import hack
334        
335        # there are some places where the blocks are dirty
336        # for field in clientBloc
337        
338      hack.confirmPageChanges(self, 'commitTrigger', clientBlock)      hack.confirmPageChanges(self, 'commitTrigger', clientBlock)
339    ]]></trigger>    ]]></trigger>
340    
# Line 380  Line 424 
424      <trigger type="NAMED" name="clientPageFocusInTrigger"><![CDATA[      <trigger type="NAMED" name="clientPageFocusInTrigger"><![CDATA[
425      if str(clientResultBlock.clientIdREntry)!='':      if str(clientResultBlock.clientIdREntry)!='':
426        # this is needed for updating some fields, like price_type there below        # this is needed for updating some fields, like price_type there below
       print clientBlock.priceTypeEntry  
427        if str(clientBlock.priceTypeEntry)!='':        if str(clientBlock.priceTypeEntry)!='':
428          # look for the name...          # look for the name...
429          searchingPriceTypeBlock.processRollback ()          searchingPriceTypeBlock.processRollback ()
# Line 408  Line 451 
451      ]]></trigger>      ]]></trigger>
452    
453    <page name="Clientes">    <page name="Clientes">
454    <trigger type="Pre-Focusout"><![CDATA[      <trigger type="Pre-Focusout"><![CDATA[
455     clientBlock.processRollback()       clientBlock.processRollback()
456     if clientResultBlock.getRecordCount() > 0 and not clientResultBlock.getCurrentRecord().isEmpty():       if clientResultBlock.getRecordCount() > 0 and not clientResultBlock.getCurrentRecord().isEmpty():
457       clientBlock.initQuery()         clientBlock.initQuery()
458       clientBlock.clientIdEntry = ("%s" % clientResultBlock.clientIdREntry)         clientBlock.clientIdEntry = ("%s" % clientResultBlock.clientIdREntry)
459       clientBlock.processQuery()         clientBlock.processQuery()
460    ]]></trigger>      ]]></trigger>
461    
462      <block name="clientSearchBlock" datasource="searchDataSource" transparentBlock="" restrictInsert="">      <block name="clientSearchBlock" datasource="searchDataSource" transparentBlock="" restrictInsert="">
463        <label text="Datos a buscar:" x="1" y="1"/>        <label text="Datos a buscar:" x="1" y="1"/>
464        <label text="nombre o razón social" x="1" y="2" />        <label text="Nombre o razón social" x="1" y="2" />
465        <label text="               código" x="1" y="3"/>        <label text="               Código" x="1" y="3"/>
466        <entry name="searchNameEntry" x="24" y="2" width="55"/>        <entry name="searchNameEntry" x="24" y="2" width="55"/>
467        <entry name="searchCodeEntry" x="24" y="3" width="35"/>        <entry name="searchCodeEntry" x="24" y="3" width="35"/>
468        <entry style="label" name="notificationEntry" x="1" y="19" width="67"/>        <entry style="label" name="notificationEntry" x="1" y="19" width="67"/>
469        <button x="70" y="3" trigger="searchTrigger" width="9" label="Buscar" name="searchBtn" height="1"/>        <button x="70" y="3" trigger="searchTrigger" width="9" label="Buscar" name="searchBtn" height="1"/>
470        <button x="69" y="19" trigger="printTrigger" width="10" label="Imprimir" name="printBtn" height="1"/>        <button x="69" y="19" trigger="printTrigger" width="10" label="Imprimir" name="printBtn" height="1"/>
471      </block>      </block>
472    
473      <block name="clientResultBlock" datasource="clientResultDataSource">      <block name="clientResultBlock" datasource="clientResultDataSource">
474        <entry name="clientIdREntry" field="_entity_data._table" hidden="" x="1" y="1" width="20" />        <entry name="clientIdREntry" field="_entity_data._table" hidden="" x="1" y="1" width="20" />
475        <label text="Resultado" x="1" y="4"/>        <label text="Resultado" x="1" y="4"/>
# Line 433  Line 477 
477        <entry name="nameListEntry" field="_entity_data.name" x="21" y="5" width="58" rows="14"/>        <entry name="nameListEntry" field="_entity_data.name" x="21" y="5" width="58" rows="14"/>
478        <scrollbar page="12" x="80" y="5" width="1" height="14"/>        <scrollbar page="12" x="80" y="5" width="1" height="14"/>
479      </block>      </block>
   
480    </page>    </page>
481    
482    <page name="Cliente">    <page name="Cliente">
483      <!-- new_schema_begin -->      <!-- new_schema_begin -->
484      <block name="searchingPriceTypeBlock" datasource="priceTypeDataSource">      <block name="searchingPriceTypeBlock" datasource="priceTypeDataSource">
# Line 447  Line 491 
491      <!-- new_schema_end -->      <!-- new_schema_end -->
492      <trigger type="Pre-Focusout" src="askForChangesTrigger"/>      <trigger type="Pre-Focusout" src="askForChangesTrigger"/>
493      <box label="Datos"      <box label="Datos"
494          x="0" y="0" height="20" width="64">        x="0" y="0" height="23" width="64">
495        <block name="clientBlock" datasource="clientDataSource" restrictInsert="y">        <block name="clientCodeBlock" datasource="entityUID_Code_DataSource"
496          <entry name="clientIdEntry" field="entity.id" hidden=""          restrictInsert="y" transparentBlock="y">
497            x="1" y="1" width="20"/>          <label text="Código de cliente"
         <entry name="clientEntityTypeEntry" field="_entity_data.entity_type" hidden=""  
           x="1" y="1" width="20"/>  
         <label text="Nombre o Razón Social"  
498            x="1" y="1"/>            x="1" y="1"/>
499          <entry name="nameEntry" field="_entity_data.name"          <!-- 3 es Codigo interno -->
500            x="1" y="2" width="40"/>          <entry name="clientCodeId" field="_entity_uid_data.entity_uid_type" default="3"
501              x="1" y="1" hidden="y"/>
502            <entry name="clientCodeEntry" field="_entity_uid_data.uid"
503              x="1" y="2"/>
504          </block>
505          <block name="clientBlock" datasource="clientDataSource"
506            restrictInsert="y" transparentBlock="y">
507          <button name="newButton" label="Nuevo" trigger="newTrigger"          <button name="newButton" label="Nuevo" trigger="newTrigger"
508            x="42" y="2" width="9" height="1">            x="42" y="2" width="9" height="1">
509            <trigger name="newTrigger" type="NAMED"><![CDATA[            <trigger name="newTrigger" type="NAMED"><![CDATA[
# Line 465  Line 512 
512              confirmRollback (self, clientBlock, 'commitTrigger', clientBlock.nameEntry)              confirmRollback (self, clientBlock, 'commitTrigger', clientBlock.nameEntry)
513            ]]></trigger>            ]]></trigger>
514          </button>          </button>
515          <label text="Puntaje"          <entry name="clientIdEntry" field="entity.id" hidden="y"
516              x="1" y="1" width="20"/>
517            <entry name="clientEntityTypeEntry" field="_entity_data.entity_type" hidden="y"
518              x="1" y="1" width="20"/>
519            <label text="Nombre o Razón Social"
520            x="1" y="3"/>            x="1" y="3"/>
521            <entry name="nameEntry" field="_entity_data.name"
522              x="1" y="4" width="40"/>
523            <label text="Puntaje"
524              x="1" y="5"/>
525          <entry name="scoreEntry" field="_client_data.score" typecast="number" default="0"          <entry name="scoreEntry" field="_client_data.score" typecast="number" default="0"
526            x="1" y="4" width="10"/>            x="1" y="6" width="10"/>
527          <label text="Lista de precios asociada "          <label text="Lista de precios asociada "
528            x="1" y="5"/>            x="1" y="7"/>
529          <entry name="priceTypeEntry" field="_client_data.price_type"          <entry name="priceTypeEntry" field="_client_data.price_type"
530            x="1" y="1" hidden="y"/>            x="1" y="1" hidden="y"/>
531          <entry name="priceTypeNameEntry"          <entry name="priceTypeNameEntry"
532            x="1" y="6" width="35"/>            x="1" y="8" width="35"/>
533          <button x="37" y="6" width="10" trigger="searchPriceTypeTrigger"          <button x="37" y="8" width="10" trigger="searchPriceTypeTrigger"
534            label="Buscar" name="priceTypeBtn" height="1">            label="Buscar" name="priceTypeBtn" height="1">
535            <!-- new_schema_begin -->            <!-- new_schema_begin -->
536            <trigger type="NAMED" name="searchPriceTypeTrigger"><![CDATA[            <trigger type="NAMED" name="searchPriceTypeTrigger"><![CDATA[
# Line 521  Line 576 
576            ]]></trigger>            ]]></trigger>
577            <!-- new_schema_end -->            <!-- new_schema_end -->
578          </button>          </button>
579          <button x="49" y="6" width="5" trigger="callPriceTypeTrigger"          <button x="49" y="8" width="5" trigger="callPriceTypeTrigger"
580            label=" ... " name="priceTypeBtn" height="1">            label=" ... " name="priceTypeBtn" height="1">
581            <trigger type="NAMED" name="callPriceTypeTrigger">            <trigger type="NAMED" name="callPriceTypeTrigger">
582              runForm('priceType.gfd')              runForm('priceType.gfd')
583            </trigger>            </trigger>
584          </button>          </button>
585          <label text="Observaciones"          <label text="Observaciones"
586            x="1" y="7"/>            x="1" y="9"/>
587          <entry name="obs" field="_entity_data.observations"          <entry name="obs" field="_entity_data.observations"
588            x="1" y="8" width="25" height="5"/>            x="1" y="10" width="25" height="5"/>
589          <button x="1" y="17" trigger="commitTrigger" width="9" label="Aceptar"        </block>
590    
591          <block name="clientTaxProfileBlock" datasource="clientTaxProfileDataSource"
592            restrictInsert="y" transparentBlock="y">
593            <label text="Categoría en IVA"
594              x="1" y="15"/>
595            <entry x="1" y="16" field="_persona_tax_profile_data.tax_profile"
596              name="taxProfileEntry"
597              width="35" style="dropdown" foreign_key="taxProfileDataSource._table"
598              foreign_key_description="profile" />
599          </block>
600          
601          <block name="buttonBlock" datasource="focusDataSource"
602            transparentBlock="y">
603            <button x="1" y="19" trigger="commitTrigger" width="9" label="Aceptar"
604                  name="clientCommitBtn" height="1"/>                  name="clientCommitBtn" height="1"/>
605          <button x="11" y="17" trigger="clientDeleteTrigger" width="9" label="Borrar"          <button x="11" y="19" trigger="clientDeleteTrigger" width="9" label="Borrar"
606                  name="clientDeleteBtn" height="1"/>                  name="clientDeleteBtn" height="1"/>
607          <button x="21" y="17" trigger="clientRollbackTrigger" width="9" label="Cancelar"          <button x="21" y="19" trigger="clientRollbackTrigger" width="9" label="Cancelar"
608                  name="clientRollbackBtn" height="1"/>                  name="clientRollbackBtn" height="1"/>
609        </block>        </block>
   
610      </box>      </box>
611    </page>    </page>
612    
# Line 646  Line 714 
714      </box>      </box>
715      <box label=""      <box label=""
716          x="0" y="5" height="15" width="64">          x="0" y="5" height="15" width="64">
717       <block name="clientUID_CUIT_Block" datasource="entityUID_CUIT_DataSource" restrictInsert="">       <block name="clientUID_CUIT_Block" datasource="entityUID_CUIT_DataSource"
718          <entry x="1" y="1" field="_entity_uid_data.entity_uid_type"         restrictInsert="y" transparentBlock="y">
719            name="uid_CUIT_TypeEntry"         <entry x="1" y="1" field="_entity_uid_data.entity_uid_type"
720            width="19" style="textlookup" readonly="" foreign_key="entityUIDTypeDataSource.id"           name="uid_CUIT_TypeEntry"
721            foreign_key_description="name"/>           width="19" style="textlookup" readonly="" foreign_key="entityUIDTypeDataSource.id"
722          <entry name="uidEntry" field="_entity_uid_data.uid"           foreign_key_description="name"/>
723            x="20" y="1" width="24">         <entry name="uidEntry" field="_entity_uid_data.uid"
724            <trigger type="PRE-FOCUSOUT"><![CDATA[           x="20" y="1" width="24">
725              from cuit import validate           <trigger type="PRE-FOCUSOUT"><![CDATA[
726               from cuit import validate
727              if not validate (str(clientUID_CUIT_Block.uidEntry)):  
728                form.genericBox ('El CUIT es inválido', ['Aceptar'])             if not validate (str(clientUID_CUIT_Block.uidEntry)):
729            ]]></trigger>               form.genericBox ('El CUIT es inválido', ['Aceptar'])
730          </entry>           ]]></trigger>
731           </entry>
732       </block>       </block>
733       <block name="clientUID_IB_Block" datasource="entityUID_IB_DataSource">       <block name="clientUID_IB_Block" datasource="entityUID_IB_DataSource"
734          <entry x="1" y="2" field="_entity_uid_data.entity_uid_type"         restrictInsert="y" transparentBlock="y">
735            name="uid_IB_TypeEntry"         <entry x="1" y="2" field="_entity_uid_data.entity_uid_type"
736            width="19" style="textlookup" readonly="" foreign_key="entityUIDTypeDataSource.id"           name="uid_IB_TypeEntry"
737            foreign_key_description="name" />           width="19" style="textlookup" readonly="" foreign_key="entityUIDTypeDataSource.id"
738          <entry name="uidEntry" field="_entity_uid_data.uid"           foreign_key_description="name" />
739            x="20" y="2" width="24"/>         <entry name="uidEntry" field="_entity_uid_data.uid"
740             x="20" y="2" width="24"/>
741       </block>       </block>
742       <block name="clientTaxProfileBlock" datasource="clientTaxProfileDataSource">       <block name="clientTaxProfileBlock" datasource="clientTaxProfileDataSource"
743          <label text="Categoría en IVA"         restrictInsert="y" transparentBlock="y">
744            x="1" y="4"/>         <label text="Categoría en IVA"
745          <entry x="1" y="5" field="_persona_tax_profile_data.tax_profile"           x="1" y="4"/>
746            name="taxProfileEntry"         <entry x="1" y="5" field="_persona_tax_profile_data.tax_profile"
747            width="35" style="dropdown" foreign_key="taxProfileDataSource._table"           name="taxProfileEntry"
748            foreign_key_description="profile" />           width="35" style="dropdown" foreign_key="taxProfileDataSource._table"
749             foreign_key_description="profile" />
750       </block>       </block>
751       <button x="1" y="12" trigger="commitTrigger" width="9" label="Aceptar"       <button x="1" y="12" trigger="commitTrigger" width="9" label="Aceptar"
752                  name="uidCommitBtn" height="1"/>                  name="uidCommitBtn" height="1"/>

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

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