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

Diff of /papo/forms/receipt.neb

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

revision 1.5 by charlie, Thu May 15 20:31:35 2003 UTC revision 1.6 by charlie, Fri May 16 18:51:11 2003 UTC
# Line 179  Line 179 
179        <and>        <and>
180          <eq>          <eq>
181            <!-- Aqui se refiere al cliente  -->            <!-- Aqui se refiere al cliente  -->
182            <cfield name="_entity_data._table"/>            <cfield name="_entity_data.id"/>
183            <cfield name="own_document.recipient"/>            <cfield name="own_document.recipient"/>
184          </eq>          </eq>
185          <eq>          <eq>
186            <cfield name="own_document.id"/>            <cfield name="own_document.id"/>
187            <cfield name="own_document_proceeding.own_document"/>            <cfield name="own_document_proceeding.own_document"/>
188          </eq>          </eq>
189          <and>          <and>
190            <or>            <or>
191              <eq>              <eq>
192                <cfield name="own_document.own_document_type"/>                <cfield name="own_document.own_document_type"/>
193                <cconst value="1"/>                <cconst value="4"/>
194              </eq>              </eq>
195              <eq>              <eq>
196                <cfield name="own_document.own_document_type"/>                <cfield name="own_document.own_document_type"/>
197                <cconst value="4"/>                <cconst value="8"/>
198                </eq>
199                <eq>
200                  <cfield name="own_document.own_document_type"/>
201                  <cconst value="9"/>
202              </eq>              </eq>
203            </or>            </or>
204          </and>          </and>
# Line 265  rs = miClientDataSource.createResultSet( Line 269  rs = miClientDataSource.createResultSet(
269  client = 0  client = 0
270  if rs.firstRecord():  if rs.firstRecord():
271      client = rs.current.getField('_table')      client = rs.current.getField('_table')
     # print rs.current.getFields()  
272            
273  if client:  if client:
274      import gnue.common.GConditions as GConditions      import gnue.common.GConditions as GConditions
# Line 279  if client: Line 282  if client:
282      GConditions.GCField(eq,"_entity_data._table")      GConditions.GCField(eq,"_entity_data._table")
283      GConditions.GCConst(eq,str(client))      GConditions.GCConst(eq,str(client))
284    
     eq = GConditions.GCeq(condServiceInvoice)  
     GConditions.GCField(eq,"_entity_data._table")  
     GConditions.GCConst(eq,str(client))  
   
285      eq = GConditions.GCeq(condPay)      eq = GConditions.GCeq(condPay)
286      GConditions.GCField(eq,"_entity_data._table")      GConditions.GCField(eq,"_entity_data._table")
287      GConditions.GCConst(eq,str(client))      GConditions.GCConst(eq,str(client))
# Line 291  if client: Line 290  if client:
290      more = productInvoiceResultSet.firstRecord()      more = productInvoiceResultSet.firstRecord()
291    
292      while more:      while more:
         print productInvoiceResultSet.current.getField("own_document.id")  
293          invoiceTotal = 0          invoiceTotal = 0
294          currOwnDoc = productInvoiceResultSet.current.getField("own_document.id")          currOwnDoc = productInvoiceResultSet.current.getField("own_document.id")
295          tmpInvToPayedBlock.idEntry = str(productInvoiceResultSet.current.getField("own_document.id"))          tmpInvToPayedBlock.idEntry = str(productInvoiceResultSet.current.getField("own_document.id"))
# Line 321  if client: Line 319  if client:
319          tmpInvToPayedBlock.payedEntry = "0.0"          tmpInvToPayedBlock.payedEntry = "0.0"
320          tmpInvToPayedBlock.newRecord()          tmpInvToPayedBlock.newRecord()
321    
     # Calculo del total facturado  
     ## Factura de servicios  
     serviceInvoiceResultSet= serviceInvoiceDataSource.createResultSet (condServiceInvoice)  
     more= serviceInvoiceResultSet.firstRecord ()  
   
     while more:  
         invoiceTotal = 0  
         currentOwnDocument = serviceInvoiceResultSet.current.getField ("own_document.id")  
   
         tmpInvToPayedBlock.idEntry = str(serviceInvoiceResultSet.current.getField("own_document.id"))  
         tmpInvToPayedBlock.numberEntry = str(serviceInvoiceResultSet.current.getField("own_document.number"))  
         tmpInvToPayedBlock.dateEntry = str(serviceInvoiceResultSet.current.getField("own_document.date"))  
   
         while serviceInvoiceResultSet.current.getField ("own_document.id") == currentOwnDocument and more:  
             item = hack.a2f(serviceInvoiceResultSet.current.getField ("own_service_item.amount"))  
             currentItem= serviceInvoiceResultSet.current.getField ("own_item.id")  
             itemTaxTotal = 0  
             while serviceInvoiceResultSet.current.getField ("own_item.id") == currentItem and more:  
                 itemTaxTotal += hack.a2f(serviceInvoiceResultSet.current.getField ("own_item_tax.amount"))  
                 more = serviceInvoiceResultSet.nextRecord ()  
             invoiceTotal += item + itemTaxTotal  
   
         tmpInvToPayedBlock.amountEntry = str(invoiceTotal)  
         tmpInvToPayedBlock.payedEntry = "0.0"  
         tmpInvToPayedBlock.newRecord()  
   
     # Busco las que ya han sido pagadas  
322      rs = payTotDataSource.createResultSet(condPay)      rs = payTotDataSource.createResultSet(condPay)
323      more = rs.firstRecord()      more = rs.firstRecord()
324      while more:      while more:

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

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