8 |
<!-- Origen de datos que srive para calcular el total facturado --> |
<!-- Origen de datos que srive para calcular el total facturado --> |
9 |
|
|
10 |
<datasource name="productInvoiceDataSource" database="papo" |
<datasource name="productInvoiceDataSource" database="papo" |
11 |
table="_entity_data, own_document, own_item, own_product_invoice_item, _price_data, own_item_tax, _entity_uid_data" |
table="_entity_data, own_document, own_item, own_product_item, _price_data, own_item_tax, _entity_uid_data" |
12 |
order_by="own_document.date"> |
order_by="own_document.date"> |
13 |
<condition> |
<condition> |
14 |
<and> |
<and> |
23 |
</eq> |
</eq> |
24 |
<eq> |
<eq> |
25 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
26 |
<cfield name="own_product_invoice_item.own_item"/> |
<cfield name="own_product_item.own_item"/> |
27 |
</eq> |
</eq> |
28 |
<eq> |
<eq> |
29 |
<cfield name="own_product_invoice_item.price"/> |
<cfield name="own_product_item.price"/> |
30 |
<cfield name="_price_data.id"/> |
<cfield name="_price_data.id"/> |
31 |
</eq> |
</eq> |
32 |
<eq> |
<eq> |
39 |
</eq> |
</eq> |
40 |
<eq> |
<eq> |
41 |
<cfield name="_entity_uid_data.entity_uid_type"/> |
<cfield name="_entity_uid_data.entity_uid_type"/> |
42 |
<cconst value="1"/> |
<cconst value="1"/> |
43 |
</eq> |
</eq> |
44 |
<or> |
<or> |
45 |
<null> |
<null> |
46 |
<cfield name="_entity_uid_data._end_t"/> |
<cfield name="_entity_uid_data._end_t"/> |
47 |
</null> |
</null> |
48 |
<and> |
<and> |
49 |
<le> |
<le> |
50 |
<cfield name="_entity_uid_data._start_t"/> |
<cfield name="_entity_uid_data._start_t"/> |
51 |
<cfield name="own_document.date"/> |
<cfield name="own_document.date"/> |
52 |
</le> |
</le> |
53 |
<le> |
<le> |
54 |
<cfield name="own_document.date"/> |
<cfield name="own_document.date"/> |
55 |
<cfield name="_entity_uid_data._end_t"/> |
<cfield name="_entity_uid_data._end_t"/> |
56 |
</le> |
</le> |
57 |
</and> |
</and> |
58 |
</or> |
</or> |
59 |
<or> |
<or> |
60 |
<eq> |
<eq> |
61 |
<cfield name="own_document.own_document_type"/> |
<cfield name="own_document.own_document_type"/> |
62 |
<cconst value="8"/> |
<cconst value="8"/> |
63 |
</eq> |
</eq> |
64 |
<eq> |
<eq> |
65 |
<cfield name="own_document.own_document_type"/> |
<cfield name="own_document.own_document_type"/> |
66 |
<cconst value="9"/> |
<cconst value="9"/> |
67 |
</eq> |
</eq> |
68 |
<eq> |
<eq> |
69 |
<cfield name="own_document.own_document_type"/> |
<cfield name="own_document.own_document_type"/> |
70 |
<cconst value="4"/> |
<cconst value="4"/> |
71 |
</eq> |
</eq> |
72 |
</or> |
</or> |
73 |
</and> |
</and> |
139 |
|
|
140 |
<datasource name="ownItemDataSource" database="papo" detaillink="own_item.own_document" |
<datasource name="ownItemDataSource" database="papo" detaillink="own_item.own_document" |
141 |
master="ownDocumentDataSource" masterlink="id" |
master="ownDocumentDataSource" masterlink="id" |
142 |
table="own_item, own_product_invoice_item, own_item_tax"> |
table="own_item, own_product_item, own_item_tax"> |
143 |
<condition> |
<condition> |
144 |
<and> |
<and> |
145 |
<eq> |
<eq> |
146 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
147 |
<cfield name="own_product_invoice_item.own_item"/> |
<cfield name="own_product_item.own_item"/> |
148 |
</eq> |
</eq> |
149 |
<eq> |
<eq> |
150 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
197 |
line += printing.printTitle("Neto",14) + "|" + printing.printTitle("I.V.A.",12) + "|" |
line += printing.printTitle("Neto",14) + "|" + printing.printTitle("I.V.A.",12) + "|" |
198 |
line += printing.printTitle("Total",14)+"\n" |
line += printing.printTitle("Total",14)+"\n" |
199 |
table.append(line) |
table.append(line) |
200 |
|
|
201 |
totalNeto = 0 |
totalNeto = 0 |
202 |
totalIVA = 0 |
totalIVA = 0 |
203 |
documentType={'4': 'A', '9':'C', '8':'B'} |
documentType={'4': 'A', '9':'C', '8':'B'} |
204 |
|
|
205 |
condProductInvoice = GConditions.GCondition() |
condProductInvoice = GConditions.GCondition() |
206 |
tmpAnd = GConditions.GCand(condProductInvoice) |
tmpAnd = GConditions.GCand(condProductInvoice) |
207 |
ge = GConditions.GCge(tmpAnd) |
ge = GConditions.GCge(tmpAnd) |
225 |
line += "|"+printing.printField(productInvoiceResultSet.current.getField("_entity_data.name"),30) |
line += "|"+printing.printField(productInvoiceResultSet.current.getField("_entity_data.name"),30) |
226 |
line += "|"+printing.printField(productInvoiceResultSet.current.getField("_entity_uid_data.uid"),15) |
line += "|"+printing.printField(productInvoiceResultSet.current.getField("_entity_uid_data.uid"),15) |
227 |
while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more: |
while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more: |
228 |
lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_invoice_item.qty")) |
lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty")) |
229 |
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price")) |
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("_price_data.unit_price")) |
230 |
lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus")) |
lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus")) |
231 |
lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount")) |
lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount")) |