376 |
|
|
377 |
# print "Cantidad de Registros: ", ownItemBlock.getRecordCount() |
# print "Cantidad de Registros: ", ownItemBlock.getRecordCount() |
378 |
# print "Leng Product Name: ", len(ownItemBlock.prodNameSEntry) |
# print "Leng Product Name: ", len(ownItemBlock.prodNameSEntry) |
379 |
|
if not str(tmpBlock.periodoIdEntry): |
380 |
|
callTrigger('adminPeriodSet') |
381 |
<neb:Block>if ($descriptive_item) {</neb:Block> |
<neb:Block>if ($descriptive_item) {</neb:Block> |
382 |
if ownItemBlock.getRecordCount() > 0 and float(str(totalBlock.netoEntry)) > 0.00: |
if ownItemBlock.getRecordCount() > 0 and float(str(totalBlock.netoEntry)) > 0.00: |
383 |
<neb:Block>} else {</neb:Block> |
<neb:Block>} else {</neb:Block> |
385 |
<neb:Block>}</neb:Block> |
<neb:Block>}</neb:Block> |
386 |
if not str(ownDocumentBlock.invoiceTypeEntry): |
if not str(ownDocumentBlock.invoiceTypeEntry): |
387 |
genericBox("Falta el tipo de comprobante",["Aceptar"]) |
genericBox("Falta el tipo de comprobante",["Aceptar"]) |
388 |
|
elif not str(tmpBlock.periodoIdEntry): |
389 |
|
genericBox("verifique que se encuentre abierto el periodo IVA correspondiente a la fecha del comprobante",["Aceptar"]) |
390 |
else: |
else: |
391 |
<neb:Block>if (!$descriptive_item) {</neb:Block> |
<neb:Block>if (!$descriptive_item) {</neb:Block> |
392 |
lRecords = ownItemDataSource.getRecords() |
lRecords = ownItemDataSource.getRecords() |
407 |
</trigger> |
</trigger> |
408 |
|
|
409 |
<trigger name="commitTrigger" type="NAMED"> |
<trigger name="commitTrigger" type="NAMED"> |
410 |
import hack |
import hack |
411 |
if not str(ivaPeriodTmpBlock.periodoIdEntry): |
|
|
genericBox("Falta definir periodo de IVA en que se registra",["Aceptar"]) |
|
|
else: |
|
412 |
ownDocumentBlock.numberEntry = str(ownPosDocumentBlock.documentNumberEntry) |
ownDocumentBlock.numberEntry = str(ownPosDocumentBlock.documentNumberEntry) |
413 |
#cargo pos |
print "imprimo y guardo" |
414 |
ownDocumentBlock.ownPosEntityIdEntry = str(ownPosBlock.ownPosEntityIdEntry) |
ownDocumentBlock.ownPosEntityIdEntry = str(ownPosBlock.ownPosEntityIdEntry) |
415 |
#/cargo pos |
#/cargo pos |
416 |
#ownDocumentBlock.dueDateEntry = str(payBlock.dateEntry) |
#ownDocumentBlock.dueDateEntry = str(payBlock.dateEntry) |
422 |
from gnue.common.GDataObjects import ConnectionError as DBError |
from gnue.common.GDataObjects import ConnectionError as DBError |
423 |
try: |
try: |
424 |
postChangeAdvance = 0 |
postChangeAdvance = 0 |
425 |
ivaPeriodBlock.periodoIdEntry = str(ivaPeriodTmpBlock.periodoIdEntry) |
ivaPeriodBlock.periodoIdEntry = str(tmpBlock.periodoIdEntry) |
426 |
ownDocumentBlock.postChanges() |
ownDocumentBlock.postChanges() |
427 |
postChangeAdvance = 1 |
postChangeAdvance = 1 |
428 |
ownPosDocumentBlock.documentNumberEntry.postAtomicModify (lambda x: int(x)+1) |
ownPosDocumentBlock.documentNumberEntry.postAtomicModify (lambda x: int(x)+1) |
436 |
#lOwnDocId = str(ownDocumentBlock.idEntry) |
#lOwnDocId = str(ownDocumentBlock.idEntry) |
437 |
#if stock by invoice |
#if stock by invoice |
438 |
|
|
439 |
<neb:Block>if ((!$descriptive_item) and $stock_alta) {</neb:Block> |
<neb:Block>if ((!$descriptive_item) and $stock_alta) {</neb:Block> |
440 |
if str(ownPosBlock.stockByInvoice) == "1": |
if str(ownPosBlock.stockByInvoice) == "1": |
441 |
#print "llamado al trigger de stock" |
#print "llamado al trigger de stock" |
442 |
callTrigger('<neb:Inline>$stock_alta</neb:Inline>') |
callTrigger('<neb:Inline>$stock_alta</neb:Inline>') |
465 |
tmpValuesDataSource.priceWithIva = 0 |
tmpValuesDataSource.priceWithIva = 0 |
466 |
tmpValuesDataSource.endDocument = 0 |
tmpValuesDataSource.endDocument = 0 |
467 |
clear() |
clear() |
|
callTrigger ('adminPeriodSet') |
|
468 |
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
469 |
|
callTrigger ('adminPeriodSet') |
470 |
#setFocus(ownDocumentBlock.clientRecipientBox.clientCodeEntry) |
#setFocus(ownDocumentBlock.clientRecipientBox.clientCodeEntry) |
471 |
</trigger> |
</trigger> |
472 |
|
|
874 |
<trigger type="PRE-FOCUSOUT" src="invoiceTypeValidation"/> |
<trigger type="PRE-FOCUSOUT" src="invoiceTypeValidation"/> |
875 |
</entry> |
</entry> |
876 |
</block> |
</block> |
877 |
|
|
878 |
|
<trigger name="adminPeriodSet" type="NAMED"> |
879 |
|
document_date = str(tmpBlock.tmpDateEntry) |
880 |
|
if document_date: |
881 |
|
adminPeriodSetResultSet = adminPeriodSetDataSource.createRawResultSet('SELECT admin_period.id,admin_period.closed from admin_period WHERE \''+document_date+'\' >= start_time AND end_time >\''+document_date+'\'') |
882 |
|
|
883 |
|
if adminPeriodSetResultSet.firstRecord(): |
884 |
|
adminPeriodId = adminPeriodSetResultSet.current.getField("id") |
885 |
|
adminPeriodClosed = adminPeriodSetResultSet.current.getField("closed") |
886 |
|
if adminPeriodClosed: |
887 |
|
genericBox("periodo de registracion de IVA cerrado",["Aceptar"]) |
888 |
|
tmpBlock.periodoIdEntry = '' |
889 |
|
else: |
890 |
|
#asigno |
891 |
|
tmpBlock.periodoIdEntry = adminPeriodId |
892 |
|
#no existe periodo |
893 |
|
else: |
894 |
|
genericBox("fecha excede los periodos de registración",["Aceptar"]) |
895 |
|
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
896 |
|
callTrigger ('adminPeriodSet') |
897 |
|
</trigger> |
898 |
|
|
899 |
<!-- Fecha del comprobante --> |
<!-- Fecha del comprobante --> |
900 |
<block name="tmpBlock" datasource="tmpValuesDataSource" transparentBlock=""> |
<block name="tmpBlock" datasource="tmpValuesDataSource" transparentBlock=""> |
901 |
<label name="dateLbl" text="Fecha" x="1" y="1" /> |
<label name="dateLbl" text="Fecha" x="1" y="1" /> |
902 |
<label name="numberLabel" text="neb:'Número de '.$document_name.':'" x="52" y="1"/> |
<label name="numberLabel" text="neb:'Número de '.$document_name.':'" x="52" y="1"/> |
903 |
<entry name="tmpDateEntry" typecast="date" |
<entry name="tmpDateEntry" typecast="date" width="14" x="7" y="1"> |
904 |
width="14" x="7" y="1"/> |
<trigger type="PRE-FOCUSOUT" src="adminPeriodSet" /> |
905 |
|
</entry> |
906 |
|
<entry name="periodoIdEntry" x="0" y="0" hidden=""/> |
907 |
</block> |
</block> |
908 |
|
|
909 |
<!-- ADMIN PERIOD --> |
<!-- ADMIN PERIOD --> |
913 |
detaillink="own_document_admin_period.own_document" master="ownDocumentDataSource" |
detaillink="own_document_admin_period.own_document" master="ownDocumentDataSource" |
914 |
masterlink="id" > |
masterlink="id" > |
915 |
</datasource> |
</datasource> |
916 |
<!-- dropdown --> |
<!-- búsqueda --> |
917 |
<datasource name="adminPeriodSetDataSource" database="papo" |
<datasource name="adminPeriodSetDataSource" database="papo"/> |
918 |
table="admin_period" order_by="id desc"> |
<block name="ivaPeriodBlock" datasource="ivaPeriodDatasource"> |
919 |
<condition> |
<entry name="periodoIdEntry" field="own_document_admin_period.admin_period" x="0" y="0" hidden=""/> </block> |
|
<and> |
|
|
<eq> |
|
|
<cfield name="admin_period.admin_period_type"/> |
|
|
<cconst value="1" /> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="admin_period.closed"/> |
|
|
<cconst value="f" /> |
|
|
</eq> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
|
<trigger name="adminPeriodSet" type="NAMED"> |
|
|
#print "adminPeriodSetTrigger" |
|
|
adminPeriodSetResultSet = adminPeriodSetDataSource.createResultSet() |
|
|
adminPeriodSetResultSet.firstRecord() |
|
|
adminPeriodId = adminPeriodSetResultSet.current.getField("admin_period.id") |
|
|
adminPeriodName = adminPeriodSetResultSet.current.getField("admin_period.name") |
|
|
#print "adminPeriodId", adminPeriodId |
|
|
#print "adminPeriodName", adminPeriodName |
|
|
#asigno |
|
|
ivaPeriodTmpBlock.periodoIdEntry = adminPeriodId |
|
|
callTrigger ('admin_periodForId') |
|
|
</trigger> |
|
920 |
|
|
|
<block name="ivaPeriodTmpBlock" datasource="tmpValuesDataSource" transparentBlock=""> |
|
|
<!-- <block name="ivaPeriodBlock" datasource="ivaPeriodDatasource"> --> |
|
|
<label name="ivaPeriodLbl" text="Periodo" x="22" y="1" /> |
|
|
<lam:box lam:boxtype="h" x="30" y="1" width="10"> |
|
|
<neb:Sub neb:src="inlineSearch.nebc" |
|
|
table="admin_period" |
|
|
search_data_source="adminPeriodSetDataSource" |
|
|
target_field="own_document_admin_period.admin_period" |
|
|
target_block="ivaPeriodTmpBlock" |
|
|
object_select_form="productClassificationSelect.gfd" |
|
|
disable_object_form="1" |
|
|
block_name="periodoBlock" |
|
|
id_entry="periodoIdEntry" |
|
|
id_field="id" |
|
|
name_entry="periodoNameEntry" |
|
|
with_history="" |
|
|
use_code ="" |
|
|
rows="1" |
|
|
/> |
|
|
</lam:box> |
|
|
</block> |
|
921 |
|
|
922 |
<block name="ivaPeriodBlock" datasource="ivaPeriodDatasource"> |
|
|
<entry name="periodoIdEntry" field="own_document_admin_period.admin_period" x="0" y="0" hidden=""/> |
|
|
</block> |
|
923 |
<!-- /ADMIN PERIOD --> |
<!-- /ADMIN PERIOD --> |
924 |
|
|
925 |
|
|