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

Diff of /papo/forms/serviceInvoice.gfd

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

revision 1.3 by styxman, Tue Nov 26 20:16:12 2002 UTC revision 1.4 by styxman, Thu Nov 28 17:36:24 2002 UTC
# Line 54  Line 54 
54    
55    <!-- Origen de datos para obtener el total facturado a este cliente (para el calculo del balance de la cta cte) -->    <!-- Origen de datos para obtener el total facturado a este cliente (para el calculo del balance de la cta cte) -->
56    <datasource name="invoiceTotalDataSource" database="papo"    <datasource name="invoiceTotalDataSource" database="papo"
57      table="_entity_data, own_document, own_item, own_serv_item, own_item_tax"      table="_entity_data, own_document, own_item, own_service_item, own_item_tax"
58      order_by="own_proditem.id">      order_by="own_service_item.id">
59      <condition>      <condition>
60        <and>        <and>
61          <eq>          <eq>
# Line 69  Line 69 
69          </eq>          </eq>
70          <eq>          <eq>
71            <cfield name="own_item.id"/>            <cfield name="own_item.id"/>
72            <cfield name="own_serv_item.own_item"/>            <cfield name="own_service_item.own_item"/>
73          </eq>          </eq>
74          <eq>          <eq>
75            <cfield name="own_item.id"/>            <cfield name="own_item.id"/>
# Line 133  Line 133 
133    </datasource>    </datasource>
134    
135    <!--   Origen de datos que contiene los items de la factura -->    <!--   Origen de datos que contiene los items de la factura -->
136    <datasource name="ownItemDataSource" database="papo" table="own_item, own_serv_item, own_item_tax"    <datasource name="ownItemDataSource" database="papo" table="own_item, own_service_item, own_item_tax"
137      master="ownDocumentDataSource" masterlink="id" detaillink="own_item.own_document">      master="ownDocumentDataSource" masterlink="id" detaillink="own_item.own_document">
138      <condition>      <condition>
139        <and>        <and>
140          <eq>          <eq>
141            <cfield name="own_item.id"/>            <cfield name="own_item.id"/>
142            <cfield name="own_serv_item.own_item"/>            <cfield name="own_service_item.own_item"/>
143          </eq>          </eq>
144          <eq>          <eq>
145            <cfield name="own_item.id"/>            <cfield name="own_item.id"/>
# Line 159  Line 159 
159    <!-- 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 -->
160    <datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/>    <datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/>
161        
   <!-- 'Origen' de datos para mantener los valores calculables -->  
   <datasource name="calculatedValuesDataSource" cache="1"/>  
     
   <datasource name="paymentDataSource" cache="1"/>  
     
