/[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.9 by mhepp, Tue Nov 11 20:52:59 2003 UTC revision 1.10 by mhepp, Mon Nov 17 20:34:46 2003 UTC
# Line 84  Line 84 
84      </joinconditions>      </joinconditions>
85      <!--  where conditions -->      <!--  where conditions -->
86      <condition>      <condition>
87          <or>        <or>
88          <!-- OWN DOCUMENTS -->          <!-- OWN DOCUMENTS -->
89            <!--  show invoices -->          <!--  show invoices -->
90            <eq>          <eq>
91              <cfield name="own_document.own_document_type"/>            <cfield name="own_document.own_document_type"/>
92              <cconst value="8"/>            <cconst value="8"/>
93            </eq>          </eq>
94            <eq>          <eq>
95              <cfield name="own_document.own_document_type"/>            <cfield name="own_document.own_document_type"/>
96              <cconst value="9"/>            <cconst value="9"/>
97            </eq>          </eq>
98            <eq>          <eq>
99              <cfield name="own_document.own_document_type"/>            <cfield name="own_document.own_document_type"/>
100              <cconst value="4"/>            <cconst value="4"/>
101            </eq>          </eq>
102          <!--  show debit Notes -->          <!--  show debit Notes -->
103          <eq>          <eq>
104            <cfield name="own_document.own_document_type"/>            <cfield name="own_document.own_document_type"/>
105            <cconst value="30"/>            <cconst value="30"/>
106          </eq>          </eq>
107            <eq>          <eq>
108              <cfield name="own_document.own_document_type"/>            <cfield name="own_document.own_document_type"/>
109              <cconst value="31"/>            <cconst value="31"/>
110            </eq>          </eq>
111            <eq>          <eq>
112              <cfield name="own_document.own_document_type"/>            <cfield name="own_document.own_document_type"/>
113              <cconst value="32"/>            <cconst value="32"/>
114            </eq>          </eq>
115          </or>          <!-- show own credit notes  -->
116       </condition>          <eq>
117              <cfield name="own_document.own_document_type"/>
118              <cconst value="14"/>
119            </eq>
120            <eq>
121              <cfield name="own_document.own_document_type"/>
122              <cconst value="15"/>
123            </eq>
124            <eq>
125              <cfield name="own_document.own_document_type"/>
126              <cconst value="16"/>
127            </eq>
128          </or>
129        </condition>
130    </datasource>    </datasource>
131  <!-- egresos -->  <!-- egresos -->
132     <datasource name="pagosDataSource" database="papo"     <datasource name="pagosDataSource" database="papo"
# Line 224  Line 237 
237            <cfield name="alien_document.alien_document_type"/>            <cfield name="alien_document.alien_document_type"/>
238            <cconst value="36"/>            <cconst value="36"/>
239          </eq>          </eq>
240          <!-- show credit notes-->          <!-- show alien credit notes-->
241          <eq>          <eq>
242            <cfield name="alien_document.alien_document_type"/>            <cfield name="alien_document.alien_document_type"/>
243            <cconst value="18"/>            <cconst value="18"/>
# Line 289  Line 302 
302    contadoAmount = {}    contadoAmount = {}
303    ctaCteCancelledAmount = {}        ctaCteCancelledAmount = {}    
304    prevMovement = 0    prevMovement = 0
305      creditNoteContadoPagadasAmount = {}
306        
307    #print "comienzo el recorrido"    #print "comienzo el recorrido"
308    while moreMovement:    while moreMovement:
# Line 299  Line 313 
313          #      "tipo :", movementResultSet.current.getField("_currency_type_data._table"),\          #      "tipo :", movementResultSet.current.getField("_currency_type_data._table"),\
314          #      "$ :", movementResultSet.current.getField("movement.amount")          #      "$ :", movementResultSet.current.getField("movement.amount")
315          currency = movementResultSet.current.getField("_currency_type_data._table")          currency = movementResultSet.current.getField("_currency_type_data._table")
316            docType = movementResultSet.current.getField("own_document.own_document_type")
317          if movementResultSet.current.getField("movement.id") != prevMovement :          if movementResultSet.current.getField("movement.id") != prevMovement :
318                #si son recibos
319              if  movementResultSet.current.getField("receipt.own_document_type") == 3:                if  movementResultSet.current.getField("receipt.own_document_type") == 3:  
320                  if ctaCteCancelledAmount.has_key(currency):                  if ctaCteCancelledAmount.has_key(currency):
321                      ctaCteCancelledAmount[currency] += hack.a2f(movementResultSet.current.getField("movement.amount"))                      ctaCteCancelledAmount[currency] += hack.a2f(movementResultSet.current.getField("movement.amount"))
322                  else:                  else:
323                      ctaCteCancelledAmount[currency] = hack.a2f(movementResultSet.current.getField("movement.amount"))                      ctaCteCancelledAmount[currency] = hack.a2f(movementResultSet.current.getField("movement.amount"))
324              else:              #si son facturas o notas de debito cobradas de contado        
325                elif (docType == 8)or(docType == 9 )or(docType == 4)or(docType == 30 )or(docType == 31 )or(docType == 32):
326                  if contadoAmount.has_key(currency):                  if contadoAmount.has_key(currency):
327                      contadoAmount[currency] += hack.a2f(movementResultSet.current.getField("movement.amount"))                      contadoAmount[currency] += hack.a2f(movementResultSet.current.getField("movement.amount"))
328                  else:                  else:
329                      contadoAmount[currency] = hack.a2f(movementResultSet.current.getField("movement.amount"))                      contadoAmount[currency] = hack.a2f(movementResultSet.current.getField("movement.amount"))
330                # si son notas de credito pagadas de contado        
331                elif (docType == 14 )or(docType == 15 )or(docType == 16) :
332                    print "nota de credito a cliente"
333                    if creditNoteContadoPagadasAmount.has_key(currency):
334                        creditNoteContadoPagadasAmount[currency] += hack.a2f(movementResultSet.current.getField("movement.amount"))
335                    else:
336                        creditNoteContadoPagadasAmount[currency] = hack.a2f(movementResultSet.current.getField("movement.amount"))
337              #print "total cobros efectivo",contadoAmount,"total cobros ctacte",ctaCteCancelledAmount              #print "total cobros efectivo",contadoAmount,"total cobros ctacte",ctaCteCancelledAmount
338          #else :          #else :
339              #print "repetido:",prevMovement                  #print "repetido:",prevMovement    
# Line 337  Line 361 
361    ctaCtePayedAmount = {}        ctaCtePayedAmount = {}    
362    prevMovement = 0    prevMovement = 0
363    creditNoteContadoCobradasAmount = {}    creditNoteContadoCobradasAmount = {}
364    
365        
366    while moreMovement:    while moreMovement:
367          #print "proceeding:", movementResultSet.current.getField("proceeding.id"),\          #print "proceeding:", movementResultSet.current.getField("proceeding.id"),\
# Line 391  Line 416 
416                   }                   }
417      egresos = { "contado": contadoPayedAmount.get(currency,0.00),      egresos = { "contado": contadoPayedAmount.get(currency,0.00),
418                   "ctacte": ctaCtePayedAmount.get(currency,0.00),                   "ctacte": ctaCtePayedAmount.get(currency,0.00),
419                   "otros":  0.00,                   "otros":  creditNoteContadoPagadasAmount.get(currency,0.00),
420                 }                             }            
421    
422      x.ingresos.item.add_row(moneda=str(currencyName[currency]),      x.ingresos.item.add_row(moneda=str(currencyName[currency]),

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

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