1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
<!DOCTYPE form SYSTEM "gnue-forms.dtd"> |
|
2 |
|
|
3 |
<form width="88" height="13" title="Carga de Ordenes de Pago a Proveedores"> |
<!-- GNUe Forms 0.5.0 Migration Tool |
4 |
|
Saved on: 2003-02-11 17:42:12 --> |
5 |
|
|
6 |
<datasource name="tmpSearchDataSource" cache="1"/> |
<form title="Carga de Ordenes de Pago a Proveedores"> |
7 |
|
<datasource name="currencyMovementDataSource" connection="papo" |
8 |
<datasource name="tmpInvToPayDataSource" cache="1"/> |
table="movement, currency_movement"> |
9 |
|
<condition> |
10 |
<datasource name="invoiceToPayDataSource" cache="1"/> |
<eq> |
11 |
|
<cfield name="movement.id"/> |
12 |
<datasource name="providerSearchDataSource" database="papo" |
<cfield name="currency_movement.movement"/> |
13 |
table="entity, _entity_data, alien_entity, _alien_entity_data, persona, |
</eq> |
14 |
_persona_data, provider, _provider_data, entity_type_uid_conf, |
</condition> |
15 |
_entity_uid_type_data,_entity_uid_data" |
</datasource> |
16 |
order_by="_entity_data.name"> |
<datasource name="alienDocumentProceedingDataSource" connection="papo" |
17 |
|
table="alien_document_proceeding"/> |
18 |
|
<datasource name="proceedingDataSource" connection="papo" table="proceeding"/> |
19 |
|
<datasource name="alienDocumentDataSource" connection="papo" order_by="date" |
20 |
|
table="alien_document"/> |
21 |
|
<datasource name="payTotDataSource" connection="papo" |
22 |
|
table="_entity_data, alien_document, alien_document_proceeding"> |
23 |
<condition> |
<condition> |
24 |
<and> |
<and> |
25 |
<eq> |
<eq> |
|
<cfield name="entity.id"/> |
|
26 |
<cfield name="_entity_data._table"/> |
<cfield name="_entity_data._table"/> |
27 |
|
<cfield name="alien_document.sender"/> |
28 |
</eq> |
</eq> |
29 |
<eq> |
<eq> |
30 |
<cfield name="alien_entity.id"/> |
<cfield name="alien_document.id"/> |
31 |
<cfield name="_alien_entity_data._table"/> |
<cfield name="alien_document_proceeding.alien_document"/> |
32 |
</eq> |
</eq> |
33 |
|
<and> |
34 |
|
<or> |
35 |
|
<eq> |
36 |
|
<cfield name="alien_document.alien_document_type"/> |
37 |
|
<cconst value="2"/> |
38 |
|
</eq> |
39 |
|
<eq> |
40 |
|
<cfield name="alien_document.alien_document_type"/> |
41 |
|
<cconst value="5"/> |
42 |
|
</eq> |
43 |
|
</or> |
44 |
|
</and> |
45 |
|
</and> |
46 |
|
</condition> |
47 |
|
</datasource> |
48 |
|
<datasource name="productInvoiceDataSource" connection="papo" |
49 |
|
order_by="alien_product_item.id" |
50 |
|
table="_entity_data, alien_document, alien_item, alien_product_item, alien_item_tax"> |
51 |
|
<condition> |
52 |
|
<and> |
53 |
<eq> |
<eq> |
54 |
<cfield name="persona.id"/> |
<cfield name="_entity_data.id"/> |
55 |
<cfield name="_persona_data._table"/> |
<cfield name="alien_document.sender"/> |
56 |
</eq> |
</eq> |
57 |
<eq> |
<eq> |
58 |
<cfield name="provider.id"/> |
<cfield name="alien_document.id"/> |
59 |
<cfield name="_provider_data._table"/> |
<cfield name="alien_item.alien_document"/> |
60 |
</eq> |
</eq> |
61 |
<eq> |
<eq> |
62 |
<cfield name="entity.id"/> |
<cfield name="alien_item.id"/> |
63 |
<cfield name="_alien_entity_data.entity"/> |
<cfield name="alien_product_item.alien_item"/> |
64 |
</eq> |
</eq> |
65 |
<eq> |
<eq> |
66 |
<cfield name="alien_entity.id"/> |
<cfield name="alien_item.id"/> |
67 |
<cfield name="_persona_data.alien_entity"/> |
<cfield name="alien_item_tax.alien_item"/> |
68 |
</eq> |
</eq> |
69 |
<eq> |
<eq> |
70 |
<cfield name="persona.id"/> |
<cfield name="alien_document.alien_document_type"/> |
71 |
<cfield name="_provider_data.persona"/> |
<cconst value="2"/> |
72 |
</eq> |
</eq> |
73 |
|
</and> |
74 |
|
</condition> |
75 |
|
</datasource> |
76 |
|
<datasource name="serviceInvoiceDataSource" connection="papo" |
77 |
|
order_by="alien_service_item.id" |
78 |
|
table="_entity_data, alien_document, alien_item, alien_service_item, alien_item_tax"> |
79 |
|
<condition> |
80 |
|
<and> |
81 |
<eq> |
<eq> |
82 |
<cfield name="_entity_data._table"/> |
<cfield name="_entity_data.id"/> |
83 |
<cfield name="_entity_uid_data.entity"/> |
<cfield name="alien_document.sender"/> |
84 |
</eq> |
</eq> |
85 |
<eq> |
<eq> |
86 |
<cfield name="_entity_uid_data.entity_uid_type"/> |
<cfield name="alien_document.id"/> |
87 |
<cfield name="_entity_uid_type_data._table"/> |
<cfield name="alien_item.alien_document"/> |
88 |
</eq> |
</eq> |
89 |
<eq> |
<eq> |
90 |
<cfield name="_entity_type_data._table"/> |
<cfield name="alien_item.id"/> |
91 |
<cfield name="entity_type_uid_conf.entity_type"/> |
<cfield name="alien_service_item.alien_item"/> |
92 |
</eq> |
</eq> |
93 |
<eq> |
<eq> |
94 |
<cfield name="entity_type_uid_conf.entity_type"/> |
<cfield name="alien_item.id"/> |
95 |
<cconst value="7"/> <!-- Es el id del entity_type correspondiente a cliente --> |
<cfield name="alien_item_tax.alien_item"/> |
96 |
|
</eq> |
97 |
|
<eq> |
98 |
|
<cfield name="alien_document.alien_document_type"/> |
99 |
|
<cconst value="5"/> |
100 |
</eq> |
</eq> |
|
<null> |
|
|
<cfield name="_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_alien_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_persona_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_provider_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_entity_uid_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_entity_type_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_entity_uid_type_data._end_t"/> |
|
|
</null> |
|
101 |
</and> |
</and> |
102 |
</condition> |
</condition> |
103 |
</datasource> |
</datasource> |
104 |
|
<datasource name="invTaxTotDataSource" connection="papo" |
|
<datasource name="invTaxTotDataSource" database="papo" |
|
105 |
table="alien_document, alien_document_tax"> |
table="alien_document, alien_document_tax"> |
106 |
<condition> |
<condition> |
107 |
<eq> |
<eq> |
108 |
<cfield name="alien_document.id"/> |
<cfield name="alien_document.id"/> |
109 |
<cfield name="alien_document_tax.alien_document"/> |
<cfield name="alien_document_tax.alien_document"/> |
110 |
</eq> |
</eq> |
111 |
</condition> |
</condition> |
112 |
</datasource> |
</datasource> |
113 |
|
<datasource name="providerDataSource" connection="papo" |
114 |
<datasource name="productInvoiceDataSource" database="papo" |
order_by="_entity_data.name" |
115 |
table="_entity_data, alien_document, alien_item, alien_product_item, alien_item_tax" |
table="entity, _entity_data, alien_entity, _alien_entity_data, persona, _persona_data, provider, _provider_data"> |
116 |
order_by="alien_product_item.id"> |
<condition> |
|
<condition> |
|
117 |
<and> |
<and> |
118 |
<eq> |
<eq> |
119 |
<!-- Aqui se refiere al cliente --> |
<cfield name="entity.id"/> |
120 |
<cfield name="_entity_data._table"/> |
<cfield name="_entity_data._table"/> |
|
<cfield name="alien_document.sender"/> |
|
121 |
</eq> |
</eq> |
122 |
<eq> |
<eq> |
123 |
<cfield name="alien_document.id"/> |
<cfield name="alien_entity.id"/> |
124 |
<cfield name="alien_item.alien_document"/> |
<cfield name="_alien_entity_data._table"/> |
125 |
</eq> |
</eq> |
126 |
<eq> |
<eq> |
127 |
<cfield name="alien_item.id"/> |
<cfield name="persona.id"/> |
128 |
<cfield name="alien_product_item.alien_item"/> |
<cfield name="_persona_data._table"/> |
129 |
</eq> |
</eq> |
130 |
<eq> |
<eq> |
131 |
<cfield name="alien_item.id"/> |
<cfield name="provider.id"/> |
132 |
<cfield name="alien_item_tax.alien_item"/> |
<cfield name="_provider_data._table"/> |
133 |
</eq> |
</eq> |
134 |
<eq> |
<eq> |
135 |
<cfield name="alien_document.alien_document_type"/> |
<cfield name="entity.id"/> |
136 |
<cconst value="2"/> |
<cfield name="_alien_entity_data.entity"/> |
137 |
</eq> |
</eq> |
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource name="payTotDataSource" database="papo" table="_entity_data, alien_document, alien_document_proceeding"> |
|
|
<condition> |
|
|
<and> |
|
138 |
<eq> |
<eq> |
139 |
<!-- Aqui se refiere al cliente --> |
<cfield name="alien_entity.id"/> |
140 |
<cfield name="_entity_data._table"/> |
<cfield name="_persona_data.alien_entity"/> |
|
<cfield name="alien_document.sender"/> |
|
141 |
</eq> |
</eq> |
142 |
<eq> |
<eq> |
143 |
<cfield name="alien_document.id"/> |
<cfield name="persona.id"/> |
144 |
<cfield name="alien_document_proceeding.alien_document"/> |
<cfield name="_provider_data.persona"/> |
145 |
</eq> |
</eq> |
146 |
<and> |
<null> |
147 |
<or> |
<cfield name="_entity_data._end_t"/> |
148 |
<eq> |
</null> |
149 |
<cfield name="alien_document.alien_document_type"/> |
<null> |
150 |
<cconst value="2"/> |
<cfield name="_alien_entity_data._end_t"/> |
151 |
</eq> |
</null> |
152 |
<eq> |
<null> |
153 |
<cfield name="alien_document.alien_document_type"/> |
<cfield name="_persona_data._end_t"/> |
154 |
<cconst value="5"/> |
</null> |
155 |
</eq> |
<null> |
156 |
</or> |
<cfield name="_provider_data._end_t"/> |
157 |
</and> |
</null> |
158 |
</and> |
</and> |
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<datasource database="papo" name="alienDocumentDataSource" table="alien_document" |
|
|
order_by="date" /> |
|
|
|
|
|
<datasource name="proceedingDataSource" database="papo" table="proceeding"/> |
|
|
|
|
|
<datasource name="alienDocumentProceedingDataSource" database="papo" table="alien_document_proceeding"/> |
|
|
|
|
|
<datasource name="currencyMovementDataSource" database="papo" |
|
|
table="movement, currency_movement"> |
|
|
<condition> |
|
|
<eq> |
|
|
<cfield name="movement.id"/> |
|
|
<cfield name="currency_movement.movement"/> |
|
|
</eq> |
|
159 |
</condition> |
</condition> |
160 |
</datasource> |
</datasource> |
161 |
|
<datasource name="invoiceToPayDataSource" cache="1"/> |
162 |
<trigger name="cancelTrigger" type="NAMED"> |
<datasource name="tmpInvToPayDataSource" cache="1"/> |
163 |
alienDocumentSearchBlock.processRollback() |
<datasource name="tmpSearchDataSource" cache="1"/> |
164 |
invoiceToPayBlock.processRollback() |
<trigger name="cancelTrigger" type="NAMED"><![CDATA[ |
165 |
</trigger> |
alienDocumentSearchBlock.rollback() |
166 |
|
invoiceToPayBlock.rollback() |
167 |
|
]]></trigger> |
168 |
<trigger name="searchTrigger" type="NAMED"><![CDATA[ |
<trigger name="searchTrigger" type="NAMED"><![CDATA[ |
169 |
|
|
170 |
tmpInvToPayedBlock.processRollback() |
tmpInvToPayedBlock.rollback() |
171 |
invoiceToPayBlock.processRollback() |
invoiceToPayBlock.rollback() |
172 |
|
|
173 |
total = 0.0 |
total = 0.0 |
174 |
if str(alienDocumentSearchBlock.providerSearchBox.providerEntry): |
if str(alienDocumentSearchBlock.providerSEntry): |
175 |
import gnue.common.GConditions as GConditions |
import gnue.common.GConditions as GConditions |
176 |
import hack |
import hack |
177 |
|
|
181 |
|
|
182 |
eq = GConditions.GCeq(condProductInvoice) |
eq = GConditions.GCeq(condProductInvoice) |
183 |
GConditions.GCField(eq,"_entity_data._table") |
GConditions.GCField(eq,"_entity_data._table") |
184 |
GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry)) |
GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSEntry)) |
185 |
|
|
186 |
|
eq = GConditions.GCeq(condServiceInvoice) |
187 |
|
GConditions.GCField(eq,"_entity_data._table") |
188 |
|
GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSEntry)) |
189 |
|
|
190 |
eq = GConditions.GCeq(condPay) |
eq = GConditions.GCeq(condPay) |
191 |
GConditions.GCField(eq,"_entity_data._table") |
GConditions.GCField(eq,"_entity_data._table") |
192 |
GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSearchBox.providerEntry)) |
GConditions.GCConst(eq,str(alienDocumentSearchBlock.providerSEntry)) |
193 |
|
|
194 |
# Calculo del total facturado por Productos |
# Calculo del total facturado por Productos |
195 |
productInvoiceResultSet = productInvoiceDataSource.createResultSet(condProductInvoice) |
productInvoiceResultSet = productInvoiceDataSource.createResultSet(condProductInvoice) |
196 |
more = productInvoiceResultSet.firstRecord() |
more = productInvoiceResultSet.firstRecord() |
197 |
|
|
|
|
|
198 |
while more: |
while more: |
199 |
invoiceTotal = 0 |
invoiceTotal = 0 |
200 |
currAlienDoc = productInvoiceResultSet.current.getField("alien_document.id") |
currAlienDoc = productInvoiceResultSet.current.getField("alien_document.id") |
201 |
tmpInvToPayedBlock.idEntry = str(productInvoiceResultSet.current.getField("alien_document.id")) |
tmpInvToPayedBlock.idEntry1 = str(productInvoiceResultSet.current.getField("alien_document.id")) |
202 |
|
|
203 |
while productInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more: |
while productInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more: |
204 |
lQty = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.qty")) |
lQty = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.qty")) |
205 |
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.unit_price")) |
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("alien_product_item.unit_price")) |
219 |
odt_more = odt_rs.nextRecord() |
odt_more = odt_rs.nextRecord() |
220 |
|
|
221 |
tmpInvToPayedBlock.numberEntry = str(productInvoiceResultSet.current.getField("alien_document.number")) |
tmpInvToPayedBlock.numberEntry = str(productInvoiceResultSet.current.getField("alien_document.number")) |
222 |
tmpInvToPayedBlock.dateEntry = str(productInvoiceResultSet.current.getField("alien_document.date")) |
tmpInvToPayedBlock.dateEntry1 = str(productInvoiceResultSet.current.getField("alien_document.date")) |
223 |
|
tmpInvToPayedBlock.amountEntry = str(invoiceTotal) |
224 |
|
tmpInvToPayedBlock.payedEntry = "0.0" |
225 |
|
tmpInvToPayedBlock.newRecord() |
226 |
|
|
227 |
|
# Calculo del total facturado por Servicios |
228 |
|
serviceInvoiceResultSet = serviceInvoiceDataSource.createResultSet(condServiceInvoice) |
229 |
|
more = serviceInvoiceResultSet.firstRecord() |
230 |
|
|
231 |
|
while more: |
232 |
|
invoiceTotal = 0 |
233 |
|
currAlienDoc = serviceInvoiceResultSet.current.getField("alien_document.id") |
234 |
|
tmpInvToPayedBlock.idEntry1 = str(serviceInvoiceResultSet.current.getField("alien_document.id")) |
235 |
|
|
236 |
|
while serviceInvoiceResultSet.current.getField("alien_document.id") == currAlienDoc and more: |
237 |
|
lUnitPrice = hack.a2f(serviceInvoiceResultSet.current.getField("alien_service_item.amount")) |
238 |
|
lBonus = hack.a2f(serviceInvoiceResultSet.current.getField("alien_item.bonus")) |
239 |
|
lDiscount = hack.a2f(serviceInvoiceResultSet.current.getField("alien_item.discount")) |
240 |
|
item = lUnitPrice - lBonus - lDiscount |
241 |
|
itemTaxTotal = 0 |
242 |
|
currItem = serviceInvoiceResultSet.current.getField("alien_item.id") |
243 |
|
while serviceInvoiceResultSet.current.getField("alien_item.id") == currItem and more: |
244 |
|
itemTaxTotal += hack.a2f(serviceInvoiceResultSet.current.getField("alien_item_tax.amount")) |
245 |
|
more = serviceInvoiceResultSet.nextRecord() |
246 |
|
invoiceTotal += item + itemTaxTotal |
247 |
|
odt_rs = invTaxTotDataSource.createResultSet({"alien_document.id":currAlienDoc}) |
248 |
|
odt_more = odt_rs.firstRecord() |
249 |
|
while odt_more: |
250 |
|
invoiceTotal += hack.a2f(odt_rs.current.getField("alien_document_tax.amount")) |
251 |
|
odt_more = odt_rs.nextRecord() |
252 |
|
|
253 |
|
tmpInvToPayedBlock.dateEntry1 = str(serviceInvoiceResultSet.current.getField("alien_document.date")) |
254 |
|
tmpInvToPayedBlock.numberEntry = str(serviceInvoiceResultSet.current.getField("alien_document.number")) |
255 |
tmpInvToPayedBlock.amountEntry = str(invoiceTotal) |
tmpInvToPayedBlock.amountEntry = str(invoiceTotal) |
256 |
tmpInvToPayedBlock.payedEntry = "0.0" |
tmpInvToPayedBlock.payedEntry = "0.0" |
257 |
tmpInvToPayedBlock.newRecord() |
tmpInvToPayedBlock.newRecord() |
262 |
while more: |
while more: |
263 |
rc = tmpInvToPayedBlock.getRecordCount() |
rc = tmpInvToPayedBlock.getRecordCount() |
264 |
for recNum in range(rc): |
for recNum in range(rc): |
265 |
tmpInvToPayedBlock.jumpRecord(recNum) |
tmpInvToPayedBlock.gotoRecord(recNum) |
266 |
if hack.a2f(tmpInvToPayedBlock.idEntry) == hack.a2f(rs.current.getField("alien_document_proceeding.alien_document")): |
if tmpInvToPayedBlock.idEntry1 == rs.current.getField("alien_document_proceeding.alien_document"): |
267 |
tmpInvToPayedBlock.payedEntry = str( |
tmpInvToPayedBlock.payedEntry = str( |
268 |
hack.a2f(tmpInvToPayedBlock.payedEntry) + \ |
hack.a2f(tmpInvToPayedBlock.payedEntry) + \ |
269 |
hack.a2f(rs.current.getField("alien_document_proceeding.amount") ) ) |
hack.a2f(rs.current.getField("alien_document_proceeding.amount") ) ) |
271 |
|
|
272 |
rc = tmpInvToPayedBlock.getRecordCount() |
rc = tmpInvToPayedBlock.getRecordCount() |
273 |
for recNum in range(rc): |
for recNum in range(rc): |
274 |
tmpInvToPayedBlock.jumpRecord(recNum) |
tmpInvToPayedBlock.gotoRecord(recNum) |
275 |
if hack.a2f(tmpInvToPayedBlock.payedEntry) < hack.a2f(tmpInvToPayedBlock.amountEntry): |
if hack.a2f(tmpInvToPayedBlock.payedEntry) < hack.a2f(tmpInvToPayedBlock.amountEntry): |
276 |
invoiceToPayBlock.invoiceBox.idEntry = str(tmpInvToPayedBlock.idEntry) |
invoiceToPayBlock.idEntry2 = str(tmpInvToPayedBlock.idEntry1) |
277 |
invoiceToPayBlock.invoiceBox.numberEntry = str(tmpInvToPayedBlock.numberEntry) |
invoiceToPayBlock.numberEntry1 = str(tmpInvToPayedBlock.numberEntry) |
278 |
invoiceToPayBlock.invoiceBox.dateEntry = str(tmpInvToPayedBlock.dateEntry) |
invoiceToPayBlock.dateEntry2 = str(tmpInvToPayedBlock.dateEntry1) |
279 |
invoiceToPayBlock.invoiceBox.amountEntry = str(tmpInvToPayedBlock.amountEntry) |
invoiceToPayBlock.amountEntry1 = str(tmpInvToPayedBlock.amountEntry) |
280 |
invoiceToPayBlock.invoiceBox.payedEntry = str(tmpInvToPayedBlock.payedEntry) |
invoiceToPayBlock.payedEntry1 = str(tmpInvToPayedBlock.payedEntry) |
281 |
invoiceToPayBlock.invoiceBox.payEntry = str( |
invoiceToPayBlock.payEntry = str( |
282 |
hack.a2f(tmpInvToPayedBlock.amountEntry) - \ |
hack.a2f(tmpInvToPayedBlock.amountEntry) - \ |
283 |
hack.a2f(tmpInvToPayedBlock.payedEntry)) |
hack.a2f(tmpInvToPayedBlock.payedEntry)) |
284 |
total += hack.a2f(invoiceToPayBlock.invoiceBox.payEntry) |
total += hack.a2f(invoiceToPayBlock.payEntry) |
285 |
invoiceToPayBlock.newRecord() |
invoiceToPayBlock.newRecord() |
286 |
|
|
287 |
invoiceToPayBlock.invoiceBox.totalEntry = str(total) |
invoiceToPayBlock.totalEntry = str(total) |
288 |
|
|
289 |
]]></trigger> |
]]></trigger> |
290 |
|
<trigger name="totalTrigger" type="NAMED"><![CDATA[ |
|
<trigger type="NAMED" name="totalTrigger"><![CDATA[ |
|
291 |
|
|
292 |
import hack |
import hack |
293 |
rc = invoiceToPayBlock.getRecordCount() |
rc = invoiceToPayBlock.getRecordCount() |
294 |
total = 0.0 |
total = 0.0 |
295 |
|
|
296 |
for recNum in range(rc): |
for recNum in range(rc): |
297 |
invoiceToPayBlock.jumpRecord(recNum) |
invoiceToPayBlock.gotoRecord(recNum) |
298 |
total += hack.a2f(invoiceToPayBlock.invoiceBox.payEntry) |
total += hack.a2f(invoiceToPayBlock.payEntry) |
299 |
|
|
300 |
invoiceToPayBlock.invoiceBox.totalEntry = str(total) |
invoiceToPayBlock.totalEntry = str(total) |
301 |
|
|
302 |
]]></trigger> |
]]></trigger> |
303 |
|
<trigger name="acceptTrigger" type="NAMED"><![CDATA[ |
|
<trigger type="NAMED" name="acceptTrigger"><![CDATA[ |
|
304 |
import hack |
import hack |
305 |
|
|
306 |
proceedingBlock.processRollback() |
proceedingBlock.rollback() |
307 |
currencyMovementBlock.processRollback() |
currencyMovementBlock.rollback() |
308 |
alienDocumentProceedingBlock.processRollback() |
alienDocumentProceedingBlock.rollback() |
309 |
|
|
310 |
alienDocumentSearchBlock.providerSearchBox.dateEntry = alienDocumentDataSource.getTimeStamp() |
alienDocumentSearchBlock.dateEntry = alienDocumentDataSource.getTimeStamp() |
311 |
alienDocumentSearchBlock.providerSearchBox.idEntry.autofillBySequence('alien_document_id_seq') |
alienDocumentSearchBlock.idEntry.autofillBySequence('alien_document_id_seq') |
312 |
alienDocumentSearchBlock.providerSearchBox.typeEntry = "6" |
alienDocumentSearchBlock.typeEntry = "6" |
313 |
|
|
314 |
proceedingBlock.idEntry.autofillBySequence('proceeding_id_seq') |
proceedingBlock.idEntry3.autofillBySequence('proceeding_id_seq') |
315 |
proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp() |
proceedingBlock.dateEntry3 = proceedingDataSource.getTimeStamp() |
316 |
|
|
317 |
currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry) |
currencyMovementBlock.proceedingEntry1 = str(proceedingBlock.idEntry3) |
318 |
currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto |
currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto |
319 |
currencyMovementBlock.currencyTypeEntry = "1" |
currencyMovementBlock.currencyTypeEntry = "1" |
320 |
currencyMovementBlock.amountEntry = str(invoiceToPayBlock.invoiceBox.totalEntry) |
currencyMovementBlock.amountEntry3 = str(invoiceToPayBlock.totalEntry) |
321 |
|
|
322 |
alienDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry) |
alienDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry3) |
323 |
alienDocumentProceedingBlock.alienDocumentEntry = str(alienDocumentSearchBlock.providerSearchBox.idEntry) |
alienDocumentProceedingBlock.alienDocumentEntry = str(alienDocumentSearchBlock.idEntry) |
324 |
alienDocumentProceedingBlock.amountEntry = str(invoiceToPayBlock.invoiceBox.totalEntry) |
alienDocumentProceedingBlock.amountEntry2 = str(invoiceToPayBlock.totalEntry) |
325 |
|
|
326 |
rc = invoiceToPayBlock.getRecordCount() |
rc = invoiceToPayBlock.getRecordCount() |
327 |
for recNum in range(rc): |
for recNum in range(rc): |
328 |
invoiceToPayBlock.jumpRecord(recNum) |
invoiceToPayBlock.gotoRecord(recNum) |
329 |
if hack.a2f(invoiceToPayBlock.invoiceBox.payEntry) > 0: |
if hack.a2f(invoiceToPayBlock.payEntry) > 0: |
330 |
alienDocumentProceedingBlock.newRecord() |
alienDocumentProceedingBlock.newRecord() |
331 |
alienDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry) |
alienDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry3) |
332 |
alienDocumentProceedingBlock.alienDocumentEntry = str(invoiceToPayBlock.invoiceBox.idEntry) |
alienDocumentProceedingBlock.alienDocumentEntry = str(invoiceToPayBlock.idEntry2) |
333 |
alienDocumentProceedingBlock.amountEntry = str(invoiceToPayBlock.invoiceBox.payEntry) |
alienDocumentProceedingBlock.amountEntry2 = str(invoiceToPayBlock.payEntry) |
334 |
|
|
335 |
alienDocumentSearchBlock.commit() |
alienDocumentSearchBlock.commit() |
336 |
callTrigger('cancelTrigger') |
callTrigger('cancelTrigger') |
337 |
|
|
338 |
]]></trigger> |
]]></trigger> |
339 |
|
<logic> |
340 |
<trigger name="providerSearchTrigger" type="NAMED"><![CDATA[ |
<block name="alienDocumentSearchBlock" |
341 |
|
datasource="alienDocumentDataSource" restrictInsert=""> |
342 |
callTrigger('startWaitingModeTrigger') |
<field name="idEntry" field="id"/> |
343 |
providerResultBlock.initQuery() |
<field name="typeEntry" field="alien_document_type"/> |
344 |
providerResultBlock.providerCodeEntry = str(alienDocumentSearchBlock.providerSearchBox.providerCodeEntry)+"%" |
<field name="providerSEntry" field="alien_document.sender" |
345 |
providerResultBlock.providerNameEntry = str(alienDocumentSearchBlock.providerSearchBox.providerNameEntry)+"%" |
fk_description="_entity_data.name" fk_key="entity.id" fk_source="providerDataSource"/> |
346 |
providerResultBlock.processQuery() |
<field name="dateEntry" field="date" readonly="" typecast="date"/> |
|
callTrigger('endWaitingModeTrigger') |
|
|
recordCount = providerResultBlock.getRecordCount() |
|
|
|
|
|
if recordCount > 1: |
|
|
|
|
|
def callback (returnValue): |
|
|
global block |
|
|
if returnValue >= 0: |
|
|
providerResultBlock.jumpRecord(returnValue) |
|
|
alienDocumentSearchBlock.providerSearchBox.providerCodeEntry = str(providerResultBlock.providerCodeEntry) |
|
|
alienDocumentSearchBlock.providerSearchBox.providerNameEntry = str(providerResultBlock.providerNameEntry) |
|
|
alienDocumentSearchBlock.providerSearchBox.providerEntry = str(providerResultBlock.providerEntry) |
|
|
|
|
|
runForm ('providerSelect.gfd', {'data': providerResultBlock, 'callback': callback}) |
|
|
elif recordCount == 1: |
|
|
providerResultBlock.jumpRecord(0) |
|
|
alienDocumentSearchBlock.providerSearchBox.providerCodeEntry = str(providerResultBlock.providerCodeEntry) |
|
|
alienDocumentSearchBlock.providerSearchBox.providerNameEntry = str(providerResultBlock.providerNameEntry) |
|
|
alienDocumentSearchBlock.providerSearchBox.providerEntry = str(providerResultBlock.providerEntry) |
|
|
|
|
|
]]></trigger> |
|
|
|
|
|
<trigger name="startWaitingModeTrigger" type="NAMED"><![CDATA[ |
|
|
setStatusText("Procesando ...") |
|
|
try: |
|
|
# gnue version <= 0.4 |
|
|
from gnue.forms.GFEvent import GFEvent |
|
|
except ImportError: |
|
|
# gnue version >= 0.5 |
|
|
from gnue.common.events.Event import Event as GFEvent |
|
|
|
|
|
# busy clock |
|
|
self._object.dispatchEvent(GFEvent('beginWAIT')) |
|
|
]]></trigger> |
|
|
|
|
|
<trigger name="endWaitingModeTrigger" type="NAMED"><![CDATA[ |
|
|
try: |
|
|
# gnue version <= 0.4 |
|
|
from gnue.forms.GFEvent import GFEvent |
|
|
except ImportError: |
|
|
# gnue version >= 0.5 |
|
|
from gnue.common.events.Event import Event as GFEvent |
|
|
|
|
|
self._object.dispatchEvent(GFEvent('endWAIT')) |
|
|
setStatusText("Listo") |
|
|
]]></trigger> |
|
|
|
|
|
<page name="Búsqueda de Facturas de Proveedor"> |
|
|
|
|
|
<block name="providerResultBlock" datasource="providerSearchDataSource"> |
|
|
<entry name="providerEntry" field="_entity_data.id" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="providerTypeEntry" field="_entity_uid_data.entity_uid_type" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="providerCodeEntry" field="_entity_uid_data.uid" hidden="" x="1" y="1" width="12"/> |
|
|
<entry name="providerNameEntry" field="_entity_data.name" hidden="" x="1" y="1" width="20"/> |
|
347 |
</block> |
</block> |
|
|
|
|
<block datasource="alienDocumentDataSource" name="alienDocumentSearchBlock" restrictInsert=""> |
|
|
|
|
|
<box height="5" label="Proveedores" |
|
|
name="providerSearchBox" width="85" x="1" y="0"> |
|
|
|
|
|
<entry field="id" hidden="" name="idEntry" x="1" y="1"/> |
|
|
<entry field="alien_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
|
|
|
|
|
<entry x="1" y="1" field="sender" name="providerEntry" width="30" hidden=""/> |
|
|
<entry x="1" y="1" name="providerCodeEntry" width="20"/> |
|
|
<entry x="21" y="1" name="providerNameEntry" width="35"/> |
|
|
<entry field="date" hidden="" name="dateEntry" style="label" readonly="" typecast="date" |
|
|
rows="1" width="24" x="7" y="7"/> |
|
|
|
|
|
<button name="providerSearchButton" trigger="providerSearchTrigger" label="Buscar" |
|
|
width="10" height="1" x="60" y="1"/> |
|
|
|
|
|
<button name="cancelButton" trigger="cancelTrigger" label="Cancelar" |
|
|
width="10" height="1" x="71" y="1"/> |
|
|
|
|
|
<button x="60" y="2" trigger="searchTrigger" width="21" label="Facturas a Pagar" |
|
|
name="searchBtn" height="1"/> |
|
|
|
|
|
</box> |
|
|
</block> |
|
|
|
|
348 |
<block name="tmpInvToPayedBlock" datasource="tmpInvToPayDataSource"> |
<block name="tmpInvToPayedBlock" datasource="tmpInvToPayDataSource"> |
349 |
<entry name="idEntry" field="id" hidden="" x="1" y="1" width="1" /> |
<field name="idEntry1" field="id"/> |
350 |
<entry name="numberEntry" field="number" hidden="" x="1" y="1" width="1" /> |
<field name="numberEntry" field="number"/> |
351 |
<entry name="dateEntry" field="date" hidden="" x="1" y="1" width="1"/> |
<field name="dateEntry1" field="date"/> |
352 |
<entry name="amountEntry" field="amount" hidden="" x="1" y="1" width="1"/> |
<field name="amountEntry" field="amount"/> |
353 |
<entry name="payedEntry" field="payed" hidden="" x="1" y="1" width="1"/> |
<field name="payedEntry" field="payed"/> |
354 |
</block> |
</block> |
|
|
|
355 |
<block name="invoiceToPayBlock" datasource="invoiceToPayDataSource"> |
<block name="invoiceToPayBlock" datasource="invoiceToPayDataSource"> |
356 |
<box height="12" label="Facturas A Pagar" name="invoiceBox" |
<field name="idEntry2" field="id"/> |
357 |
width="85" x="1" y="4"> |
<field name="numberEntry1" field="number" readonly=""/> |
358 |
<label name="numberLbl" text="Numero" x="1" y="1"/> |
<field name="dateEntry2" field="date" readonly=""/> |
359 |
<label name="dateLbl" text="Fecha" x="20" y="1"/> |
<field name="amountEntry1" displaymask="%0.2f" field="amount" |
360 |
<label name="amountLbl" text="Monto" x="33" y="1"/> |
readonly="" typecast="number"/> |
361 |
<label name="payedLbl" text="Pagado" x="45" y="1"/> |
<field name="payedEntry1" field="payed" readonly=""/> |
362 |
<label name="payLbl" text="A Pagar" x="57" y="1"/> |
<field name="payEntry" displaymask="%0.2f" field="pay" typecast="number"> |
363 |
|
<trigger src="totalTrigger" type="PRE-FOCUSOUT"/> |
364 |
<entry name="idEntry" field="id" style="label" hidden="" rows="8" |
</field> |
365 |
x="1" y="2" width="1" /> |
<field name="totalEntry" displaymask="%0.2f" field="total" readonly="" |
366 |
<entry name="numberEntry" field="number" style="label" rows="8" |
typecast="number"/> |
|
x="1" y="2" width="19" readonly=""/> |
|
|
<entry name="dateEntry" field="date" style="label" rows="8" |
|
|
x="20" y="2" width="11" readonly=""/> |
|
|
<entry name="amountEntry" field="amount" style="label" rows="8" |
|
|
typecast="number" displaymask="%0.2f" |
|
|
x="33" y="2" width="10" readonly=""/> |
|
|
<entry name="payedEntry" field="payed" style="label" rows="8" |
|
|
x="45" y="2" width="11" readonly="" typecast="number" displaymask="%0.2f"/> |
|
|
<entry name="payEntry" field="pay" rows="8" x="57" y="2" width="10" |
|
|
typecast="number" displaymask="%0.2f"> |
|
|
<trigger type="PRE-FOCUSOUT" src="totalTrigger"/> |
|
|
</entry> |
|
|
<scrollbar page="2" x="68" y="2" width="1" height="8"/> |
|
|
|
|
|
<label name="totalLbl" text="Total a Pagar" x="70" y="5"/> |
|
|
<entry name="totalEntry" field="total" x="70" y="6" width="10" readonly="" typecast="number" displaymask="%0.2f"/> |
|
|
|
|
|
<button name="acceptButton" trigger="acceptTrigger" label="Aceptar" |
|
|
width="10" height="1" x="70" y="8"/> |
|
|
<button name="cancelButton" trigger="cancelTrigger" label="Cancelar" |
|
|
width="10" height="1" x="70" y="9"/> |
|
|
</box> |
|
367 |
</block> |
</block> |
|
|
|
368 |
<block name="proceedingBlock" datasource="proceedingDataSource"> |
<block name="proceedingBlock" datasource="proceedingDataSource"> |
369 |
<entry name="idEntry" field="id" hidden="" x="1" y="1" width="12"/> |
<field name="idEntry3" field="id"/> |
370 |
<entry name="dateEntry" field="date" hidden="" x="1" y="1" width="12"/> |
<field name="dateEntry3" field="date"/> |
371 |
</block> |
</block> |
372 |
<block name="alienDocumentProceedingBlock" datasource="alienDocumentProceedingDataSource"> |
<block name="alienDocumentProceedingBlock" |
373 |
<entry name="proceedingEntry" field="proceeding" hidden="" x="1" y="1" width="12"/> |
datasource="alienDocumentProceedingDataSource"> |
374 |
<entry name="alienDocumentEntry" field="alien_document" hidden="" |
<field name="proceedingEntry" field="proceeding"/> |
375 |
x="1" y="1" width="12"/> |
<field name="alienDocumentEntry" field="alien_document"/> |
376 |
<entry name="amountEntry" field="amount" hidden="" x="1" y="1" width="12"/> |
<field name="amountEntry2" field="amount"/> |
377 |
</block> |
</block> |
378 |
<block name="currencyMovementBlock" datasource="currencyMovementDataSource"> |
<block name="currencyMovementBlock" |
379 |
<entry name="proceedingEntry" field="movement.proceeding" hidden="" |
datasource="currencyMovementDataSource"> |
380 |
x="1" y="1" width="12"/> |
<field name="proceedingEntry1" field="movement.proceeding"/> |
381 |
<entry name="movementTypeEntry" field="movement.movement_type" hidden="" |
<field name="movementTypeEntry" field="movement.movement_type"/> |
382 |
x="1" y="1" width="12"/> |
<field name="amountEntry3" field="movement.amount"/> |
383 |
<entry name="amountEntry" field="movement.amount" hidden="" x="1" y="1" width="12"/> |
<field name="currencyTypeEntry" field="currency_movement.currency_type"/> |
|
<entry name="currencyTypeEntry" field="currency_movement.currency_type" hidden="" |
|
|
x="1" y="1" width="12"/> |
|
384 |
</block> |
</block> |
385 |
</page> |
</logic> |
386 |
|
<layout xmlns:c="GNUe:Layout:Char" c:height="16" c:width="78"> |
387 |
|
<page name="Búsqueda de Facturas de Proveedor"> |
388 |
|
<box name="providerSearchBox" c:height="4" label="Proveedores" |
389 |
|
c:width="75" c:x="1" c:y="0"/> |
390 |
|
<entry block="alienDocumentSearchBlock" field="idEntry" hidden="" |
391 |
|
c:x="3" c:y="2"/> |
392 |
|
<entry block="alienDocumentSearchBlock" field="typeEntry" hidden="" |
393 |
|
c:x="3" c:y="2"/> |
394 |
|
<entry block="alienDocumentSearchBlock" field="providerSEntry" |
395 |
|
style="dropdown" c:width="40" c:x="3" c:y="2"/> |
396 |
|
<entry block="alienDocumentSearchBlock" field="dateEntry" hidden="" |
397 |
|
rows="1" style="label" c:width="24" c:x="9" c:y="8"/> |
398 |
|
<button name="searchBtn" c:height="1" label="Buscar" c:width="16" |
399 |
|
c:x="52" c:y="2"> |
400 |
|
<trigger src="searchTrigger" type="On-Action"/> |
401 |
|
</button> |
402 |
|
<entry block="tmpInvToPayedBlock" field="idEntry1" hidden="" c:width="1" |
403 |
|
c:x="1" c:y="1"/> |
404 |
|
<entry block="tmpInvToPayedBlock" field="numberEntry" hidden="" |
405 |
|
c:width="1" c:x="1" c:y="1"/> |
406 |
|
<entry block="tmpInvToPayedBlock" field="dateEntry1" hidden="" |
407 |
|
c:width="1" c:x="1" c:y="1"/> |
408 |
|
<entry block="tmpInvToPayedBlock" field="amountEntry" hidden="" |
409 |
|
c:width="1" c:x="1" c:y="1"/> |
410 |
|
<entry block="tmpInvToPayedBlock" field="payedEntry" hidden="" |
411 |
|
c:width="1" c:x="1" c:y="1"/> |
412 |
|
<box name="invoiceBox" c:height="12" label="Facturas A Pagar" |
413 |
|
c:width="75" c:x="1" c:y="4"/> |
414 |
|
<label name="numberLbl" text="Numero" c:x="3" c:y="6"/> |
415 |
|
<label name="dateLbl" text="Fecha" c:x="20" c:y="6"/> |
416 |
|
<label name="amountLbl" text="Monto" c:x="31" c:y="6"/> |
417 |
|
<label name="payedLbl" text="Pagado" c:x="41" c:y="6"/> |
418 |
|
<label name="payLbl" text="A Pagar" c:x="51" c:y="6"/> |
419 |
|
<entry block="invoiceToPayBlock" field="idEntry2" hidden="" rows="8" |
420 |
|
style="label" c:width="1" c:x="3" c:y="7"/> |
421 |
|
<entry block="invoiceToPayBlock" field="numberEntry1" rows="8" |
422 |
|
style="label" c:width="16" c:x="3" c:y="7"/> |
423 |
|
<entry block="invoiceToPayBlock" field="dateEntry2" rows="8" |
424 |
|
style="label" c:width="11" c:x="20" c:y="7"/> |
425 |
|
<entry block="invoiceToPayBlock" field="amountEntry1" rows="8" |
426 |
|
style="label" c:width="10" c:x="31" c:y="7"/> |
427 |
|
<entry block="invoiceToPayBlock" field="payedEntry1" rows="8" |
428 |
|
style="label" c:width="10" c:x="41" c:y="7"/> |
429 |
|
<entry block="invoiceToPayBlock" field="payEntry" rows="8" c:width="10" |
430 |
|
c:x="51" c:y="7"/> |
431 |
|
<scrollbar block="invoiceToPayBlock" c:height="8" page="2" c:width="1" |
432 |
|
c:x="61" c:y="7"/> |
433 |
|
<label name="totalLbl" text="Total a Pagar" c:x="63" c:y="10"/> |
434 |
|
<entry block="invoiceToPayBlock" field="totalEntry" c:width="10" |
435 |
|
c:x="63" c:y="11"/> |
436 |
|
<button name="acceptButton" c:height="1" label="Aceptar" c:width="10" |
437 |
|
c:x="63" c:y="13"> |
438 |
|
<trigger src="acceptTrigger" type="On-Action"/> |
439 |
|
</button> |
440 |
|
<button name="cancelButton" c:height="1" label="Cancelar" c:width="10" |
441 |
|
c:x="63" c:y="14"> |
442 |
|
<trigger src="cancelTrigger" type="On-Action"/> |
443 |
|
</button> |
444 |
|
<entry block="proceedingBlock" field="idEntry3" hidden="" c:width="12" |
445 |
|
c:x="1" c:y="1"/> |
446 |
|
<entry block="proceedingBlock" field="dateEntry3" hidden="" c:width="12" |
447 |
|
c:x="1" c:y="1"/> |
448 |
|
<entry block="alienDocumentProceedingBlock" field="proceedingEntry" |
449 |
|
hidden="" c:width="12" c:x="1" c:y="1"/> |
450 |
|
<entry block="alienDocumentProceedingBlock" field="alienDocumentEntry" |
451 |
|
hidden="" c:width="12" c:x="1" c:y="1"/> |
452 |
|
<entry block="alienDocumentProceedingBlock" field="amountEntry2" |
453 |
|
hidden="" c:width="12" c:x="1" c:y="1"/> |
454 |
|
<entry block="currencyMovementBlock" field="proceedingEntry1" hidden="" |
455 |
|
c:width="12" c:x="1" c:y="1"/> |
456 |
|
<entry block="currencyMovementBlock" field="movementTypeEntry" hidden="" |
457 |
|
c:width="12" c:x="1" c:y="1"/> |
458 |
|
<entry block="currencyMovementBlock" field="amountEntry3" hidden="" |
459 |
|
c:width="12" c:x="1" c:y="1"/> |
460 |
|
<entry block="currencyMovementBlock" field="currencyTypeEntry" hidden="" |
461 |
|
c:width="12" c:x="1" c:y="1"/> |
462 |
|
</page> |
463 |
|
</layout> |
464 |
</form> |
</form> |