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

Diff of /papo/forms/productInvoice.gfd

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

revision 1.46 by apronotti, Fri Apr 4 22:23:20 2003 UTC revision 1.47 by apronotti, Wed Apr 9 18:05:07 2003 UTC
# Line 224  Line 224 
224          </eq>          </eq>
225          <and>          <and>
226            <or>            <or>
227    <!--             <eq> -->
228    <!--               <cfield name="own_document.own_document_type"/> -->
229    <!--               <cconst value="1"/>  -->
230    <!--             </eq> -->
231              <eq>              <eq>
232                <cfield name="own_document.own_document_type"/>                <cfield name="own_document.own_document_type"/>
233                <cconst value="1"/>                <cconst value="4"/>
234              </eq>              </eq>
235              <eq>              <eq>
236                <cfield name="own_document.own_document_type"/>                <cfield name="own_document.own_document_type"/>
237                <cconst value="4"/>                <cconst value="8"/>
238                </eq>
239                <eq>
240                  <cfield name="own_document.own_document_type"/>
241                  <cconst value="9"/>
242              </eq>              </eq>
243            </or>            </or>
244          </and>          </and>
# Line 291  Line 299 
299    
300    <!-- Origen de datos que contiene el numero de la proxima factura -->    <!-- Origen de datos que contiene el numero de la proxima factura -->
301    <datasource name="branchDocumentDataSource" database="papo"    <datasource name="branchDocumentDataSource" database="papo"
302      table="branch_document, _branch_document_data" historytable="_branch_document_data" prequery="">      table="branch_document, _branch_document_data" historytable="_branch_document_data">
303      <condition>      <condition>
304        <and>        <and>
305          <eq>          <eq>
# Line 299  Line 307 
307            <cfield name="_branch_document_data._table"/>            <cfield name="_branch_document_data._table"/>
308          </eq>          </eq>
309          <!-- numero para las facturas de servicios -->          <!-- numero para las facturas de servicios -->
310          <eq>  <!--         <eq> -->
311            <cfield name="_branch_document_data.document_type"/>  <!--           <cfield name="_branch_document_data.document_type"/> -->
312            <cconst value="4"/>  <!--           <cconst value="4"/> -->
313          </eq>  <!--         </eq> -->
314          <!-- que este activo -->          <!-- que este activo -->
315          <null>          <null>
316            <cfield name="_branch_document_data._end_t"/>            <cfield name="_branch_document_data._end_t"/>
# Line 420  Line 428 
428    <!-- Origen de datos que sirve para dar de alta pagos con algun tipo de currency -->    <!-- Origen de datos que sirve para dar de alta pagos con algun tipo de currency -->
429    <datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/>    <datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/>
430    
431      <trigger name="searchNextInvoiceNumber" type="NAMED"><![CDATA[
432        import gnue.common.GConditions as GConditions
433        
434        condInvoiceNumber = GConditions.GCondition()
435    
436        tmpAnd = GConditions.GCand(condInvoiceNumber)
437        eq = GConditions.GCeq(tmpAnd)
438        GConditions.GCField(eq,"_branch_document_data.document_type")
439        GConditions.GCConst(eq,str(ownDocumentBlock.typeEntry))
440        
441        branchDocumentDataSource.createResultSet(condInvoiceNumber)
442    
443      ]]></trigger>
444    
445      <trigger name="setInvoiceType" type="NAMED"><![CDATA[
446        invoiceType = str(ownDocumentBlock.invoiceTypeEntry).strip().lower()
447        if invoiceType == 'a':
448          ownDocumentBlock.typeEntry = '4'
449        elif invoiceType == 'b':
450          ownDocumentBlock.typeEntry = '8'
451        elif invoiceType == 'c':
452          ownDocumentBlock.typeEntry = '9'
453        else:
454          ownDocumentBlock.typeEntry = ''
455      ]]></trigger>
456    
457      <trigger name="invoiceTypeValidation" type="NAMED"><![CDATA[
458        if str(ownDocumentBlock.invoiceTypeEntry).strip().lower() not in ('a','b','c'):
459          genericBox('El tipo de factura es incorrecto',['Aceptar'])
460          ownDocumentBlock.invoiceTypeEntry = ""
461        else:
462          ownDocumentBlock.invoiceTypeEntry = str(ownDocumentBlock.invoiceTypeEntry).strip().upper()
463        callTrigger('setInvoiceType')
464        callTrigger('searchNextInvoiceNumber')
465      ]]></trigger>
466    
467    <trigger name="startWaitingModeTrigger" type="NAMED"><![CDATA[    <trigger name="startWaitingModeTrigger" type="NAMED"><![CDATA[
468      setStatusText("Procesando ...")      setStatusText("Procesando ...")
469      try:      try:
# Line 451  Line 495 
495                       hack.a2f(ownDocumentBlock.clientRecipientBox.deudaEntry)                       hack.a2f(ownDocumentBlock.clientRecipientBox.deudaEntry)
496    
497      if hack.a2f(payBlock.ctaCteEntry) > lCurrentCredit:      if hack.a2f(payBlock.ctaCteEntry) > lCurrentCredit:
498        genericBox("Esta excedido el Límite de Crédito",["Ok"])        genericBox("Esta excedido el Límite de Crédito",["Aceptar"])
499        elif not str(ownDocumentBlock.invoiceTypeEntry):
500          genericBox("Falta el tipo de factura",["Aceptar"])
501      else:      else:
502        if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.prodNameSEntry) > 0:        if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.prodNameSEntry) > 0:
503          callTrigger('startWaitingModeTrigger')          callTrigger('startWaitingModeTrigger')
# Line 466  Line 512 
512    ]]></trigger>    ]]></trigger>
513        
514    <trigger name="commitTrigger" type="NAMED">    <trigger name="commitTrigger" type="NAMED">
515    
516       ownDocumentBlock.numberEntry= str(branchDocumentBlock.documentNumberEntry)       ownDocumentBlock.numberEntry= str(branchDocumentBlock.documentNumberEntry)
517       branchDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1)       branchDocumentBlock.documentNumberEntry.atomicModify (lambda x: int(x)+1)
518    
# Line 478  Line 525 
525       proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp()       proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp()
526            
527       ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq')       ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq')
528       ownDocumentBlock.typeEntry = "4"       #typeValue =  str(ownDocumentBlock.invoiceTypeEntry).strip().lower()
529         #if typeValue == 'a':
530         #  ownDocumentBlock.typeEntry = "4"
531         #elif typeValue == 'b':
532         #  ownDocumentBlock.typeEntry = "8"
533         #elif typeValue == 'c':
534         #  ownDocumentBlock.typeEntry = "9"
535            
536       ownDocumentProceedingBlock.processRollback()       ownDocumentProceedingBlock.processRollback()
537       ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)       ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry)
# Line 512  Line 565 
565      block.processRollback ()      block.processRollback ()
566    
567    ownDocumentBlock.newRecord()    ownDocumentBlock.newRecord()
568    branchDocumentBlock.initQuery()    #branchDocumentBlock.initQuery()
569    branchDocumentBlock.processQuery()    #branchDocumentBlock.processQuery()
570    
571        
572    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()
# Line 750  Line 803 
803                                                              str(ownDocumentBlock.clientRecipientBox.currentClientEntry)})                                                              str(ownDocumentBlock.clientRecipientBox.currentClientEntry)})
804          clientResultSet.firstRecord()          clientResultSet.firstRecord()
805          tmpValuesDataSource.priceTypeId = clientResultSet.current.getField("_price_type_data._table")          tmpValuesDataSource.priceTypeId = clientResultSet.current.getField("_price_type_data._table")
806            # Calcula el tipo de factura qeu corresponde en funcion de la condicion ante el IVA de la empresa y la del cliente
807            clientIvaTaxProfle = int(str(tmpValuesDataSource.alienIVACond))
808            providerIvaTaxProfile = 1 # hay que corregir y averiguar la condicion correcta
809            ownDocumentBlock.invoiceTypeEntry = hack.calcInvoiceType(clientIvaTaxProfle, providerIvaTaxProfile)
810            callTrigger('invoiceTypeValidation')
811    ]]></trigger>    ]]></trigger>
812    
813      <!-- Bloque para la búsqueda de clientes -->      <!-- Bloque para la búsqueda de clientes -->
# Line 832  Line 890 
890             width="20" style="textlookup" foreign_key="clientDataSource._entity_data.id"             width="20" style="textlookup" foreign_key="clientDataSource._entity_data.id"
891             foreign_key_description="_price_type_data.name" />             foreign_key_description="_price_type_data.name" />
892    
893          <label name="scoreLbl" text="Puntaje" x="64" y="1" />  <!--         <label name="scoreLbl" text="Puntaje" x="64" y="1" /> -->
894          <entry x="64" y="2" readonly="" field="recipient" name="scoreEntry"  <!--         <entry x="64" y="2" readonly="" field="recipient" name="scoreEntry" -->
895                 width="10" style="textlookup" foreign_key="clientDataSource._entity_data.id"  <!--                width="10" style="textlookup" foreign_key="clientDataSource._entity_data.id" -->
896                 foreign_key_description="_client_data.score"/>  <!--                foreign_key_description="_client_data.score"/> -->
897    
898          <label name="nameMVType1Label" text="Límite de Cta. Cte." x="75" y="1"/>          <label name="nameMVType1Label" text="Límite de Cta. Cte." x="75" y="1"/>
899    
# Line 849  Line 907 
907          </box>          </box>
908          <entry field="date" name="dateEntry" style="label" hidden="" typecast="date"          <entry field="date" name="dateEntry" style="label" hidden="" typecast="date"
909            rows="10" width="24" x="7" y="7"/>            rows="10" width="24" x="7" y="7"/>
910          <entry field="number" name="numberEntry" style="label" hidden="" rows="10" width="24" x="7" y="7"/>          <entry field="number" name="numberEntry" style="label" hidden="" width="24" x="7" y="7"/>
911    
912            <label name="invoiceTypeLbl" text="Tipo" x="23" y="1" />
913            <entry name="invoiceTypeEntry" width="2" x="28" y="1">
914              <trigger type="PRE-FOCUSOUT" src="invoiceTypeValidation"/>
915            </entry>
916    
917        </block>        </block>
918                
# Line 1026  Line 1089 
1089          if not prodResultBlock.isEmpty():          if not prodResultBlock.isEmpty():
1090            callTrigger('prodInsertTrigger')            callTrigger('prodInsertTrigger')
1091      else:      else:
1092        genericBox("Debe elegir un cliente para poder cargar productos",["Ok"])        genericBox("Debe elegir un cliente para poder cargar productos",['Aceptar'])
1093    </trigger>    </trigger>
1094    
1095    <!--   En este bloque se almacena el reultado final/real de la búsqueda para seleccion el correcto -->    <!--   En este bloque se almacena el reultado final/real de la búsqueda para seleccion el correcto -->

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

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