162    <!-- 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 -->
163    <datasource name="currencyMovementDataSource" database="papo" table="movement, currency_movement">    <datasource name="currencyMovementDataSource" database="papo" table="movement, currency_movement">
164      <condition>      <condition>
# Line 183  Line 178 
178    <!-- 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 -->
179    <datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/>    <datasource name="ownDocumentProceedingDataSource" database="papo" table="own_document_proceeding"/>
180    
181      <!-- 'Origen' de datos para mantener los valores calculables -->
182      <datasource name="calculatedValuesDataSource" cache="1"/>
183      <!-- la fecha va aca asi rollback no se queja -->
184      <datasource name="dateDataSource" cache="1"/>
185      <datasource name="paymentDataSource" cache="1"/>
186      
187    <!-- global triggers -->    <!-- global triggers -->
188    <!-- Valor final del servicio, con impuesto y todo -->    <!-- Valor final del servicio, con impuesto y todo -->
189    <trigger name="calculateEndPriceTrigger" type="NAMED"><![CDATA[    <trigger name="calculateEndPriceTrigger" type="NAMED"><![CDATA[
# Line 213  Line 214 
214    ]]></trigger>    ]]></trigger>
215    
216    <trigger type="On-Startup"><![CDATA[    <trigger type="On-Startup"><![CDATA[
217      ownDocumentBlock.dateEntry= ownDocumentDataSource.getTimeStamp ()      dateBlock.dateEntry= ownDocumentDataSource.getTimeStamp ()
218    ]]></trigger>    ]]></trigger>
219        
220    <!-- buttons triggers -->    <!-- buttons triggers -->
# Line 228  Line 229 
229      for block in form._object._blockList:      for block in form._object._blockList:
230        block.processRollback ()        block.processRollback ()
231            
232      ownDocumentBlock.dateEntry= ownDocumentDataSource.getTimeStamp ()      dateBlock.dateEntry= ownDocumentDataSource.getTimeStamp ()
233      totalBlock.totalEntry= ""      totalBlock.totalEntry= ""
234      paymentBlock.cashEntry= ""      paymentBlock.cashEntry= ""
235      paymentBlock.ctaCteEntry= ""      paymentBlock.ctaCteEntry= ""
# Line 237  Line 238 
238    <trigger name="commitTrigger" type="NAMED"><![CDATA[    <trigger name="commitTrigger" type="NAMED"><![CDATA[
239      from hack import a2f      from hack import a2f
240    
241        # copy the date
242        ownDocumentBlock.dateEntry= dateDataSource.dateEntry
243        
244      # print "here 1!"      # print "here 1!"
245      currentCredit= a2f (calculatedValuesDataSource.creditLimitAmount) - \      currentCredit= a2f (calculatedValuesDataSource.creditLimitAmount) - \
246        a2f (ownDocumentBlock.clientRecipientBox.debtEntry)        a2f (ownDocumentBlock.clientRecipientBox.debtEntry)
247    
248      if a2f (totalBlock.totalEntry)>currentCredit:      if a2f (paymentBlock.ctaCteEntry)>currentCredit:
249        genericBox ("Está excedido el Límite de Crédito",["Ok"])        genericBox ("Está excedido el Límite de Crédito",["Ok"])
250      else:      else:
251        # print "here 2!"        # print "here 2!"
# Line 304  Line 308 
308                    
309          <!-- Datos del cliente -->          <!-- Datos del cliente -->
310          <box name="clientRecipientBox" label="Datos del Cliente"          <box name="clientRecipientBox" label="Datos del Cliente"
311            x="0" y="1" width="65" height="6">            x="0" y="1" width="65" height="5">
312            <!-- form things -->            <!-- form things -->
313            <label name="clientLabel" text="Cliente"            <label name="clientLabel" text="Cliente"
314              x="1" y="1"/>              x="1" y="1"/>
# Line 364  Line 368 
368                    # por todos los items del documento                    # por todos los items del documento
369                    # print "calc 5: [%s] %d" % (currentOwnDocument, spentTotal)                    # print "calc 5: [%s] %d" % (currentOwnDocument, spentTotal)
370                    while invoiceResultSet.current.getField ("own_document.id")==currentOwnDocument and more:                    while invoiceResultSet.current.getField ("own_document.id")==currentOwnDocument and more:
371                      itemTotal= a2f (invoiceResultSet.current.getField ("own_serv_item.amount"))                      itemTotal= a2f (invoiceResultSet.current.getField ("own_service_item.amount"))
372                      currentItem= invoiceResultSet.current.getField ("own_item.id")                      currentItem= invoiceResultSet.current.getField ("own_item.id")
373    
374                      # por todos los impuestos del item                      # por todos los impuestos del item
# Line 402  Line 406 
406              ]]></trigger>              ]]></trigger>
407    
408              <trigger type="PRE-FOCUSIN" name="showScoreTrigger"><![CDATA[              <trigger type="PRE-FOCUSIN" name="showScoreTrigger"><![CDATA[
409                ownDocumentBlock.clientRecipientBox.scoreEntry= ""                ownDocumentBlock.processRollback ()
               ownDocumentBlock.clientRecipientBox.creditLimitEntry= ""  
               ownDocumentBlock.clientRecipientBox.priceTypeEntry= ""  
               ownDocumentBlock.clientRecipientBox.debtEntry= ""  
410              ]]></trigger>              ]]></trigger>
411            </entry>            </entry>
412            <label name="scoreLabel" text="Puntaje"            <label name="scoreLabel" text="Puntaje"
# Line 423  Line 424 
424              foreign_key="textLookUpCreditLimitDataSource.entity" foreign_key_description="credit_limit"              foreign_key="textLookUpCreditLimitDataSource.entity" foreign_key_description="credit_limit"
425              x="43" y="2" width="8"/>              x="43" y="2" width="8"/>
426            <label name="debtLabel" text="Deuda"            <label name="debtLabel" text="Deuda"
427              x="55" y="2"/>              x="55" y="1"/>
428            <entry name="debtEntry" style="label"            <entry name="debtEntry" style="label"
429              x="55" y="3" width="12"/>              x="55" y="2" width="12"/>
430          </box>          </box>
431                    
         <!-- Datos de la factura -->  
         <entry name="dateEntry" field="date" style="label" readonly="" typecast="date"  
           x="7" y="7" width="24"/>  
   
