6 |
<!-- end_timestamp (timestamp) --> |
<!-- end_timestamp (timestamp) --> |
7 |
<!-- observations (text) --> |
<!-- observations (text) --> |
8 |
|
|
9 |
<form tabbed="top" width="84" height="17" title="Carga de Facturas de Proveedores"> |
<form tabbed="top" width="85" height="21" title="Carga de Facturas de Proveedores"> |
10 |
|
|
11 |
<datasource name="nil" cache="1"/> |
<datasource name="nil" cache="1"/> |
12 |
|
<datasource name="payDataSource" cache="1"/> |
13 |
<datasource name="tmpSearchDataSource" cache="1"/> |
<datasource name="tmpSearchDataSource" cache="1"/> |
14 |
|
|
15 |
|
<!-- Origen de datos que sirve para dar de alta procedimientos de pago (en este caso de la factura) --> |
16 |
|
<datasource name="proceedingDataSource" database="papo" table="proceeding"/> |
17 |
|
|
18 |
|
<!-- Origen de datos que sirve para dar de alta pagos con algun tipo de currency --> |
19 |
|
<datasource name="alienDocumentProceedingDataSource" database="papo" table="alien_document_proceeding"/> |
20 |
|
|
21 |
|
<!-- Origen de datos que sirve para dar de alta pagos con algun tipo de currency --> |
22 |
|
<datasource name="currencyMovementDataSource" database="papo" |
23 |
|
table="movement, currency_movement"> |
24 |
|
<condition> |
25 |
|
<eq> |
26 |
|
<cfield name="movement.id"/> |
27 |
|
<cfield name="currency_movement.movement"/> |
28 |
|
</eq> |
29 |
|
</condition> |
30 |
|
</datasource> |
31 |
|
|
32 |
<datasource name="contactDataSource" database="papo" |
<datasource name="contactDataSource" database="papo" |
33 |
table="entity, _entity_data, alien_entity, _alien_entity_data,contact, _contact_data" |
table="entity, _entity_data, alien_entity, _alien_entity_data,contact, _contact_data" |
34 |
order_by="_entity_data.name"> |
order_by="_entity_data.name"> |
219 |
|
|
220 |
<datasource database="papo" detaillink="alien_item.alien_document" |
<datasource database="papo" detaillink="alien_item.alien_document" |
221 |
master="alienDocumentDataSource" masterlink="id" name="alienItemDataSource" |
master="alienDocumentDataSource" masterlink="id" name="alienItemDataSource" |
222 |
table="alien_item, alien_product_item"> |
table="alien_item, alien_product_item, alien_item_tax"> |
223 |
<condition> |
<condition> |
224 |
<and> |
<and> |
225 |
<eq> |
<eq> |
226 |
<cfield name="alien_item.id"/> |
<cfield name="alien_item.id"/> |
227 |
<cfield name="alien_product_item.alien_item"/> |
<cfield name="alien_product_item.alien_item"/> |
228 |
</eq> |
</eq> |
229 |
|
<eq> |
230 |
|
<cfield name="alien_item.id"/> |
231 |
|
<cfield name="alien_item_tax.alien_item"/> |
232 |
|
</eq> |
233 |
|
<eq> |
234 |
|
<cfield name="alien_item_tax.tax"/> |
235 |
|
<cconst value="1"/> |
236 |
|
</eq> |
237 |
</and> |
</and> |
238 |
</condition> |
</condition> |
239 |
</datasource> |
</datasource> |
262 |
</trigger> |
</trigger> |
263 |
|
|
264 |
<trigger name="commitTrigger" type="NAMED"> |
<trigger name="commitTrigger" type="NAMED"> |
265 |
if alienItemBlock.getRecordCount() > 0 and len(alienItemBlock.qtyEntry) > 0: |
if not str(alienDocumentBlock.numberEntry): |
266 |
alienDocumentBlock.commit() |
genericBox("Falta el número del comprobante",["Ok"]) |
267 |
lAlienDocId = str(alienDocumentBlock.idEntry) |
elif not str(alienDocumentBlock.dateEntry): |
268 |
setFocus(alienDocumentBlock.dateEntry) |
genericBox("Falta la fecha del comprobante",["Ok"]) |
269 |
alienItemToUpdBlock.initQuery() |
else: |
270 |
alienItemToUpdBlock.alienDocumentToUpdEntry = lAlienDocId |
if alienItemBlock.getRecordCount() > 0 and len(alienItemBlock.qtyEntry) > 0 and len(alienItemBlock.productEntry) > 0: |
271 |
alienItemToUpdBlock.processQuery() |
proceedingBlock.processRollback() |
272 |
lRecordCount = alienItemToUpdBlock.getRecordCount() |
proceedingBlock.idEntry.autofillBySequence('proceeding_id_seq') |
273 |
for recNum in range(lRecordCount): |
proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp() |
274 |
|
|
275 |
|
alienDocumentBlock.idEntry.autofillBySequence('alien_document_id_seq') |
276 |
|
alienDocumentBlock.typeEntry = "2" |
277 |
|
|
278 |
|
alienDocumentProceedingBlock.processRollback() |
279 |
|
alienDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry) |
280 |
|
alienDocumentProceedingBlock.alienDocumentEntry = str(alienDocumentBlock.idEntry) |
281 |
|
alienDocumentProceedingBlock.amountEntry = str(payBlock.cashEntry) |
282 |
|
|
283 |
|
currencyMovementBlock.processRollback() |
284 |
|
currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry) |
285 |
|
currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto |
286 |
|
currencyMovementBlock.currencyTypeEntry = "1" |
287 |
|
currencyMovementBlock.amountEntry = str(payBlock.cashEntry) |
288 |
|
|
289 |
|
|
290 |
|
alienDocumentBlock.commit() |
291 |
|
lAlienDocId = str(alienDocumentBlock.idEntry) |
292 |
|
setFocus(alienDocumentBlock.dateEntry) |
293 |
|
alienItemToUpdBlock.initQuery() |
294 |
|
alienItemToUpdBlock.alienDocumentToUpdEntry = lAlienDocId |
295 |
|
alienItemToUpdBlock.processQuery() |
296 |
|
lRecordCount = alienItemToUpdBlock.getRecordCount() |
297 |
|
for recNum in range(lRecordCount): |
298 |
alienItemToUpdBlock.jumpRecord(recNum) |
alienItemToUpdBlock.jumpRecord(recNum) |
299 |
alienItemToUpdBlock.levelEntry.atomicModify(lambda x:x+round(float(str(alienItemToUpdBlock.qtyEntry)),4)) |
alienItemToUpdBlock.levelEntry.atomicModify(lambda x:x+round(float(str(alienItemToUpdBlock.qtyEntry)),4)) |
300 |
alienItemToUpdBlock.processRollback() |
alienItemToUpdBlock.processRollback() |
301 |
else: |
else: |
302 |
alienDocumentBlock.processRollback() |
alienDocumentBlock.processRollback() |
303 |
|
|
304 |
alienDocumentBlock.processRollback() |
callTrigger('rollbackTrigger') |
305 |
alienItemBlock.processRollback() |
alienDocumentBlock.newRecord() |
306 |
resultBlock.processRollback() |
totalBlock.totalEntry = "" |
307 |
alienDocumentBlock.newRecord() |
payBlock.cashEntry = "" |
308 |
totalBlock.total = "" |
payBlock.ctaCteEntry = "" |
309 |
</trigger> |
</trigger> |
310 |
|
|
311 |
<trigger name="rollbackTrigger" type="NAMED"> |
<trigger name="rollbackTrigger" type="NAMED"> |
312 |
|
proceedingBlock.processRollback() |
313 |
alienDocumentBlock.processRollback() |
alienDocumentBlock.processRollback() |
314 |
totalBlock.total = "" |
alienItemBlock.processRollback() |
315 |
|
currencyMovementBlock.processRollback() |
316 |
|
alienDocumentProceedingBlock.processRollback() |
317 |
|
|
318 |
|
totalBlock.totalEntry = "" |
319 |
|
payBlock.cashEntry = "" |
320 |
|
payBlock.ctaCteEntry = "" |
321 |
</trigger> |
</trigger> |
322 |
|
|
323 |
<trigger name="deleteTrigger" type="NAMED"> |
<trigger name="deleteTrigger" type="NAMED"> |
339 |
alienDocumentBlock.commit() |
alienDocumentBlock.commit() |
340 |
alienDocumentBlock.processRollback() |
alienDocumentBlock.processRollback() |
341 |
|
|
342 |
totalBlock.total = "" |
totalBlock.totalEntry = "" |
343 |
|
payBlock.cashEntry = "" |
344 |
|
payBlock.ctaCteEntry = "" |
345 |
</trigger> |
</trigger> |
346 |
|
|
347 |
<trigger name="quitTrigger" type="NAMED"> |
<trigger name="quitTrigger" type="NAMED"> |
360 |
lBonus = hack.a2f(lRecord.getField("alien_item.bonus")) |
lBonus = hack.a2f(lRecord.getField("alien_item.bonus")) |
361 |
lDiscount = hack.a2f(lRecord.getField("alien_item.discount")) |
lDiscount = hack.a2f(lRecord.getField("alien_item.discount")) |
362 |
lUnitPrice = hack.a2f(lRecord.getField("alien_product_item.unit_price")) |
lUnitPrice = hack.a2f(lRecord.getField("alien_product_item.unit_price")) |
363 |
sum = sum + (lQty * lUnitPrice) - lBonus - lDiscount |
lTax = hack.a2f(lRecord.getField("alien_item_tax.amount")) |
364 |
totalBlock.total = str(sum) |
sum = sum + (lQty * lUnitPrice * (1+lTax/100)) - lBonus - lDiscount |
365 |
|
totalBlock.totalEntry = str(sum) |
366 |
|
payBlock.cashEntry = str(sum) |
367 |
|
payBlock.ctaCteEntry = "" |
368 |
</trigger> |
</trigger> |
369 |
|
|
370 |
<trigger name="newSearchTrigger" type="NAMED"> |
<trigger name="newSearchTrigger" type="NAMED"> |
395 |
alienDocumentBlock.processQuery() |
alienDocumentBlock.processQuery() |
396 |
</trigger> |
</trigger> |
397 |
|
|
398 |
|
<trigger name="providerTrigger" type="NAMED"> |
399 |
|
runForm('provider.gfd') |
400 |
|
</trigger> |
401 |
|
|
402 |
|
<trigger name="productTrigger" type="NAMED"> |
403 |
|
runForm('product.gfd') |
404 |
|
</trigger> |
405 |
|
|
406 |
<page name="Búsqueda de Facturas de Proveedor"> |
<page name="Búsqueda de Facturas de Proveedor"> |
407 |
<trigger type="Pre-Focusout" src="resultFocusOutTrigger"/> |
<trigger type="Pre-Focusout" src="resultFocusOutTrigger"/> |
408 |
<box height="10" label="Factura de Productos de Proveedor" |
<box height="10" label="Factura de Productos de Proveedor" |
453 |
</block> |
</block> |
454 |
</box> |
</box> |
455 |
|
|
456 |
<box height="11" label="Facturas encontradas" name="searchResultBox" |
<box height="14" label="Facturas encontradas" name="searchResultBox" |
457 |
width="82" x="0" y="9"> |
width="82" x="0" y="9"> |
458 |
<block datasource="resultAlienDocumentDataSource" name="resultBlock"> |
<block datasource="resultAlienDocumentDataSource" name="resultBlock"> |
459 |
|
|
485 |
|
|
486 |
|
|
487 |
<label name="resNumberLbl" text="Número" x="1" y="1" /> |
<label name="resNumberLbl" text="Número" x="1" y="1" /> |
488 |
<entry field="number" name="resNumberEntry" width="20" x="1" y="2" rows="4"/> |
<entry field="number" name="resNumberEntry" width="20" x="1" y="2" rows="9"/> |
489 |
<label name="resDateLbl" text="Fecha" x="22" y="1" /> |
<label name="resDateLbl" text="Fecha" x="22" y="1" /> |
490 |
<entry field="date" name="resDateEntry" typecast="date" width="22" x="22" y="2" rows="4"/> |
<entry field="date" name="resDateEntry" typecast="date" width="22" x="22" y="2" rows="9"/> |
491 |
|
<scrollbar page="5" |
492 |
|
x="45" y="2" width="1" height="9"/> |
493 |
|
|
494 |
</block> |
</block> |
495 |
</box> |
</box> |
496 |
</page> |
</page> |
497 |
|
|
498 |
|
<!-- Página de carga de facturas --> |
499 |
<page name="Factura de Proveedor"> |
<page name="Factura de Proveedor"> |
500 |
<trigger type="PRE-FOCUSIN" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSIN" src="totalCalcTrigger" /> |
501 |
<box height="10" label="Factura de Productos de Proveedor" |
<box height="10" label="Factura de Productos de Proveedor" |
502 |
name="invoiceHeaderBox" width="82" x="0" y="0"> |
name="invoiceHeaderBox" width="82" x="0" y="0"> |
503 |
|
|
504 |
<block datasource="alienDocumentDataSource" name="alienDocumentBlock" restrictInsert=""> |
<!-- Estos bloques son para la gestion del pago de la factura --> |
505 |
<trigger name="t" type="Pre-Insert"> |
<block name="proceedingBlock" datasource="proceedingDataSource" transparentBlock=""> |
506 |
alienDocumentBlock.idEntry.autofillBySequence('alien_document_id_seq') |
<entry name="idEntry" field="id" hidden="" x="1" y="1" width="12"/> |
507 |
alienDocumentBlock.typeEntry = "2" |
<entry name="dateEntry" field="date" hidden="" x="1" y="1" width="12"/> |
508 |
</trigger> |
</block> |
509 |
|
<block datasource="alienDocumentDataSource" name="alienDocumentBlock" > |
510 |
|
<!-- <trigger name="t" type="Pre-Insert"> --> |
511 |
|
<!-- alienDocumentBlock.idEntry.autofillBySequence('alien_document_id_seq') --> |
512 |
|
<!-- alienDocumentBlock.typeEntry = "2" --> |
513 |
|
<!-- </trigger> --> |
514 |
|
|
515 |
<entry field="id" hidden="" name="idEntry" x="1" y="1"/> |
<entry field="id" hidden="" name="idEntry" x="1" y="1"/> |
516 |
<entry field="alien_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
<entry field="alien_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
527 |
foreign_key_description="_entity_data.name" > |
foreign_key_description="_entity_data.name" > |
528 |
</entry> |
</entry> |
529 |
|
|
530 |
|
<button x="53" y="2" trigger="providerTrigger" width="3" label="..." |
531 |
|
name="providerBtn" height="1"/> |
532 |
|
|
533 |
<label name="salesPersonLbl" text="Vendedor" x="1" y="3" /> |
<label name="salesPersonLbl" text="Vendedor" x="1" y="3" /> |
534 |
<entry x="1" y="4" field="alien_document.salesperson" name="salesPersonEntry" |
<entry x="1" y="4" field="alien_document.salesperson" name="salesPersonEntry" |
535 |
width="25" style="dropdown" foreign_key="contactDataSource.entity.id" |
width="25" style="dropdown" foreign_key="contactDataSource.entity.id" |
574 |
<entry field="alien_item.alien_document" name="alienDocumentEntry" hidden="" x="1" y="1"/> |
<entry field="alien_item.alien_document" name="alienDocumentEntry" hidden="" x="1" y="1"/> |
575 |
|
|
576 |
<label name="qtyLbl" text="Cantidad" x="2" y="1"/> |
<label name="qtyLbl" text="Cantidad" x="2" y="1"/> |
577 |
<entry field="alien_product_item.qty" value="0" name="qtyEntry" rows="5" typecast="number" width="12" x="2" y="2"> |
<entry field="alien_product_item.qty" value="0" name="qtyEntry" rows="5" typecast="number" width="12" x="2" y="2" |
578 |
|
default="1"> |
579 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
580 |
</entry> |
</entry> |
581 |
<label name="productLbl" text="Producto" x="15" y="1"/> |
<label name="productLbl" text="Producto" x="15" y="1"/> |
582 |
|
<button x="32" y="1" trigger="productTrigger" width="3" label="..." |
583 |
|
name="productBtn" height="1"/> |
584 |
|
|
585 |
<entry x="15" y="2" field="alien_product_item.product" name="productEntry" |
<entry x="15" y="2" field="alien_product_item.product" name="productEntry" |
586 |
width="20" rows="5" style="dropdown" foreign_key="productDataSource.id" |
width="20" rows="5" style="dropdown" foreign_key="productDataSource.id" |
587 |
foreign_key_description="canonical_name"> |
foreign_key_description="canonical_name"> |
592 |
width="10" rows="5"> |
width="10" rows="5"> |
593 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
594 |
</entry> |
</entry> |
595 |
<label name="discountLbl" text="Descuento" x="47" y="1"/> |
<label name="taxLbl" text="IVA" x="47" y="1" /> |
596 |
|
<entry x="47" y="2" readonly="" field="alien_item_tax.amount" name="taxAmountEntry" width="5" rows="5" default="21"/> |
597 |
|
<entry x="47" y="2" readonly="" field="alien_item_tax.tax" name="taxTypeEntry" width="5" rows="5" default="1" hidden=""/> |
598 |
|
<label name="discountLbl" text="Descuento" x="53" y="1"/> |
599 |
<entry field="alien_item.discount" name="discountEntry" value="0" typecast="number" |
<entry field="alien_item.discount" name="discountEntry" value="0" typecast="number" |
600 |
rows="5" width="12" x="47" y="2"> |
rows="5" width="12" x="53" y="2" default="0"> |
601 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
602 |
</entry> |
</entry> |
603 |
<label name="bonusLbl" text="Bonificación" x="60" y="1"/> |
<label name="bonusLbl" text="Bonificación" x="66" y="1"/> |
604 |
<entry field="alien_item.bonus" name="bonusEntry" value="0" typecast="number" |
<entry field="alien_item.bonus" name="bonusEntry" value="0" typecast="number" |
605 |
rows="5" width="12" x="60" y="2"> |
rows="5" width="12" x="66" y="2" default="0"> |
606 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
607 |
</entry> |
</entry> |
608 |
<scrollbar page="5" |
<scrollbar page="5" |
609 |
x="73" y="2" width="1" height="5"/> |
x="79" y="2" width="1" height="5"/> |
610 |
</block> |
</block> |
611 |
<block datasource="nil" name="totalBlock"> |
<block datasource="nil" name="totalBlock"> |
612 |
<label name="totalLbl" text="Total" x="29" y="8"/> |
<label name="totalLbl" text="Total" x="29" y="8"/> |
613 |
<entry name="total" readonly="" x="36" y="8" width="12"/> |
<entry name="totalEntry" readonly="" x="36" y="8" width="12"/> |
614 |
</block> |
</block> |
615 |
<block datasource="alienItemDataSourceToUpd" name="alienItemToUpdBlock"> |
<block datasource="alienItemDataSourceToUpd" name="alienItemToUpdBlock"> |
616 |
<entry name="alienDocumentToUpdEntry" field="alien_item.alien_document" hidden="" x="1" y="109" width="10"/> |
<entry name="alienDocumentToUpdEntry" field="alien_item.alien_document" hidden="" x="1" y="109" width="10"/> |
623 |
<entry name="lowaterEntry" field="_product_store_data.lowater" hidden="" x="33" y="109" width="10"/> |
<entry name="lowaterEntry" field="_product_store_data.lowater" hidden="" x="33" y="109" width="10"/> |
624 |
<entry name="tableEntry" field="_product_store_data._table" hidden="" x="33" y="109" width="10"/> |
<entry name="tableEntry" field="_product_store_data._table" hidden="" x="33" y="109" width="10"/> |
625 |
</block> |
</block> |
626 |
|
<!-- Bloques que sirven para el pago --> |
627 |
|
<block name="alienDocumentProceedingBlock" datasource="alienDocumentProceedingDataSource" transparentBlock=""> |
628 |
|
<entry name="proceedingEntry" field="proceeding" hidden="" x="1" y="1" width="12"/> |
629 |
|
<entry name="alienDocumentEntry" field="alien_document" hidden="" x="1" y="1" width="12"/> |
630 |
|
<entry name="amountEntry" field="amount" hidden="" x="1" y="1" width="12"/> |
631 |
|
</block> |
632 |
|
<block name="currencyMovementBlock" datasource="currencyMovementDataSource" transparentBlock=""> |
633 |
|
<entry name="proceedingEntry" field="movement.proceeding" hidden="" x="1" y="1" width="12"/> |
634 |
|
<entry name="movementTypeEntry" field="movement.movement_type" hidden="" x="1" y="1" width="12"/> |
635 |
|
<entry name="amountEntry" field="movement.amount" hidden="" x="1" y="1" width="12"/> |
636 |
|
<entry name="currencyTypeEntry" field="currency_movement.currency_type" hidden="" x="1" y="1" width="12"/> |
637 |
|
</block> |
638 |
|
</box> |
639 |
|
<box height="4" label="Pago de la factura" name="payBox" |
640 |
|
width="82" x="0" y="19"> |
641 |
|
<block datasource="payDataSource" name="payBlock"> |
642 |
|
<label text="Efectivo : " x="1" y="1"/> |
643 |
|
<entry name="cashEntry" x="11" y="1" width="12"> |
644 |
|
<trigger type="Pre-Focusout"> |
645 |
|
import hack |
646 |
|
payBlock.ctaCteEntry = str(hack.a2f(totalBlock.totalEntry) - hack.a2f(payBlock.cashEntry)) |
647 |
|
</trigger> |
648 |
|
</entry> |
649 |
|
<label text="Cta. Cte. : " x="24" y="1"/> |
650 |
|
<entry name="ctaCteEntry" x="36" y="1" width="12"> |
651 |
|
<trigger type="Pre-Focusout"> |
652 |
|
import hack |
653 |
|
payBlock.cashEntry = str(hack.a2f(totalBlock.totalEntry) - hack.a2f(payBlock.ctaCteEntry)) |
654 |
|
</trigger> |
655 |
|
</entry> |
656 |
|
</block> |
657 |
</box> |
</box> |
658 |
</page> |
</page> |
659 |
</form> |
</form> |