248 |
|
|
249 |
]]></trigger> |
]]></trigger> |
250 |
|
|
251 |
|
<trigger name="printTrigger" type="NAMED"><![CDATA[ |
252 |
|
|
253 |
|
tmpInvToPayedBlock.processRollback() |
254 |
|
invoiceToPayBlock.processRollback() |
255 |
|
|
256 |
|
total = 0.0 |
257 |
|
if str(alienDocumentSearchBlock.providerSearchBox.providerEntry): |
258 |
|
callTrigger('startWaitingModeTrigger') |
259 |
|
import gnue.common.GConditions as GConditions |
260 |
|
import hack |
261 |
|
import string |
262 |
|
|
263 |
|
def printField (field,size): |
264 |
|
if str(field).strip() == "None": |
265 |
|
field = "" |
266 |
|
return str(field).ljust(size) |
267 |
|
|
268 |
|
def printTitle (field,size): |
269 |
|
return str(field).center(size) |
270 |
|
|
271 |
|
condProductInvoice = GConditions.GCondition() |
272 |
|
condServiceInvoice = GConditions.GCondition() |
273 |
|
condPay = GConditions.GCondition() |
274 |
|
|
275 |
|
eq = GConditions.GCeq(condProductInvoice) |
276 |
|
GConditions.GCField(eq,"_entity_data._table") |
277 |
|
GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry)) |
278 |
|
|
279 |
|
eq = GConditions.GCeq(condPay) |
280 |
|
GConditions.GCField(eq,"_entity_data._table") |
281 |
|
GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry)) |
282 |
|
|
283 |
|
# Calculo del total facturado por Productos |
284 |
|
productInvoiceResultSet = productInvoiceDataSource.createResultSet(condProductInvoice) |
285 |
|
more = productInvoiceResultSet.firstRecord() |
286 |
|
|
287 |
|
table = [] |
288 |
|
line = "\n\nListado de Cuenta Corrientes de Proveedores\n\n\n" |
289 |
|
table.append(line) |
290 |
|
|
291 |
|
line = printTitle("Documento",12) |
292 |
|
line += printTitle("Numero",15) |
293 |
|
line += printTitle("Fecha",15) |
294 |
|
line += printTitle("Importe",15) |
295 |
|
table.append(line) |
296 |
|
|
297 |
|
|
298 |
|
while more: |
299 |
|
invoiceTotal = 0 |
300 |
|
currAlienDoc = productInvoiceResultSet.current.getField("alien_document.id") |
301 |
|
line = printField(productInvoiceResultSet.current.getField("alien_document.id"),12) |
302 |
|
while productInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more: |
303 |
|
lQty = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.qty")) |
304 |
|
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.unit_price")) |
305 |
|
lBonus = hack.a2f(productInvoiceResultSet.current.getField("alien_item.bonus")) |
306 |
|
lDiscount = hack.a2f(productInvoiceResultSet.current.getField("alien_item.discount")) |
307 |
|
item = lQty * lUnitPrice - lBonus - lDiscount |
308 |
|
itemTaxTotal = 0 |
309 |
|
currItem = productInvoiceResultSet.current.getField("alien_item.id") |
310 |
|
while productInvoiceResultSet.current.getField("alien_item.id") == currItem and more: |
311 |
|
itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("alien_item_tax.amount")) |
312 |
|
more = productInvoiceResultSet.nextRecord() |
313 |
|
invoiceTotal += item + itemTaxTotal |
314 |
|
odt_rs = invTaxTotDataSource.createResultSet({"alien_document.id":currAlienDoc}) |
315 |
|
odt_more = odt_rs.firstRecord() |
316 |
|
while odt_more: |
317 |
|
invoiceTotal += hack.a2f(odt_rs.current.getField("alien_document_tax.amount")) |
318 |
|
odt_more = odt_rs.nextRecord() |
319 |
|
|
320 |
|
line += printField(productInvoiceResultSet.current.getField("alien_document.number"),15) |
321 |
|
line += printField(productInvoiceResultSet.current.getField("alien_document.date"),15) |
322 |
|
|
323 |
|
total = total + invoiceTotal |
324 |
|
|
325 |
|
line += printField(string.rjust("%0.2f".strip() % hack.a2f(invoiceTotal),14),14) |
326 |
|
table.append(line) |
327 |
|
|
328 |
|
callTrigger('endWaitingModeTrigger') |
329 |
|
hack.previewPrint(table) |
330 |
|
|
331 |
|
]]></trigger> |
332 |
|
|
333 |
<trigger type="NAMED" name="totalTrigger"><![CDATA[ |
<trigger type="NAMED" name="totalTrigger"><![CDATA[ |
334 |
|
|
335 |
import hack |
import hack |
446 |
|
|
447 |
<block datasource="alienDocumentDataSource" name="alienDocumentSearchBlock" restrictInsert=""> |
<block datasource="alienDocumentDataSource" name="alienDocumentSearchBlock" restrictInsert=""> |
448 |
|
|
449 |
<box height="5" label="Proveedores" |
<box label="Proveedores" name="providerSearchBox" width="85" height="6" x="1" y="0"> |
|
name="providerSearchBox" width="85" x="1" y="0"> |
|
450 |
|
|
451 |
<entry field="id" hidden="" name="idEntry" x="1" y="1"/> |
<entry field="id" hidden="" name="idEntry" x="1" y="1"/> |
452 |
<entry field="alien_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
<entry field="alien_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
463 |
<button name="cancelButton" trigger="cancelTrigger" label="Cancelar" |
<button name="cancelButton" trigger="cancelTrigger" label="Cancelar" |
464 |
width="10" height="1" x="71" y="1"/> |
width="10" height="1" x="71" y="1"/> |
465 |
|
|
466 |
<button x="60" y="2" trigger="searchTrigger" width="21" label="Cuenta Corriente" |
<button x="20" y="3" trigger="searchTrigger" width="20" label="Cuenta Corriente" |
467 |
|
name="searchBtn" height="1"/> |
468 |
|
|
469 |
|
<button x="41" y="3" trigger="printTrigger" width="20" label="Imprimir" |
470 |
name="searchBtn" height="1"/> |
name="searchBtn" height="1"/> |
471 |
|
|
472 |
</box> |
</box> |