432          <!-- buttons -->          <!-- buttons -->
433          <button name="commitButton" label="Aceptar" trigger="commitTrigger"          <button name="commitButton" label="Aceptar" trigger="commitTrigger"
434            x="65" y="3" width="14" height="1"/>            x="65" y="3" width="14" height="1"/>
435          <button name="rollbackButton" label="Deshacer" trigger="rollbackTrigger"          <button name="rollbackButton" label="Deshacer" trigger="rollbackTrigger"
436            x="65" y="4" width="14" height="1"/>            x="65" y="4" width="14" height="1"/>
437          <button name="quitButton" label="Salir" trigger="quitTrigger"          <!-- button name="quitButton" label="Salir" trigger="quitTrigger"
438            x="65" y="5" width="14" height="1"/>            x="65" y="5" width="14" height="1"/ -->
439          </block>
440          <block name="dateBlock" datasource="dateDataSource">
441            <!-- Datos de la factura -->
442            <label name="dateLabel" text="Fecha:"
443              x="2" y="6"/>
444            <entry name="dateEntry" field="date" style="label" readonly="" typecast="date"
445              x="10" y="6" width="24"/>
446        </block>        </block>
447                
448        <!-- Limites de credito del cliente -->        <!-- Limites de credito del cliente -->
# Line 465  Line 469 
469          <!-- Datos del servicio -->          <!-- Datos del servicio -->
470          <label name="serviceLabel" text="Servicio"          <label name="serviceLabel" text="Servicio"
471            x="1" y="1"/>            x="1" y="1"/>
472          <entry name="serviceEntry" field="own_serv_item.description"          <entry name="serviceEntry" field="own_service_item.description"
473            x="1" y="2" width="40" height="2" rows="5" rowSpacer="1"/>            x="1" y="2" width="40" height="2" rows="5" rowSpacer="1"/>
474          <label name="priceLabel" text="Precio"          <label name="priceLabel" text="Precio"
475            x="42" y="1"/>            x="42" y="1"/>
# Line 473  Line 477 
477          <!-- idea: un boton 'Impuestos' que abra una ventana con dos textlist (que no hay) -->          <!-- idea: un boton 'Impuestos' que abra una ventana con dos textlist (que no hay) -->
478          <!-- uno con todos los impuestos posibles y el otro con los que se le van a aplicar al servicio -->          <!-- uno con todos los impuestos posibles y el otro con los que se le van a aplicar al servicio -->
479          <!-- lo cual me lleva a pensar que se puede devolver cosas de ventanas a traves de tablas -->          <!-- lo cual me lleva a pensar que se puede devolver cosas de ventanas a traves de tablas -->
480          <entry name="priceEntry" field="own_serv_item.amount"          <entry name="priceEntry" field="own_service_item.amount"
481            x="42" y="2" width="10" rows="5" rowSpacer="1">            x="42" y="2" width="10" rows="5" rowSpacer="1">
482            <trigger type="PRE-FOCUSOUT" src="calculateEndPriceTrigger"/>            <trigger type="PRE-FOCUSOUT" src="calculateEndPriceTrigger"/>
483          </entry>          </entry>
# Line 546  Line 550 
550          x="1" y="1" width="12"/>          x="1" y="1" width="12"/>
551      </block>      </block>
552      <block name="ownDocumentProceedingBlock" datasource="ownDocumentProceedingDataSource">      <block name="ownDocumentProceedingBlock" datasource="ownDocumentProceedingDataSource">
553          <entry name="proceedingEntry" field="proceeding" hidden=""        <entry name="proceedingEntry" field="proceeding" hidden=""
554            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
555          <entry name="ownDocumentEntry" field="own_document" hidden=""        <entry name="ownDocumentEntry" field="own_document" hidden=""
556            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
557          <entry name="amountEntry" field="amount" hidden=""        <entry name="amountEntry" field="amount" hidden=""
558            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
559      </block>      </block>
560      <block name="currencyMovementBlock" datasource="currencyMovementDataSource">      <block name="currencyMovementBlock" datasource="currencyMovementDataSource">
561          <entry name="proceedingEntry" field="movement.proceeding" hidden=""        <entry name="proceedingEntry" field="movement.proceeding" hidden=""
562            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
563          <entry name="movementTypeEntry" field="movement.movement_type" hidden=""        <entry name="movementTypeEntry" field="movement.movement_type" hidden=""
564            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
565          <entry name="amountEntry" field="movement.amount" hidden=""        <entry name="amountEntry" field="movement.amount" hidden=""
566            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
567          <entry name="currencyTypeEntry" field="currency_movement.currency_type" hidden=""        <entry name="currencyTypeEntry" field="currency_movement.currency_type" hidden=""
568            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
569      </block>      </block>
570      <block name="movementBlock" datasource="movementDataSource">      <block name="movementBlock" datasource="movementDataSource">
571          <entry name="proceedingEntry" field="movement.proceeding" hidden=""        <entry name="proceedingEntry" field="movement.proceeding" hidden=""
572            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
573          <entry name="movementTypeEntry" field="movement.movement_type" hidden=""        <entry name="movementTypeEntry" field="movement.movement_type" hidden=""
574            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
575          <entry name="amountEntry" field="movement.amount" hidden=""        <entry name="amountEntry" field="movement.amount" hidden=""
576            x="1" y="1" width="12"/>              x="1" y="1" width="12"/>    
577      </block>      </block>
578    </page>    </page>
579  </form>  </form>

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

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