188 |
</or> |
</or> |
189 |
</condition> |
</condition> |
190 |
</datasource> |
</datasource> |
191 |
|
|
192 |
|
|
193 |
<!-- currency name --> |
<!-- currency name --> |
194 |
<datasource name="currencyNameDataSource" database="papo" table="_currency_type_data"/> |
<datasource name="currencyNameDataSource" database="papo" table="_currency_type_data"/> |
195 |
|
|
197 |
<trigger type="NAMED" name="printTrigger"> |
<trigger type="NAMED" name="printTrigger"> |
198 |
import gnue.common.GConditions as GConditions |
import gnue.common.GConditions as GConditions |
199 |
import hack |
import hack |
200 |
from mx.DateTime import strptime |
import mx.DateTime |
201 |
|
|
202 |
#pongo las fechas |
#pongo las fechas |
203 |
startTime = str(printBlock.printBox.startDateEntry) |
startTime = str(printBlock.printBox.startDateEntry) |
204 |
endTime = str(strptime(startTime[:-3], "%Y-%m-%d %T") + 1) |
try: |
205 |
print endTime |
endTime = str(mx.DateTime.strptime(startTime[:-3], "%Y-%m-%d %T") + 1) |
206 |
|
except mx.DateTime.Error: |
207 |
|
startTime = str(mx.DateTime.now().strftime("%Y-%m-%d")) |
208 |
|
printBlock.printBox.startDateEntry = startTime |
209 |
|
endTime = str((mx.DateTime.now() + 1).strftime("%Y-%m-%d")) |
210 |
|
|
211 |
|
|
212 |
#busco currency Name |
#busco currency Name |
213 |
currencyName = {} |
currencyName = {} |
214 |
currencyResultSet = currencyNameDataSource.createResultSet() |
currencyResultSet = currencyNameDataSource.createResultSet() |
294 |
"tipo :", movementResultSet.current.getField("currency_movement.currency_type"),\ |
"tipo :", movementResultSet.current.getField("currency_movement.currency_type"),\ |
295 |
"$ :", movementResultSet.current.getField("movement.amount") |
"$ :", movementResultSet.current.getField("movement.amount") |
296 |
docType = movementResultSet.current.getField("alien_document.alien_document_type") |
docType = movementResultSet.current.getField("alien_document.alien_document_type") |
297 |
currency = str(movementResultSet.current.getField("currency_movement.currency_type")) |
currency = movementResultSet.current.getField("currency_movement.currency_type") |
298 |
if movementResultSet.current.getField("movement.id") != prevMovement : |
if movementResultSet.current.getField("movement.id") != prevMovement : |
299 |
if movementResultSet.current.getField("pay_order.own_document_type") == 6: |
if movementResultSet.current.getField("pay_order.own_document_type") == 6: |
300 |
if ctaCtePayedAmount.has_key(currency): |
if ctaCtePayedAmount.has_key(currency): |
322 |
print "total cobros efectivo",contadoAmount,"total cobros ctacte",ctaCteCancelledAmount,"notas de credito cobradas", creditNoteContadoCobradasAmount |
print "total cobros efectivo",contadoAmount,"total cobros ctacte",ctaCteCancelledAmount,"notas de credito cobradas", creditNoteContadoCobradasAmount |
323 |
print "total de movimientos de pago" |
print "total de movimientos de pago" |
324 |
print "total pagos efectivo",contadoPayedAmount,"total pagos ctacte",ctaCtePayedAmount |
print "total pagos efectivo",contadoPayedAmount,"total pagos ctacte",ctaCtePayedAmount |
325 |
|
|
326 |
|
|
327 |
|
import time, sys |
328 |
|
sys.path.append("../ruff") |
329 |
|
import informe |
330 |
|
import printing |
331 |
|
|
332 |
|
x = informe.new("dailyCash.xml") |
333 |
|
x.page_header(fecha=startTime[:11]) |
334 |
|
|
335 |
|
for currency in currencyName.keys() : |
336 |
|
ingresos = { "contado": contadoAmount.get(currency,0.00), |
337 |
|
"ctacte": ctaCteCancelledAmount.get(currency,0.00), |
338 |
|
"otros": creditNoteContadoCobradasAmount.get(currency,0.00), |
339 |
|
} |
340 |
|
egresos = { "contado": contadoPayedAmount.get(currency,0.00), |
341 |
|
"ctacte": ctaCtePayedAmount.get(currency,0.00), |
342 |
|
"otros": 0.00, |
343 |
|
} |
344 |
|
|
345 |
|
x.ingresos.item.add_row(moneda=str(currencyName[currency]), |
346 |
|
contado= printing.printAccount(ingresos['contado'],11), |
347 |
|
ctacte= printing.printAccount(ingresos['ctacte'],11), |
348 |
|
otros= printing.printAccount(ingresos['otros'],11), |
349 |
|
total= printing.printAccount(ingresos['contado']+ingresos['ctacte']+ingresos['otros'],11), |
350 |
|
) |
351 |
|
x.egresos.item.add_row(moneda=str(currencyName[currency]), |
352 |
|
contado= printing.printAccount(egresos['contado'],11), |
353 |
|
ctacte= printing.printAccount(egresos['ctacte'],11), |
354 |
|
otros= printing.printAccount(egresos['otros'],11), |
355 |
|
total= printing.printAccount(egresos['contado']+egresos['ctacte']+egresos['otros'],11), |
356 |
|
) |
357 |
|
x.diferencia.item.add_row(moneda=str(currencyName[currency]), |
358 |
|
contado= printing.printAccount(ingresos['contado']-egresos['contado'],11), |
359 |
|
ctacte= printing.printAccount(ingresos['ctacte']-egresos['ctacte'],11), |
360 |
|
otros= printing.printAccount(ingresos['otros']-egresos['otros'],11), |
361 |
|
total= printing.printAccount(ingresos['contado']+ingresos['ctacte']+ingresos['otros']-egresos['contado']-egresos['ctacte']-egresos['otros'],11), |
362 |
|
) |
363 |
|
printing.previewPrint([x.render()],'xless -fn vga') |
364 |
|
|
365 |
|
|
366 |
|
|
367 |
|
|
368 |
|
|
369 |
|
|
370 |
|
|
371 |
|
|
372 |
|
|
373 |
|
|
374 |
|
|
375 |
|
|
376 |
|
|
377 |
|
|
378 |
</trigger> |
</trigger> |
379 |
|
|