479 |
clientUID_IB_Block.newRecord() |
clientUID_IB_Block.newRecord() |
480 |
# 2 es Ingresos Brutos |
# 2 es Ingresos Brutos |
481 |
clientUID_IB_Block.uid_IB_TypeEntry = 2 |
clientUID_IB_Block.uid_IB_TypeEntry = 2 |
|
if not clientCodeBlock.getCurrentRecord().isInserted(): |
|
|
clientCodeBlock.newRecord() |
|
|
# 3 es Codigo |
|
|
clientCodeBlock.clientCodeType = 3 |
|
482 |
# clientTaxProfileBlock.newRecord() |
# clientTaxProfileBlock.newRecord() |
483 |
clientBlock.commit() |
clientBlock.commit() |
484 |
# porque esto? |
# porque esto? |
519 |
]]></trigger> |
]]></trigger> |
520 |
|
|
521 |
<trigger name="clientRollbackTrigger" type="NAMED"><![CDATA[ |
<trigger name="clientRollbackTrigger" type="NAMED"><![CDATA[ |
|
print "here-here" |
|
522 |
import hack |
import hack |
523 |
hack.rollback(clientTaxProfileBlock) |
hack.rollback(clientTaxProfileBlock) |
524 |
hack.rollback(creditLimit1Block) |
hack.rollback(creditLimit1Block) |
555 |
callTrigger('startWaitingModeTrigger') |
callTrigger('startWaitingModeTrigger') |
556 |
import gnue.common.GConditions as GConditions |
import gnue.common.GConditions as GConditions |
557 |
import string |
import string |
558 |
|
import os |
559 |
|
import tempfile |
560 |
import hack |
import hack |
561 |
import printing |
import printing |
562 |
|
|
563 |
table = [] |
table = [] |
564 |
table.append (printing.printDate ()) |
line = "<html><body><table><tbody>\n" |
565 |
line = "\n\nListado de Clientes\n\n\n" |
line += "<tr><td valign='top'>Código</td>" |
566 |
table.append(line) |
line += "<td valign='top'>Nombre</td>" |
567 |
|
line += "<td valign='top'>Dirección</td>" |
568 |
line = "| " + printing.printTitle("Codigo",14) + " | " |
line += "<td valign='top'>Teléfono</td></tr>\n" |
569 |
line += printing.printTitle("Nombre",20) + " | " |
line += "<tr><td valign='top' colspan='4'>-------------------------------------------------------------------------------</td></tr>" |
|
line += printing.printTitle("Direccion",20) + " | " |
|
|
line += printing.printTitle("Telefono",20) + " |" |
|
|
lineLen = len(line) |
|
|
table.append(line) |
|
|
|
|
|
line = "" |
|
|
for idx in range(lineLen): |
|
|
line += "-" |
|
570 |
table.append(line) |
table.append(line) |
571 |
|
|
572 |
if str(clientSearchBlock.searchCodeEntry) or str(clientSearchBlock.searchNameEntry): |
if str(clientSearchBlock.searchCodeEntry) or str(clientSearchBlock.searchNameEntry): |
623 |
telephones.append(telephoneResulSet.current.getField("address")) |
telephones.append(telephoneResulSet.current.getField("address")) |
624 |
anTelephone = telephoneResulSet.nextRecord() |
anTelephone = telephoneResulSet.nextRecord() |
625 |
|
|
626 |
line = "| " +printing.printField(clientResulSet.current.getField("_entity_uid_data.uid"),14)+ " | " |
line = "<tr><td valign='top'>" |
627 |
line += printing.printField(clientResulSet.current.getField("_entity_data.name"),20) + " | " |
preValue = clientResulSet.current.getField("_entity_uid_data.uid") |
628 |
|
if preValue: |
629 |
if addresses: |
line += preValue+"</td>" |
|
line += printing.printField(addresses.pop(),20) + " | " |
|
630 |
else: |
else: |
631 |
line += printing.printField(" ",20) + " | " |
line += "</td>" |
632 |
if telephones: |
|
633 |
line += printing.printField(telephones.pop(),20) + " |" |
line += "<td valign='top'>" |
634 |
|
preValue = clientResulSet.current.getField("_entity_data.name") |
635 |
|
if preValue: |
636 |
|
line += preValue+"</td>" |
637 |
else: |
else: |
638 |
line += printing.printField(" ",20) + " | " |
line += "</td>" |
|
table.append(line) |
|
|
|
|
|
while addresses or telephones: |
|
|
line = "| " + printing.printField(" ",14) + " | " |
|
|
line += printing.printField(" ",20) + " | " |
|
|
if addresses: |
|
|
line += printing.printField(addresses.pop(),20) + " | " |
|
|
else: |
|
|
line += printing.printField(" ",20) + " | " |
|
639 |
|
|
640 |
if telephones: |
def fillHtmlCell(cellValue): |
641 |
line += printing.printField(telephones.pop(),20) + " | " |
if cellValue: |
642 |
|
preValue = cellValue.pop() |
643 |
|
if preValue: |
644 |
|
return "<td valign='top'>"+preValue+"</td>" |
645 |
|
else: |
646 |
|
return "<td valign='top'></td>" |
647 |
else: |
else: |
648 |
line += printing.printField(" ",20) + " |" |
return "" |
649 |
|
|
650 |
|
line += fillHtmlCell(addresses) |
651 |
|
line += fillHtmlCell(telephones) |
652 |
|
line += "</tr>\n" |
653 |
|
|
654 |
|
table.append(line) |
655 |
|
|
656 |
|
while addresses or telephones: |
657 |
|
line = "<td valign='top'></td><td valign='top'></td>" |
658 |
|
line += fillHtmlCell(addresses) |
659 |
|
line += fillHtmlCell(telephones) |
660 |
|
line += "</tr>\n" |
661 |
table.append(line) |
table.append(line) |
662 |
|
|
|
more = clientResulSet.nextRecord() |
|
663 |
|
|
664 |
|
line = "<tr><td valign='top'> </td></tr>" |
665 |
|
table.append(line) |
666 |
|
|
667 |
|
more = clientResulSet.nextRecord() |
668 |
|
|
669 |
|
table.append("</tbody></table></body></html>\n") |
670 |
callTrigger('endWaitingModeTrigger') |
callTrigger('endWaitingModeTrigger') |
671 |
|
htmlFileName= tempfile.mktemp (".html") |
672 |
|
txtFileName= tempfile.mktemp (".txt") |
673 |
|
if not os.path.isfile(htmlFileName): |
674 |
|
file = os.open(htmlFileName,os.O_CREAT,0644) |
675 |
|
os.close(file) |
676 |
|
if not os.path.isfile(txtFileName): |
677 |
|
file = os.open(txtFileName,os.O_CREAT,0644) |
678 |
|
os.close(file) |
679 |
|
|
680 |
|
htmlFile = os.open(htmlFileName,os.O_WRONLY,0644) |
681 |
|
txtFile = os.open(txtFileName,os.O_WRONLY,0644) |
682 |
|
|
683 |
|
for line in table: |
684 |
|
os.write(htmlFile,line) |
685 |
|
|
686 |
|
os.write(txtFile,printing.printDate ()) # Agrega la Fecha |
687 |
|
os.write(txtFile,"\n\nListado de Clientes\n\n\n") # Agrega titulo |
688 |
|
os.system ("html2text "+htmlFileName+" >> "+txtFileName) |
689 |
|
os.remove(htmlFileName) |
690 |
|
os.close(txtFile) |
691 |
|
|
692 |
printing.previewPrint(table) |
printing.previewPrintFromFile(txtFileName) |
693 |
|
|
694 |
|
os.remove(txtFileName) |
695 |
]]></trigger> |
]]></trigger> |
696 |
|
|
697 |
<!-- /impresion --> |
<!-- /impresion --> |
1008 |
<label text="Código de cliente" |
<label text="Código de cliente" |
1009 |
x="1" y="1"/> |
x="1" y="1"/> |
1010 |
<!-- 3 es Codigo interno --> |
<!-- 3 es Codigo interno --> |
1011 |
<entry name="clientCodeType" field="_entity_uid_data.entity_uid_type" default="3" |
<entry name="clientCodeId" field="_entity_uid_data.entity_uid_type" default="3" |
1012 |
x="1" y="1" hidden="y"/> |
x="1" y="1" hidden="y"/> |
1013 |
<entry name="clientCodeEntry" field="_entity_uid_data.uid" |
<entry name="clientCodeEntry" field="_entity_uid_data.uid" |
1014 |
x="1" y="2"/> |
x="1" y="2"/> |