4 |
<form title="Conversor" height="2" width="25"> |
<form title="Conversor" height="2" width="25"> |
5 |
<datasource name="tmp" cache="1"/> |
<datasource name="tmp" cache="1"/> |
6 |
|
|
7 |
|
<datasource name="organizationDataSource" database="papo" |
8 |
|
table="_entity_data, _own_entity_data, _organization_data, _persona_tax_profile_data, _tax_profile_data"> |
9 |
|
<condition> |
10 |
|
<and> |
11 |
|
<!-- uniones del objeto n-1 --> |
12 |
|
<eq> |
13 |
|
<cfield name="_own_entity_data._table"/> |
14 |
|
<cfield name="_organization_data.own_entity"/> |
15 |
|
</eq> |
16 |
|
<eq> |
17 |
|
<cfield name="_entity_data._table"/> |
18 |
|
<cfield name="_own_entity_data.entity"/> |
19 |
|
</eq> |
20 |
|
<eq> |
21 |
|
<cfield name="_entity_data._table"/> |
22 |
|
<cfield name="_persona_tax_profile_data.persona"/> |
23 |
|
</eq> |
24 |
|
<eq> |
25 |
|
<cfield name="_tax_profile_data._table"/> |
26 |
|
<cfield name="_persona_tax_profile_data.tax_profile"/> |
27 |
|
</eq> |
28 |
|
<eq> |
29 |
|
<cfield name="_tax_profile_data.tax"/> |
30 |
|
<cconst value="1"/> <!-- IVA --> |
31 |
|
</eq> |
32 |
|
<!-- history tables = null n --> |
33 |
|
<null> |
34 |
|
<cfield name="_entity_data._end_t"/> |
35 |
|
</null> |
36 |
|
<null> |
37 |
|
<cfield name="_own_entity_data._end_t"/> |
38 |
|
</null> |
39 |
|
<null> |
40 |
|
<cfield name="_organization_data._end_t"/> |
41 |
|
</null> |
42 |
|
<!--busco el 1 --> |
43 |
|
<eq> |
44 |
|
<cfield name="organization.id"/> |
45 |
|
<cconst value="1"/> |
46 |
|
</eq> |
47 |
|
</and> |
48 |
|
</condition> |
49 |
|
</datasource> |
50 |
|
|
51 |
<datasource name="ownInvoiceAuxDataSource" |
<datasource name="ownInvoiceAuxDataSource" |
52 |
database="papo" table="own_document, _entity_data, _persona_tax_profile_data, _tax_profile_data " prequery="y"> |
database="papo" table="own_document, _entity_data, _persona_tax_profile_data, _tax_profile_data " prequery="y"> |
53 |
<condition> |
<condition> |
146 |
|
|
147 |
setStatusText("Actualizando ...") |
setStatusText("Actualizando ...") |
148 |
|
|
149 |
|
lOrgResult = organizationDataSource.createResultSet() |
150 |
|
if lOrgResult.firstRecord(): |
151 |
|
orgIvaTaxProfile = lOrgResult.current.getField('_tax_profile_data._table') |
152 |
|
else: |
153 |
|
orgIvaTaxProfile = 1 |
154 |
|
|
155 |
lRecordCount = ownInvoiceAuxBlock.getRecordCount() |
lRecordCount = ownInvoiceAuxBlock.getRecordCount() |
156 |
for recNum in range(lRecordCount): |
for recNum in range(lRecordCount): |
157 |
ownInvoiceAuxBlock.jumpRecord(recNum) |
ownInvoiceAuxBlock.jumpRecord(recNum) |
158 |
invoiceType = str(hack.calcInvoiceType(ownInvoiceAuxBlock.taxProfileEntry, 1)).strip().lower() |
invoiceType = str(hack.calcInvoiceType(ownInvoiceAuxBlock.taxProfileEntry, orgIvaTaxProfile)).strip().lower() |
159 |
ownInvoiceBlock.initQuery() |
ownInvoiceBlock.initQuery() |
160 |
ownInvoiceBlock.idEntry = str(ownInvoiceAuxBlock.idEntry)+"%" |
ownInvoiceBlock.idEntry = str(ownInvoiceAuxBlock.idEntry)+"%" |
161 |
ownInvoiceBlock.processQuery() |
ownInvoiceBlock.processQuery() |
172 |
lRecordCount = alienInvoiceAuxBlock.getRecordCount() |
lRecordCount = alienInvoiceAuxBlock.getRecordCount() |
173 |
for recNum in range(lRecordCount): |
for recNum in range(lRecordCount): |
174 |
alienInvoiceAuxBlock.jumpRecord(recNum) |
alienInvoiceAuxBlock.jumpRecord(recNum) |
175 |
invoiceType = hack.calcInvoiceType(1, alienInvoiceAuxBlock.taxProfileEntry).strip().lower() |
invoiceType = hack.calcInvoiceType(orgIvaTaxProfile, alienInvoiceAuxBlock.taxProfileEntry).strip().lower() |
176 |
alienInvoiceBlock.initQuery() |
alienInvoiceBlock.initQuery() |
177 |
alienInvoiceBlock.idEntry = str(alienInvoiceAuxBlock.idEntry)+"%" |
alienInvoiceBlock.idEntry = str(alienInvoiceAuxBlock.idEntry)+"%" |
178 |
alienInvoiceBlock.processQuery() |
alienInvoiceBlock.processQuery() |