/[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.35 by apronotti, Fri Jan 31 22:53:47 2003 UTC revision 1.36 by apronotti, Thu Feb 6 19:10:45 2003 UTC
# Line 411  Line 411 
411        genericBox("Esta excedido el Límite de Crédito",["Ok"])        genericBox("Esta excedido el Límite de Crédito",["Ok"])
412      else:      else:
413        if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.prodNameSEntry) > 0:        if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.prodNameSEntry) > 0:
414            callTrigger('startWaitingModeTrigger')
415          callTrigger ('commitTrigger')          callTrigger ('commitTrigger')
416          # it's _such_ a pitty          # it's _such_ a pitty
417          # pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) })          # pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) })
# Line 418  Line 419 
419          # pleasePrint (self, 'p1', '1', 'serviceInvoice-discriminated', [ 'id='+str(ownDocumentBlock.idEntry) ])          # pleasePrint (self, 'p1', '1', 'serviceInvoice-discriminated', [ 'id='+str(ownDocumentBlock.idEntry) ])
420          hack.pleasePrint (self, 'p1', '1', 'productInvoice', [ 'id='+str(ownDocumentBlock.idEntry) ])          hack.pleasePrint (self, 'p1', '1', 'productInvoice', [ 'id='+str(ownDocumentBlock.idEntry) ])
421          callTrigger('rollbackTrigger')          callTrigger('rollbackTrigger')
422                    callTrigger('endWaitingModeTrigger')        
423    ]]></trigger>    ]]></trigger>
424        
425    <trigger name="commitTrigger" type="NAMED">    <trigger name="commitTrigger" type="NAMED">
# Line 459  Line 460 
460          ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4))          ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4))
461       ownItemToUpdBlock.processRollback()       ownItemToUpdBlock.processRollback()
462    
463       setFocus(ownDocumentBlock.clientRecipientBox.clientEntry)       #setFocus(ownDocumentBlock.clientRecipientBox.clientEntry)
   
464    </trigger>    </trigger>
465    
466    <trigger name="rollbackTrigger" type="NAMED">    <trigger name="rollbackTrigger" type="NAMED">
467      tmpValuesDataSource.priceTypeId = None
468    for block in form._object._blockList:    for block in form._object._blockList:
469      block.processRollback ()      block.processRollback ()
470    
# Line 473  Line 474 
474    
475        
476    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()
477      #setFocus(ownDocumentBlock.clientCodeEntry)
478    </trigger>    </trigger>
479    <trigger name="startUp" type="On-Startup">    <trigger name="startUp" type="On-Startup">
480      tmpValuesDataSource.priceTypeId = None
481      tmpValuesDataSource.onSwitch = "0"
482    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()    tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp()
483    </trigger>    </trigger>
484    
# Line 485  Line 488 
488    exit()    exit()
489    </trigger>    </trigger>
490    
491  <!--  Este trigger clacula el total facturado -->    <!--  Este trigger clacula el total facturado -->
492    <trigger name="totalCalcTrigger" type="NAMED">    <trigger name="totalCalcTrigger" type="NAMED">
        if len(str(ownItemBlock.priceEntry)):  
493           import hack           import hack
494                    
495           lQty = hack.a2f(ownItemBlock.qtyEntry)           lQty = hack.a2f(ownItemBlock.qtyEntry)
# Line 496  Line 498 
498           lUnitPrice = hack.a2f(ownItemBlock.unitPriceEntry)           lUnitPrice = hack.a2f(ownItemBlock.unitPriceEntry)
499    
500           lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount           lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount
501    
502           ownItemBlock.taxAmountEntry = lItemPrice * hack.a2f(ownItemBlock.ivaEntry)/100           ownItemBlock.taxAmountEntry = lItemPrice * hack.a2f(ownItemBlock.ivaEntry)/100
503                     ownItemBlock.itemTotalEntry = lItemPrice + hack.a2f(ownItemBlock.taxAmountEntry)
504    
505           lTNeto = 0           lTNeto = 0
506           lTTax = 0           lTTax = 0
507                    
# Line 518  Line 522 
522             lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount             lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount
523             lTNeto += lItemPrice             lTNeto += lItemPrice
524             lTTax += hack.a2f(lRecord.getField("own_item_tax.amount"))             lTTax += hack.a2f(lRecord.getField("own_item_tax.amount"))
            ownItemBlock.itemTotalEntry = lItemPrice +lTTax  
525    
526           totalBlock.netoEntry = str(lTNeto)           totalBlock.netoEntry = str(lTNeto)
527           totalBlock.ivaEntry = str(lTTax)           totalBlock.ivaEntry = str(lTTax)
# Line 698  Line 701 
701          <entry name="nameEntry" field="_entity_data.name" hidden="" x="1" y="1" width="20"/>              <entry name="nameEntry" field="_entity_data.name" hidden="" x="1" y="1" width="20"/>    
702      </block>      </block>
703      <trigger name="clientSearchTrigger" type="NAMED"><![CDATA[      <trigger name="clientSearchTrigger" type="NAMED"><![CDATA[
704          tmpValuesDataSource.priceTypeId = None
705        codeToSearch = str(ownDocumentBlock.clientRecipientBox.clientCodeEntry)        codeToSearch = str(ownDocumentBlock.clientRecipientBox.clientCodeEntry)
706        nameToSearch = str(ownDocumentBlock.clientRecipientBox.clientNameEntry)        nameToSearch = str(ownDocumentBlock.clientRecipientBox.clientNameEntry)
707    
# Line 895  Line 899 
899      </trigger>      </trigger>
900    
901      <trigger name="prodSearchTrigger" type="NAMED">      <trigger name="prodSearchTrigger" type="NAMED">
902        #armado de la lista de recorrido del arbol      #armado de la lista de recorrido del arbol
903        if tmpValuesDataSource.priceTypeId:
904        search_id = str(tmpValuesDataSource.priceTypeId)        search_id = str(tmpValuesDataSource.priceTypeId)
905        priceListsChain=[]        priceListsChain=[]
906        while search_id != "" :        while search_id != "" :
# Line 944  Line 949 
949                            
950          runForm ('productSelect.gfd', {'data': prodResultBlock, 'callback': callback})          runForm ('productSelect.gfd', {'data': prodResultBlock, 'callback': callback})
951        elif recordCount == 1:        elif recordCount == 1:
952          clientResultBlock.jumpRecord(0)          prodResultBlock.jumpRecord(0)
953          callTrigger('prodInsertTrigger')          if not prodResultBlock.isEmpty():
954                        callTrigger('prodInsertTrigger')
955        else:
956          genericBox("Debe elegir un cliente para poder cargar productos",["Ok"])
957    </trigger>    </trigger>
958    
959    <!--   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 -->
# Line 980  Line 987 
987    
988      <!-- Productos facturados -->      <!-- Productos facturados -->
989    <block datasource="ownItemDataSource" name="ownItemBlock">    <block datasource="ownItemDataSource" name="ownItemBlock">
990  <!--     <trigger name="ownItemONSwitch" type="ON-SWITCH" src="totalCalcTrigger" /> -->  <!--     <trigger name="ownItemFocusOut" type="PRE-FOCUSOUT" src="totalCalcTrigger" /> -->
991      <label text="Productos a facturar" x="1" y="9"/>      <label text="Productos a facturar" x="1" y="9"/>
992      <label text="Código" x="1" y="10"/>      <label text="Código" x="1" y="10"/>
993      <entry name="prodCodeSEntry" width="14" x="1" y="11" rows="10"/>      <entry name="prodCodeSEntry" width="14" x="1" y="11" rows="10"/>

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

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