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> |
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 |
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)) |
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")) |
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: |