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

Diff of /papo/forms/despatchNote.neb

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

revision 1.22 by fheinz, Sat Nov 22 00:11:54 2003 UTC revision 1.23 by apronotti, Tue Dec 2 20:16:26 2003 UTC
# Line 242  Foundation, Inc., 59 Temple Place, Suite Line 242  Foundation, Inc., 59 Temple Place, Suite
242    import printing    import printing
243    import sys    import sys
244    if "../ruff" not in sys.path:    if "../ruff" not in sys.path:
245      sys.path.append("../ruff")        sys.path.append("../ruff")
246    import informe    from ruff import Report
247    despatch_note = informe.new("ruff/own_document.xml")    from errors import *
248      x = Report("ruff/own_document.xml")
249    #encabezado    #encabezado
250    despatch_note.header(fecha=printing.printField(tmpBlock.tmpDateEntry,10))    #print "encabezado"
251    despatch_note.header(entity_code=str(ownDocumentBlock.clientRecipientBox.clientCodeEntry))    x.header(fecha=printing.printField(tmpBlock.tmpDateEntry,10))
252    despatch_note.header(entity_name=str(ownDocumentBlock.clientRecipientBox.clientNameEntry))    x.header(entity_name=str(ownDocumentBlock.clientRecipientBox.clientNameEntry))
   #x.page_header(entity_category=str(.))  
253    
254      #seleccion del tipo de comprobante (A,B,C o proximamente M)
255      x.add_detail('c_document_items')
256      
257    #carga de items    #carga de items
258    
259    ownItemBlock.firstRecord()    ownItemBlock.firstRecord()
   iva_amount= 0.00  
   iva_rni_amount= 0.00  
260    for index in range(ownItemBlock.getRecordCount()):      for index in range(ownItemBlock.getRecordCount()):  
261        if (index > 0) and ( not ownItemBlock.isEmpty()):        if (index > 0) and ( not ownItemBlock.isEmpty()):
262            ownItemBlock.nextRecord()            ownItemBlock.nextRecord()
263        document_item = { "descriptive": str(ownItemBlock.prodNameSEntry),        document_item = {}
264                          "qtty": str(ownItemBlock.qtyEntry),          
265                        }        document_item['descriptive'] = str(ownItemBlock.prodNameSEntry)
266          document_item['qtty'] = str(ownItemBlock.qtyEntry)
267        print document_item  
268        despatch_note.despatch_note.item.add_row(**document_item)        try:
269    tmpDespatchNoteDataSource.printing_despatch_note = despatch_note                x.add_dentry('item', **document_item)
270          except UnknownFieldError :
271            pass
272          except ReportOverflowError :
273            genericBox("ha excedido el numero de renglones disponibles para la impresión del comprobante" +str(msg),['Aceptar'])
274    
275      tmpValuesDataSource.printing_document=x
276   </trigger>   </trigger>
277    
278    <trigger name="printTrigger" type="NAMED"><![CDATA[    <trigger name="printTrigger" type="NAMED"><![CDATA[
279        import hack   callTrigger ('commitTrigger')
280        from gnue.common.GDataObjects import ConnectionError as DBError   import hack
281        import printing   import printing
282        import sys   import sys
283        if "../ruff" not in sys.path:   if "../ruff" not in sys.path:
284            sys.path.append("../ruff")       sys.path.append("../ruff")
285        import informe   #import informe
286        #if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.prodNameSEntry) > 0:   from ruff import Report
287        if ownItemBlock.getRecordCount() > 0 :   x = tmpValuesDataSource.printing_document
288          callTrigger('startWaitingModeTrigger')   #printing.previewPrint(reduce(lambda a, b: a+b, [i.render() for i in x.pages]),'xless -fn vga')
289          try:   #printing.previewPrint([str(x)],gConfig('printcommand'))
290            callTrigger ('commitTrigger')   #hack.pleasePrint (self, reportNo, report, [ 'id='+str(ownDocumentBlock.idEntry) ],str(ownPosDocumentBlock.documentPrintCommand))
291            despatch_note = tmpDespatchNoteDataSource.printing_despatch_note  
292            from gnue.common.GParser import GContent  
293            printing.previewPrint([despatch_note.render()],gConfig('printcommand'))   while 1:
294            callTrigger('endWaitingModeTrigger')     printing.previewPrint([str(x)],str(ownPosDocumentBlock.documentPrintCommand)+' -fn vga')
295            if getParameter ('invoiceid') :     if form.genericBox ('Verifique que se haya impreso bien', ['Listo', 'Reintentar'])==1:
296               exit()            break      
297            else:       callTrigger ('rollbackTrigger')
              callTrigger('rollbackTrigger')  
         except DBError, err:  
           pass  
298        ]]></trigger>        ]]></trigger>
299    
300    <trigger name="commitTrigger" type="NAMED">    <trigger name="commitTrigger" type="NAMED">

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

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