72 |
<cfield name="own_document.own_document_type"/> |
<cfield name="own_document.own_document_type"/> |
73 |
<cconst value="4"/> |
<cconst value="4"/> |
74 |
</eq> |
</eq> |
75 |
|
<!--show credit notes--> |
76 |
|
<eq> |
77 |
|
<cfield name="own_document.own_document_type"/> |
78 |
|
<cconst value="14"/> |
79 |
|
</eq> |
80 |
|
<eq> |
81 |
|
<cfield name="own_document.own_document_type"/> |
82 |
|
<cconst value="15"/> |
83 |
|
</eq> |
84 |
|
<eq> |
85 |
|
<cfield name="own_document.own_document_type"/> |
86 |
|
<cconst value="16"/> |
87 |
|
</eq> |
88 |
|
<!--/show credit notes--> |
89 |
</or> |
</or> |
90 |
</and> |
</and> |
91 |
</condition> |
</condition> |
213 |
line="\n\nListado de IVA Ventas\n\n\n" |
line="\n\nListado de IVA Ventas\n\n\n" |
214 |
table.append(line) |
table.append(line) |
215 |
|
|
216 |
line = "|" + printing.printTitle("Fecha",10) + "|" + printing.printTitle("Factura",18) + "|" |
line = "|" + printing.printTitle("Fecha",10) + "|" + printing.printTitle("Comprobante",21) + "|" |
217 |
line += printing.printTitle("Cliente",30) + "|" + printing.printTitle("C.U.I.T",15) + "|" |
line += printing.printTitle("Cliente",30) + "|" + printing.printTitle("C.U.I.T",15) + "|" |
218 |
line += printing.printTitle("Neto",14) + "|" + printing.printTitle("I.V.A.",12) + "|" |
line += printing.printTitle("Neto",14) + "|" + printing.printTitle("I.V.A.",12) + "|" |
219 |
line += printing.printTitle("Total",14)+"\n" |
line += printing.printTitle("Total",14)+"\n" |
221 |
|
|
222 |
totalNeto = 0 |
totalNeto = 0 |
223 |
totalIVA = 0 |
totalIVA = 0 |
224 |
documentType={'4': 'A', '9':'C', '8':'B'} |
documentType={'4': 'FAC A','9':'FAC C','8':'FAC B','14':'NCR A','16':'NCR C','15':'NCR B'} |
225 |
|
documentSign={'4': '1', '9':'1', '8':'1','14':'-1', '16':'-1', '15':'-1'} |
226 |
condProductInvoice = GConditions.GCondition() |
condProductInvoice = GConditions.GCondition() |
227 |
tmpAnd = GConditions.GCand(condProductInvoice) |
tmpAnd = GConditions.GCand(condProductInvoice) |
228 |
ge = GConditions.GCge(tmpAnd) |
ge = GConditions.GCge(tmpAnd) |
262 |
invoiceTotal = 0 |
invoiceTotal = 0 |
263 |
itemTaxTotal = 0 |
itemTaxTotal = 0 |
264 |
currOwnDoc = productInvoiceResultSet.current.getField("own_document.id") |
currOwnDoc = productInvoiceResultSet.current.getField("own_document.id") |
265 |
|
line = "|" + printing.printField(productInvoiceResultSet.current.getField("own_document.date"),10) |
266 |
line = "|" + printing.printField(productInvoiceResultSet.current.getField("own_document.date"),10) |
line += "|"+ printing.printField(documentType[str(productInvoiceResultSet.current.getField("own_document.own_document_type")).strip()],5)+" " |
267 |
line += "|"+ printing.printField(documentType[str(productInvoiceResultSet.current.getField("own_document.own_document_type")).strip()],1)+"-" |
line += printing.printField(productInvoiceResultSet.current.getField("own_document.number"),15) |
|
line += printing.printField(productInvoiceResultSet.current.getField("own_document.number"),16) |
|
268 |
line += "|"+printing.printField(productInvoiceResultSet.current.getField("_entity_data.name"),30) |
line += "|"+printing.printField(productInvoiceResultSet.current.getField("_entity_data.name"),30) |
269 |
line += "|"+printing.printField(productInvoiceResultSet.current.getField("_entity_uid_data.uid"),15) |
line += "|"+printing.printField(productInvoiceResultSet.current.getField("_entity_uid_data.uid"),15) |
270 |
|
sign= documentSign[str(productInvoiceResultSet.current.getField("own_document.own_document_type"))] |
271 |
while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more: |
while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more: |
272 |
lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty")) |
lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty")) |
273 |
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price")) |
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price")) |
275 |
lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount")) |
lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount")) |
276 |
item = lQty * lUnitPrice - lBonus - lDiscount |
item = lQty * lUnitPrice - lBonus - lDiscount |
277 |
currItem = productInvoiceResultSet.current.getField("own_item.id") |
currItem = productInvoiceResultSet.current.getField("own_item.id") |
278 |
while productInvoiceResultSet.current.getField("own_item.id") == currItem and more: |
while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and productInvoiceResultSet.current.getField("own_item.id") == currItem and more: |
279 |
|
print currOwnDoc,currItem,str(productInvoiceResultSet.current.getField("own_item_tax.id")),"\n" |
280 |
itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount")) |
itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount")) |
281 |
more = productInvoiceResultSet.nextRecord() |
more = productInvoiceResultSet.nextRecord() |
282 |
invoiceTotal += item |
invoiceTotal += item |
285 |
while odt_more: |
while odt_more: |
286 |
invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount")) |
invoiceTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount")) |
287 |
odt_more = odt_rs.nextRecord() |
odt_more = odt_rs.nextRecord() |
288 |
|
#signo del comprobante |
289 |
line += "|" + printing.printField("%0.2f".strip() % hack.a2f(invoiceTotal),14,'r') |
itemTaxTotal = itemTaxTotal * hack.a2f(sign) |
290 |
line += "|" + printing.printField("%0.2f".strip() % hack.a2f(itemTaxTotal),12,'r') |
invoiceTotal = invoiceTotal * hack.a2f(sign) |
291 |
line += "|" + printing.printField("%0.2f".strip() % hack.a2f(itemTaxTotal + invoiceTotal),14,'r') |
line += "|" + printing.printAccount(invoiceTotal,14) |
292 |
|
line += "|" + printing.printAccount(itemTaxTotal,12) |
293 |
|
line += "|" + printing.printAccount(itemTaxTotal,14) |
294 |
totalIVA += itemTaxTotal |
totalIVA += itemTaxTotal |
295 |
totalNeto += invoiceTotal |
totalNeto += invoiceTotal |
296 |
table.append(line) |
table.append(line) |
297 |
|
|
298 |
callTrigger('endWaitingModeTrigger') |
callTrigger('endWaitingModeTrigger') |
299 |
|
|
300 |
line = "\n"+printing.printField("Total",77,'r') + "|" |
line = "\n"+printing.printField("Total",80,'r') + "|" |
301 |
line += printing.printField("%0.2f".strip() % hack.a2f(totalNeto),14,'r') + "|" |
line += printing.printAccount(totalNeto,14) + "|" |
302 |
line += printing.printField("%0.2f".strip() % hack.a2f(totalIVA),12,'r') + "|" |
line += printing.printAccount(totalIVA,12) + "|" |
303 |
line += printing.printField("%0.2f".strip() % hack.a2f(totalIVA + totalNeto),14,'r') |
line += printing.printAccount((totalIVA + totalNeto),14) |
304 |
table.append(line) |
table.append(line) |
305 |
|
|
306 |
printing.previewPrint(table,'xless') |
printing.previewPrint(table,'xless') |
343 |
|
|
344 |
<block datasource="printDataSource" name="printBlock"> |
<block datasource="printDataSource" name="printBlock"> |
345 |
<box height="8" label="Impresion IVA Ventas" name="printBox" width="37" x="1" y="1"> |
<box height="8" label="Impresion IVA Ventas" name="printBox" width="37" x="1" y="1"> |
346 |
<label name="startDateLbl" text="Desde : " x="1" y="1"/> |
<label name="startDateLbl" text="Desde : " x="1" y="1"/> |
347 |
<entry name="startDateEntry" typecast="date" x="9" y="1" width="12"/> |
<entry name="startDateEntry" typecast="date" x="9" y="1" width="12" /> |
348 |
<label name="endDateLbl" text="Hasta : " x="1" y="2"/> |
<label name="endDateLbl" text="Hasta : " x="1" y="2"/> |
349 |
<entry name="endDateEntry" typecast="date" x="9" y="2" |
<entry name="endDateEntry" typecast="date" x="9" y="2" width="12"/> |
|
width="12"/> |
|
350 |
<label text="sucursal :" x="1" y="3"/> |
<label text="sucursal :" x="1" y="3"/> |
351 |
<entry x="9" y="3" name="ownBranchIdSearch" width="25" style="dropdown" |
<entry x="9" y="3" name="ownBranchIdSearch" width="25" style="dropdown" |
352 |
foreign_key="ownBranchSearchDataSource._entity_data._table" |
foreign_key="ownBranchSearchDataSource._entity_data._table" |