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

Diff of /papo/forms/ctaCteClient.gfd

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

revision 1.3 by charlie, Mon Mar 10 15:05:09 2003 UTC revision 1.4 by charlie, Wed Mar 26 23:04:50 2003 UTC
# Line 271  callTrigger('endWaitingModeTrigger') Line 271  callTrigger('endWaitingModeTrigger')
271    
272      ]]></trigger>      ]]></trigger>
273    
274      <trigger type="NAMED" name="printTrigger"><![CDATA[
275    
276    tmpInvToPayedBlock.processRollback()
277    invoiceToPayedBlock.processRollback()
278    
279    total = 0.0
280    
281    if str(ownDocumentBlock.clientRecipientBox.clientEntry):
282        callTrigger('startWaitingModeTrigger')
283        import gnue.common.GConditions as GConditions
284        import hack
285        import string
286      
287        def printField (field,size):
288            if str(field).strip() == "None":
289                field = ""
290            return str(field).ljust(size)
291    
292        def printTitle (field,size):
293            return str(field).center(size)
294    
295      
296        table = []
297        line = "\n\nListado de Cuenta Corrientes de Clientes\n\n\n"
298        table.append(line)
299        
300        line = printTitle("Documento",12)
301        line += printTitle("Numero",15)
302        line += printTitle("Fecha",15)
303        line += printTitle("Importe",15)
304        table.append(line)
305    
306        condProductInvoice = GConditions.GCondition()
307        condRecipientInvoice = GConditions.GCondition()
308    
309        eq = GConditions.GCeq(condProductInvoice)
310        GConditions.GCField(eq,"_entity_data._table")
311        GConditions.GCConst(eq,str(ownDocumentBlock.clientRecipientBox.clientEntry))
312    
313        eq = GConditions.GCeq(condRecipientInvoice)
314        GConditions.GCField(eq,"_entity_data._table")
315        GConditions.GCConst(eq,str(ownDocumentBlock.clientRecipientBox.clientEntry))
316    
317        # Calculo del total facturado por Productos
318        productInvoiceResultSet = productInvoiceDataSource.createResultSet(condProductInvoice)
319        more = productInvoiceResultSet.firstRecord()
320        while more:
321            invoiceTotal = 0
322            currOwnDoc = productInvoiceResultSet.current.getField("own_document.id")
323    
324            line = printField(productInvoiceResultSet.current.getField("own_document.id"),12)
325            line += printField(productInvoiceResultSet.current.getField("own_document.number"),15)
326            line += printField(productInvoiceResultSet.current.getField("own_document.date"),15)
327    
328            while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more:
329                lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty"))
330                lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price"))
331                lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus"))
332                lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount"))
333                item = lQty * lUnitPrice - lBonus - lDiscount
334                itemTaxTotal = 0        
335                currItem = productInvoiceResultSet.current.getField("own_item.id")
336                while productInvoiceResultSet.current.getField("own_item.id") == currItem and more:
337                    itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))
338                    more = productInvoiceResultSet.nextRecord()
339                invoiceTotal += item + itemTaxTotal
340            odt_rs = invTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc})
341            odt_more = odt_rs.firstRecord()
342            while odt_more:
343                invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount"))
344                odt_more = odt_rs.nextRecord()
345    
346            line += printField(string.rjust("%0.2f".strip() % hack.a2f(invoiceTotal),14),14)
347            table.append(line)
348        callTrigger('endWaitingModeTrigger')
349        hack.previewPrint(table)
350    
351        ]]></trigger>
352    
353    <trigger type="NAMED" name="cancelTrigger"><![CDATA[    <trigger type="NAMED" name="cancelTrigger"><![CDATA[
354  import hack  import hack
355    
# Line 363  invoiceToPayedBlock.processRollback() Line 442  invoiceToPayedBlock.processRollback()
442          <entry field="date" name="dateEntry" style="label" readonly="" typecast="date"          <entry field="date" name="dateEntry" style="label" readonly="" typecast="date"
443            rows="1" width="24" x="7" y="7"/>            rows="1" width="24" x="7" y="7"/>
444          <button name="showInvoicesButton" trigger="showInvoiceToPayTrigger"          <button name="showInvoicesButton" trigger="showInvoiceToPayTrigger"
445            label="Cuenta Corriente" width="20" height="1" x="18" y="4"/>            label="Cuenta Corriente" width="20" height="1" x="1" y="4"/>
446          <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"          <button name="cancelButton" trigger="cancelTrigger" label="Cancelar"
447            width="20" height="1" x="40" y="4"/>            width="20" height="1" x="43" y="4"/>
448            <button name="printButton" trigger="printTrigger" label="Imprimir"
449              width="20" height="1" x="22" y="4"/>
450        </box>        </box>
451      </block>      </block>
452    

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