/[papo]/papo/forms/dailyCash.neb
ViewVC logotype

Diff of /papo/forms/dailyCash.neb

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

revision 1.2 by mhepp, Thu Aug 28 20:33:18 2003 UTC revision 1.3 by mhepp, Fri Aug 29 15:08:31 2003 UTC
# Line 6  Line 6 
6    </neb:Block>    </neb:Block>
7  <!-- datasources -->  <!-- datasources -->
8   <datasource name="cobrosDataSource" database="papo"   <datasource name="cobrosDataSource" database="papo"
9      table="proceeding,own_document_proceeding as receipt_proceeding,movement,currency_movement,own_document,own_document_proceeding,own_document as receipt"      table="proceeding,movement,currency_movement,own_document_proceeding,own_document,own_document_proceeding as receipt_proceeding,own_document as receipt"
10      order_by="proceeding.id,movement.id">      order_by="proceeding.id,movement.id">
11      <joinconditions>      <joinconditions>
12        <join type="inner">        <join type="left">
13          <join type="inner">          <join type="left">
14            <join type="inner">            <join type="inner">
15              <join type="inner">              <join type="inner">
16                <join type="inner">                <join type="inner">
17                  <join type="left">                  <join type="inner">
18                    <left_table name="proceeding"/>                    <left_table name="proceeding"/>
19                    <right_table name="own_document_proceeding as receipt_proceeding"/>                    <right_table name="movement"/>
20                    <condition>                    <condition>
21                      <eq>                      <eq>
22                        <cfield name="proceeding.id"/>                        <cfield name="proceeding.id"/>
23                        <cfield name="receipt_proceeding.proceeding"/>                        <cfield name="movement.proceeding"/>
24                      </eq>                      </eq>
25                    </condition>                    </condition>
26                  </join>                  </join>
27                  <right_table name="movement"/>                  <right_table name="currency_movement"/>
                 <condition>  
                   <eq>  
                     <cfield name="proceeding.id"/>  
                     <cfield name="movement.proceeding"/>  
                   </eq>  
                 </condition>  
               </join>  
               <right_table name="currency_movement"/>  
28                <condition>                <condition>
29                  <eq>                  <eq>
30                    <cfield name="movement.id"/>                    <cfield name="movement.id"/>
# Line 56  Line 48 
48              </eq>              </eq>
49            </condition>            </condition>
50          </join>          </join>
51              <right_table name="own_document_proceeding as receipt_proceeding"/>
52              <condition>
53                <eq>
54                  <cfield name="proceeding.id"/>
55                  <cfield name="receipt_proceeding.proceeding"/>
56                </eq>
57              </condition>
58            </join>
59          <right_table name="own_document as receipt"/>          <right_table name="own_document as receipt"/>
60          <condition>          <condition>
61            <eq>            <and>
62              <cfield name="receipt.id"/>              <eq>
63              <cfield name="receipt_proceeding.own_document"/>                <cfield name="receipt.id"/>
64            </eq>                <cfield name="receipt_proceeding.own_document"/>
65                </eq>
66                <eq>
67                  <cfield name="receipt.own_document_type"/>
68                  <cconst value="3"/>
69                </eq>
70              </and>
71          </condition>          </condition>
72        </join>        </join>
73      </joinconditions>      </joinconditions>
74      <!--  where conditions -->      <!--  where conditions -->
75      <condition>      <condition>
       <and>  
76          <or>          <or>
77            <!--  show invoices -->            <!--  show invoices -->
78            <eq>            <eq>
# Line 83  Line 88 
88              <cconst value="4"/>              <cconst value="4"/>
89            </eq>            </eq>
90          </or>          </or>
91          <eq>       </condition>
           <cfield name="receipt.own_document_type"/>  
           <cconst value="3"/>  
         </eq>  
       </and>  
     </condition>  
92    </datasource>    </datasource>
93        
94    <!-- triggers-->    <!-- triggers-->
95    <trigger type="NAMED" name="printTrigger">    <trigger type="NAMED" name="printTrigger">
96    import gnue.common.GConditions as GConditions    import gnue.common.GConditions as GConditions
97      import hack
98    
99    #condiciones para labusqueda de fecha    #condiciones para labusqueda de fecha
100        
# Line 108  Line 109 
109    
110    movementResultSet = cobrosDataSource.createResultSet(condMovement)    movementResultSet = cobrosDataSource.createResultSet(condMovement)
111    moreMovement = movementResultSet.firstRecord()    moreMovement = movementResultSet.firstRecord()
112      ctaCte = 0
113      movementAmount = 0
114      pMovement = 0
115      contadoAmount = 0
116      ctaCteCancelledAmount = 0    
117      
118    print "comienzo el recorrido"    print "comienzo el recorrido"
119    while moreMovement:    while moreMovement:
120          print "proceeding:", movementResultSet.current.getField("proceeding.id"),\          print "proceeding:", movementResultSet.current.getField("proceeding.id"),\
121                "movement:",  movementResultSet.current.getField("movement.id"),\                "movement:",  movementResultSet.current.getField("movement.id"),\
122                "doc typ:", movementResultSet.current.getField("own_document.own_document_type"),\                "doc typ:", movementResultSet.current.getField("own_document.own_document_type"),\
123                  "receipt:", movementResultSet.current.getField("receipt.own_document_type"),\
124                "tipo :", movementResultSet.current.getField("currency_movement.currency_type"),\                "tipo :", movementResultSet.current.getField("currency_movement.currency_type"),\
125                "$ :", movementResultSet.current.getField("movement.amount")                              "$ :", movementResultSet.current.getField("movement.amount")              
126          
127    
128            if str(movementResultSet.current.getField("movement.id")) == pMovement:
129                if  movementResultSet.current.getField("receipt.own_document_type") == 3:  
130                    ctaCte = 1    
131            else:
132                 #sumo el anterior
133                 if ctaCte:
134                     ctaCteCancelledAmount += movementAmount
135                 else:
136                     contadoAmount += movementAmount
137                 #cargo el nuevo
138                 ctaCte = 0
139                 movementAmount = hack.a2f(movementResultSet.current.getField("movement.amount"))
140                
141    
142                
143            pMovement = str(movementResultSet.current.getField("movement.id"))
144          moreMovement = movementResultSet.nextRecord()          moreMovement = movementResultSet.nextRecord()
145                    print "total efectivo",contadoAmount,"total pagos ctacte",ctaCteCancelledAmount
146      #al salir sumo el último
147      if ctaCte:
148          ctaCteCancelledAmount += movementAmount
149      else:
150          contadoAmount += movementAmount      
151      #muestro el total    
152      print "total efectivo",contadoAmount,"total pagos ctacte",ctaCteCancelledAmount
153    
154    #"$    :", movementResultSet.current.getField("movement.amount"),\    #"$    :", movementResultSet.current.getField("movement.amount"),\
155    #             "tipo :", movementResultSet.current.getField("currency_movement.currency_type"),\    #             "tipo :", movementResultSet.current.getField("currency_movement.currency_type"),\

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

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