474 |
currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry) |
currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry) |
475 |
currencyMovementBlock.amountEntry = str(round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2),2)) |
currencyMovementBlock.amountEntry = str(round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2),2)) |
476 |
|
|
|
# Antes de Multimoneda |
|
|
#currencyMovementBlock.clear() |
|
|
#currencyMovementBlock.proceedingEntry = str(proceedingBlock.idEntry) |
|
|
#currencyMovementBlock.movementTypeEntry = "" # Revisar com queda esto |
|
|
#currencyMovementBlock.currencyTypeEntry = "1" |
|
|
#currencyMovementBlock.amountEntry = str(payBlock.cashEntry) |
|
|
|
|
477 |
postChangeAdvance = 3 |
postChangeAdvance = 3 |
478 |
ownDocumentProceedingBlock.postChanges() |
ownDocumentProceedingBlock.postChanges() |
479 |
postChangeAdvance = 4 |
postChangeAdvance = 4 |
485 |
if str(ownPosBlock.stockByInvoice) == "1": |
if str(ownPosBlock.stockByInvoice) == "1": |
486 |
print "llamado al trigger" |
print "llamado al trigger" |
487 |
callTrigger('stockSubstractTrigger') |
callTrigger('stockSubstractTrigger') |
488 |
#se va al stockmaintenance.nebc |
commitConnection() |
|
#ownItemToUpdBlock.initQuery() |
|
|
#ownItemToUpdBlock.ownDocumentEntry = lOwnDocId |
|
|
#print "document number",lOwnDocId |
|
|
#storehouse |
|
|
#ownItemToUpdBlock.storehouseEntry = str(ownStorehouseBlock.ownStorehouseIdEntry) |
|
|
#/storehouse |
|
|
#ownItemToUpdBlock.processQuery() |
|
|
#lRecordCount = ownItemToUpdBlock.getRecordCount() |
|
|
#for recNum in range(lRecordCount): |
|
|
# ownItemToUpdBlock.jumpRecord(recNum) |
|
|
# ownItemToUpdBlock.levelEntry.postAtomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4)) |
|
|
#ownItemToUpdBlock.clear() |
|
|
#/if stock by invoice |
|
|
#/se va al stockmaintenance.nebc |
|
|
commitConnection() |
|
489 |
except DBError, err: |
except DBError, err: |
490 |
rollbackConnection() |
rollbackConnection() |
491 |
message = ["la Factura","el número de la Factura","el procedimiento General", |
message = ["la Factura","el número de la Factura","el procedimiento General", |
557 |
lBonus = hack.a2f(lRecord.getField("own_item.bonus"),2) |
lBonus = hack.a2f(lRecord.getField("own_item.bonus"),2) |
558 |
lDiscount = hack.a2f(lRecord.getField("own_item.discount"),2) |
lDiscount = hack.a2f(lRecord.getField("own_item.discount"),2) |
559 |
lUnitPrice = hack.a2f(lRecord.getField("own_product_item.unit_price"),2) |
lUnitPrice = hack.a2f(lRecord.getField("own_product_item.unit_price"),2) |
|
#lResultSet = priceDataSource.createResultSet({"id":lRecord.getField("own_product_item.price")}) |
|
|
#if (lResultSet.firstRecord()): |
|
|
#lUnitPrice = hack.a2f(lResultSet.current.getField("unit_price")) |
|
|
#else: |
|
|
# lUnitPrice = 0 |
|
|
#print "lUnitPrice = ",lUnitPrice |
|
|
|
|
560 |
lItemPrice = round((lQty * lUnitPrice) - lBonus - lDiscount,2) |
lItemPrice = round((lQty * lUnitPrice) - lBonus - lDiscount,2) |
561 |
lTNeto += lItemPrice |
lTNeto += lItemPrice |
562 |
lTTax += hack.a2f(lRecord.getField("own_item_tax.amount"),2) |
lTTax += hack.a2f(lRecord.getField("own_item_tax.amount"),2) |
603 |
|
|
604 |
]]></trigger> |
]]></trigger> |
605 |
|
|
606 |
|
|
607 |
|
|
608 |
|
|
609 |
|
|
610 |
<trigger type="NAMED" name="currencyTypeTrigger"><![CDATA[ |
<trigger type="NAMED" name="currencyTypeTrigger"><![CDATA[ |
611 |
import hack |
import hack |
612 |
|
|
628 |
currencyTypeBlock.jumpRecord(rn) |
currencyTypeBlock.jumpRecord(rn) |
629 |
]]></trigger> |
]]></trigger> |
630 |
|
|
631 |
|
|
632 |
|
<trigger name="alertOfDespatchNoteTrigger" type="NAMED"> |
633 |
|
if str(ownDocumentBlock.relatedToEntry)and (str(totalBlock.printDespatchNote) == "1") : |
634 |
|
genericBox("Solo se incluira como relacionado el remito generado\n",['Aceptar']) |
635 |
|
</trigger> |
636 |
|
|
637 |
|
<trigger name="invoiceForDespatchNoteTrigger" type="NAMED"> |
638 |
|
print "volvi" |
639 |
|
import hack |
640 |
|
reportNo= str(ownDocumentBlock.typeEntry) |
641 |
|
print 'here: %s, %s' % (str(tmpValuesDataSource.alienIVACond), str(tmpValuesDataSource.ownIVACond)) |
642 |
|
if str(tmpValuesDataSource.alienIVACond)=='2' and str(tmpValuesDataSource.ownIVACond)=='1': |
643 |
|
# hack to use alternative report and print config |
644 |
|
reportNo= '4_and_half' |
645 |
|
report='productInvoice-%s' % reportNo |
646 |
|
print 'here: %s' % reportNo |
647 |
|
print "llamo al hack.pleasePrint" |
648 |
|
hack.pleasePrint (self, reportNo, report, [ 'id='+str(ownDocumentBlock.idEntry) ],str(ownPosDocumentBlock.documentPrintCommand)) |
649 |
|
callTrigger('rollbackTrigger') |
650 |
|
</trigger> |
651 |
|
|
652 |
|
|
653 |
|
<trigger name="makeDespatchNote" type="NAMED"> |
654 |
|
import hack |
655 |
|
print "entro al trigger" |
656 |
|
if str(totalBlock.printDespatchNote) == "1": |
657 |
|
# defino la funcion de callback |
658 |
|
def invoiceForDespatchNote (despatchNoteId,despatchNoteNumber): |
659 |
|
print "id",despatchNoteId,"number",despatchNoteNumber |
660 |
|
ownDocumentBlock.relatedToEntry = str(despatchNoteNumber).strip().rjust(8).replace(' ','0') |
661 |
|
#solo para que no ensucie el update |
662 |
|
if str(ownDocumentBlock.dueDateEntry) == "": |
663 |
|
ownDocumentBlock.dueDateEntry = None |
664 |
|
documentRelationBlock.despatchEntry = str(despatchNoteId) |
665 |
|
documentRelationBlock.invoiceEntry = str(ownDocumentBlock.idEntry) |
666 |
|
documentRelationBlock.relationTypeEntry = str(<neb:Inline>'"'.PAPO::invoiceOfDespatchNote.'"'</neb:Inline>) |
667 |
|
try: |
668 |
|
documentRelationBlock.postChanges() |
669 |
|
ownDocumentBlock.postChanges() |
670 |
|
commitConnection() |
671 |
|
except DBError, err: |
672 |
|
genericBox("Hay problemas para grabar el numero de remito\n"+str(err),['Aceptar']) |
673 |
|
callTrigger('invoiceForDespatchNoteTrigger') |
674 |
|
# fin de definicion |
675 |
|
print "llamo al otro form" |
676 |
|
runForm ('despatchNote.gfd', {'invoiceid':str(ownDocumentBlock.idEntry),'invdocblock':ownDocumentBlock,'invitemblock':ownItemBlock ,'callback': invoiceForDespatchNote }) |
677 |
|
else: |
678 |
|
print "no llamo a despatch note" |
679 |
|
</trigger> |
680 |
|
|
681 |
|
|
682 |
|
|
683 |
<trigger type="NAMED" name="endTypeCurrencyTrigger"><![CDATA[ |
<trigger type="NAMED" name="endTypeCurrencyTrigger"><![CDATA[ |
684 |
|
|
685 |
import hack |
import hack |
700 |
callTrigger('startWaitingModeTrigger') |
callTrigger('startWaitingModeTrigger') |
701 |
try: |
try: |
702 |
callTrigger ('commitTrigger') |
callTrigger ('commitTrigger') |
703 |
# it's _such_ a pitty |
if str(totalBlock.printDespatchNote) == "1": |
704 |
# pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) }) |
callTrigger('makeDespatchNote') |
705 |
reportNo= str(ownDocumentBlock.typeEntry) |
else: |
706 |
print 'here: %s, %s' % (str(tmpValuesDataSource.alienIVACond), str(tmpValuesDataSource.ownIVACond)) |
reportNo= str(ownDocumentBlock.typeEntry) |
707 |
if str(tmpValuesDataSource.alienIVACond)=='2' and str(tmpValuesDataSource.ownIVACond)=='1': |
print 'here: %s, %s' % (str(tmpValuesDataSource.alienIVACond), str(tmpValuesDataSource.ownIVACond)) |
708 |
# hack to use alternative report and print config |
if str(tmpValuesDataSource.alienIVACond)=='2' and str(tmpValuesDataSource.ownIVACond)=='1': |
709 |
reportNo= '4_and_half' |
# hack to use alternative report and print config |
710 |
report='productInvoice-%s' % reportNo |
reportNo= '4_and_half' |
711 |
print 'here: %s' % reportNo |
report='productInvoice-%s' % reportNo |
712 |
hack.pleasePrint (self, reportNo, report, [ 'id='+str(ownDocumentBlock.idEntry) ],str(ownPosDocumentBlock.documentPrintCommand)) |
print 'here: %s' % reportNo |
713 |
callTrigger('rollbackTrigger') |
hack.pleasePrint (self, reportNo, report, [ 'id='+str(ownDocumentBlock.idEntry) ],str(ownPosDocumentBlock.documentPrintCommand)) |
714 |
|
callTrigger('makeDespatchNote') |
715 |
|
callTrigger('rollbackTrigger') |
716 |
except DBError: |
except DBError: |
717 |
# just ignore, as the commit trigger already reports the error to the user |
# just ignore, as the commit trigger already reports the error to the user |
718 |
pass |
pass |
719 |
callTrigger('endWaitingModeTrigger') |
callTrigger('endWaitingModeTrigger') |
720 |
|
|
721 |
]]></trigger> |
]]></trigger> |
722 |
|
|
723 |
|
|
724 |
|
|
725 |
|
|
726 |
|
|
727 |
|
|
728 |
<trigger name="cashEntryPreFocusout" type="NAMED"> |
<trigger name="cashEntryPreFocusout" type="NAMED"> |
729 |
|
|
730 |
import hack |
import hack |
987 |
<entry field="net_total" hidden="" name="netTotalEntry" x="1" y="1"/> |
<entry field="net_total" hidden="" name="netTotalEntry" x="1" y="1"/> |
988 |
<entry field="tax_total" hidden="" name="taxTotalEntry" x="1" y="1"/> |
<entry field="tax_total" hidden="" name="taxTotalEntry" x="1" y="1"/> |
989 |
<entry field="due_date" hidden="" name="dueDateEntry" x="1" y="1"/> |
<entry field="due_date" hidden="" name="dueDateEntry" x="1" y="1"/> |
990 |
|
|
991 |
|
<label text="remitos corresp.:" x="1" y="7"/> |
992 |
|
<entry field="related_to" name="relatedToEntry" x="18" y="7" width="60" /> |
993 |
<!-- cargo pos --> |
<!-- cargo pos --> |
994 |
<entry field="own_entity" hidden="" name="ownPosEntityIdEntry" x="1" y="1"/> |
<entry field="own_entity" hidden="" name="ownPosEntityIdEntry" x="1" y="1"/> |
995 |
<!-- /cargo pos --> |
<!-- /cargo pos --> |
996 |
<entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
<entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
997 |
<box height="6" label="Datos del Cliente" name="clientRecipientBox" width="103" x="0" y="2"> |
<box height="5" label="Datos del Cliente" name="clientRecipientBox" width="103" x="0" y="2"> |
|
|
|
998 |
<label name="clientLbl" text="Cliente" x="1" y="1" /> |
<label name="clientLbl" text="Cliente" x="1" y="1" /> |
|
|
|
999 |
<entry x="1" y="1" width="30" name="currentClientEntry" hidden="" /> |
<entry x="1" y="1" width="30" name="currentClientEntry" hidden="" /> |
1000 |
<entry x="1" y="2" field="recipient" name="clientEntry" width="30" hidden=""/> |
<entry x="1" y="2" field="recipient" name="clientEntry" width="30" hidden=""/> |
1001 |
<entry x="1" y="2" name="clientCodeEntry" width="20"> |
<entry x="1" y="2" name="clientCodeEntry" width="20"> |
1012 |
<button name="clientSearchButton" trigger="clientSearchTrigger" label="Buscar" x="56" y="2" width="7" height="1"/> |
<button name="clientSearchButton" trigger="clientSearchTrigger" label="Buscar" x="56" y="2" width="7" height="1"/> |
1013 |
<button name="clientCallFormButton" trigger="clientCallFormTrigger" label="..." width="4" height="1" x="64" y="2"/> |
<button name="clientCallFormButton" trigger="clientCallFormTrigger" label="..." width="4" height="1" x="64" y="2"/> |
1014 |
|
|
1015 |
<label name="clientLbl" text="Lista de precios:" x="1" y="4" /> |
<label name="clientLbl" text="Lista de precios:" x="1" y="3" /> |
1016 |
|
|
1017 |
<entry x="19" y="4" field="recipient" name="priceTypeEntry" readonly="" |
<entry x="19" y="3" field="recipient" name="priceTypeEntry" readonly="" |
1018 |
width="20" style="textlookup" foreign_key="clientDataSource._entity_data.id" |
width="20" style="textlookup" foreign_key="clientDataSource._entity_data.id" |
1019 |
foreign_key_description="_price_type_data.name" /> |
foreign_key_description="_price_type_data.name" /> |
1020 |
|
|
1056 |
ownPosEntityIdEntry="ownPosEntityIdEntry" ownPosDocumentBlock="ownPosDocumentBlock" |
ownPosEntityIdEntry="ownPosEntityIdEntry" ownPosDocumentBlock="ownPosDocumentBlock" |
1057 |
documentNumberEntry="documentNumberEntry" documentNumberEntryX="55" documentNumberEntryY="1" |
documentNumberEntry="documentNumberEntry" documentNumberEntryX="55" documentNumberEntryY="1" |
1058 |
searchNextDocumentNumber="searchNextInvoiceNumber" |
searchNextDocumentNumber="searchNextInvoiceNumber" |
1059 |
ownStorehouseBlock ="ownStorehouseBlock" ownStorehouseIdEntry="ownStorehouseIdEntry" > |
ownStorehouseBlock ="ownStorehouseBlock" ownStorehouseIdEntry="ownStorehouseIdEntry" /> |
1060 |
</neb:Sub> |
<neb:Sub neb:src="documentRelation.nebc" documentRelationBlock="documentRelationBlock" despatchEntry="despatchEntry" invoiceEntry="invoiceEntry" /> |
1061 |
|
|
1062 |
</box> |
</box> |
1063 |
|
|
1342 |
<entry name="ivaEntry" style="label" readonly="" x="66" y="22" width="12" typecast="number" displaymask="%0.2f" |
<entry name="ivaEntry" style="label" readonly="" x="66" y="22" width="12" typecast="number" displaymask="%0.2f" |
1343 |
default="0.00"/> |
default="0.00"/> |
1344 |
<label text="Total " x="82" y="21"/> |
<label text="Total " x="82" y="21"/> |
1345 |
<entry name="totalEntry" style="label" readonly="" x="82" y="22" width="12" typecast="number" displaymask="%0.2f" |
<entry name="totalEntry" style="label" readonly="" x="82" y="22" width="12" typecast="number" displaymask="%0.2f" default="0.00"/> |
1346 |
default="0.00"/> |
<label text="emitir remito" x="38" y="22" /> |
1347 |
|
<entry name="printDespatchNote" x="51" y="22" style="checkbox"> |
1348 |
|
<trigger type="PRE-FOCUSOUT" src="alertOfDespatchNoteTrigger"/> |
1349 |
|
</entry> |
1350 |
</block> |
</block> |
1351 |
<neb:Sub neb:src="setStock.nebc" ownDocumentId="ownDocumentBlock.idEntry" storehouseEntityId="ownStorehouseBlock.ownStorehouseIdEntry" |
<neb:Sub neb:src="setStock.nebc" ownDocumentId="ownDocumentBlock.idEntry" storehouseEntityId="ownStorehouseBlock.ownStorehouseIdEntry" |
1352 |
stockAddTrigger="stockAddTrigger" stockSubstractTrigger="stockSubstractTrigger"/> |
stockAddTrigger="stockAddTrigger" stockSubstractTrigger="stockSubstractTrigger"/> |
|
|
|
|
<!-- se va a stockMaintenance.neb --> |
|
|
<!-- <block datasource="ownItemToUpdDataSource" name="ownItemToUpdBlock"> --> |
|
|
<!-- <entry name="ownDocumentEntry" field="own_item.own_document" hidden="" x="1" y="109" width="10"/> --> |
|
|
<!-- <entry name="prodIdEntry" field="_price_data.product" hidden="" x="11" y="109" width="10"/> --> |
|
|
<!-- <entry name="qtyEntry" field="own_product_item.qty" hidden="" x="22" y="109" width="10"/> --> |
|
|
<!-- <entry name="levelEntry" field="_product_store_data.level" hidden="" x="33" y="109" width="10"/> --> |
|
|
<!-- <entry name="productEntry" field="_product_store_data.product" hidden="" x="33" y="109" width="10"/> --> |
|
|
<!-- <entry name="storehouseEntry" field="_product_store_data.storehouse" hidden="" x="33" y="109" width="10"/> --> |
|
|
<!-- <entry name="hiwaterEntry" field="_product_store_data.hiwater" hidden="" x="33" y="109" width="10"/> --> |
|
|
<!-- <entry name="lowaterEntry" field="_product_store_data.lowater" hidden="" x="33" y="109" width="10"/> --> |
|
|
<!-- <entry name="tableEntry" field="_product_store_data._table" hidden="" x="33" y="109" width="10"/> --> |
|
|
<!-- </block> --> |
|
|
<!-- /se va a stockMaintenance.neb --> |
|
1353 |
<block datasource="creditLimit1DataSource" name="creditLimit1Block"> |
<block datasource="creditLimit1DataSource" name="creditLimit1Block"> |
1354 |
<entry name="entityEntry" field="_credit_limit_data.entity" hidden="" x="11" y="109" width="10"/> |
<entry name="entityEntry" field="_credit_limit_data.entity" hidden="" x="11" y="109" width="10"/> |
1355 |
<entry name="movementTypeEntry" field="_credit_limit_data.movement_type" hidden="" x="1" y="109" width="10"/> |
<entry name="movementTypeEntry" field="_credit_limit_data.movement_type" hidden="" x="1" y="109" width="10"/> |
1356 |
<entry name="creditLimitAmountEntry" field="_credit_limit_data.credit_limit" hidden="" x="1" y="109" width="10"/> |
<entry name="creditLimitAmountEntry" field="_credit_limit_data.credit_limit" hidden="" x="1" y="109" width="10"/> |
1357 |
<entry name="balanceEntry" field="_credit_limit_data.balance" hidden="" x="22" y="109" width="10"/> |
<entry name="balanceEntry" field="_credit_limit_data.balance" hidden="" x="22" y="109" width="10"/> |
1358 |
<entry name="timeStampEntry" field="_credit_limit_data.time_stamp" hidden="" x="33" y="109" width="10"/> |
<entry name="timeStampEntry" field="_credit_limit_data.time_stamp" hidden="" x="33" y="109" width="10"/> |
1359 |
|
|
1360 |
<!-- Estos 2 botones estaba antes en el box cobro de facura --> |
<!-- Estos 2 botones estaba antes en el box cobro de facura --> |
1361 |
<button name="printButton" label="Doc. Terminado" trigger="invoiceOkTrigger" |
<button name="printButton" label="Doc. Terminado" trigger="invoiceOkTrigger" |
1362 |
x="1" y="22" width="16" height="1"/> |
x="1" y="22" width="16" height="1"/> |
1363 |
<button x="18" y="22" trigger="rollbackTrigger" width="18" label="Cancelar" |
<button x="18" y="22" trigger="rollbackTrigger" width="18" label="Cancelar" |
1449 |
</box> |
</box> |
1450 |
</block> |
</block> |
1451 |
</page> |
</page> |
|
|
|
1452 |
</form> |
</form> |