28 |
client = 0 |
client = 0 |
29 |
more = rs.firstRecord() |
more = rs.firstRecord() |
30 |
while more: |
while more: |
31 |
if not currencyTypeBlock.getCurrentRecord().isEmpty(): |
if not currencyTypeBlock.getCurrentRecord().isEmpty(): |
32 |
currencyTypeBlock.newRecord() |
currencyTypeBlock.newRecord() |
33 |
currencyTypeBlock.currencyBox.idEntry = rs.current.getField("_table") |
currencyTypeBlock.currencyBox.idEntry = rs.current.getField("_table") |
34 |
currencyTypeBlock.currencyBox.nameEntry = rs.current.getField("name") |
currencyTypeBlock.currencyBox.nameEntry = rs.current.getField("name") |
40 |
more = rs.nextRecord() |
more = rs.nextRecord() |
41 |
|
|
42 |
]]></trigger> |
]]></trigger> |
43 |
|
|
44 |
|
<!-- para la parametrizaci'on: param= payBlock.cashAmountEntry (total a pagar?) //--> |
45 |
<trigger type="NAMED" name="currencyTypeTrigger"><![CDATA[ |
<trigger type="NAMED" name="currencyTypeTrigger"><![CDATA[ |
46 |
|
import hack |
47 |
|
|
48 |
import hack |
rn= currencyTypeBlock.getCurrentRecordNumber() |
|
|
|
|
payBlock = getParameter ('amount') |
|
49 |
|
|
50 |
total = hack.a2f(payBlock.cashAmountEntry,2) |
total = hack.a2f(payBlock.cashAmountEntry,2) |
51 |
rc = currencyTypeBlock.getRecordCount() |
rc = currencyTypeBlock.getRecordCount() |
52 |
for recNum in range(rc): |
for recNum in range(rc): |
53 |
currencyTypeBlock.jumpRecord(recNum) |
currencyTypeBlock.jumpRecord(recNum) |
54 |
if hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) > 0: |
if hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) > 0: |
55 |
total -= round(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
total -= round(hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
56 |
|
|
57 |
|
rc = currencyTypeBlock.getRecordCount() |
58 |
|
for recNum in range(rc): |
59 |
|
currencyTypeBlock.jumpRecord(recNum) |
60 |
|
if hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2) > 0: |
61 |
|
monto = round(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry,2),2) |
62 |
|
currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto |
63 |
|
currencyTypeBlock.jumpRecord(rn) |
64 |
|
]]></trigger> |
65 |
|
|
|
rc = currencyTypeBlock.getRecordCount() |
|
|
for recNum in range(rc): |
|
|
currencyTypeBlock.jumpRecord(recNum) |
|
|
if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0: |
|
|
monto = round(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
|
|
currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto |
|
|
|
|
|
]]></trigger> |
|
|
|
|
66 |
<trigger type="NAMED" name="endTypeCurrencyTrigger"> |
<trigger type="NAMED" name="endTypeCurrencyTrigger"> |
67 |
<![CDATA[ |
<![CDATA[ |
68 |
|
|
69 |
import hack |
import hack |
70 |
|
|
71 |
callTrigger('currencyTypeTrigger') |
callTrigger('currencyTypeTrigger') |
72 |
|
|
73 |
payBlock = getParameter ('amount') |
payBlock = getParameter ('amount') |
109 |
<page name="Determinacion de Monedas"> |
<page name="Determinacion de Monedas"> |
110 |
<block name="tmpBlock" datasource="returnDataSource"> |
<block name="tmpBlock" datasource="returnDataSource"> |
111 |
<entry name="returnEntity" hidden="" x="1" y="1" width="12"/> |
<entry name="returnEntity" hidden="" x="1" y="1" width="12"/> |
112 |
</block> |
</block> |
113 |
<block name="currencyTypeBlock" datasource="tmpCurrencyDataSource"> |
<block name="currencyTypeBlock" datasource="tmpCurrencyDataSource"> |
114 |
<box label="Monedas de Pago" name="currencyBox" |
<box label="Monedas de Pago" name="currencyBox" |
115 |
height="13" width="62" x="0" y="0"> |
height="13" width="62" x="0" y="0"> |
123 |
<entry name="formatEntry" field="format" rows="6" x="1" y="1" hidden=""/> |
<entry name="formatEntry" field="format" rows="6" x="1" y="1" hidden=""/> |
124 |
<entry name="nameEntry" field="name" style="label" rows="6" |
<entry name="nameEntry" field="name" style="label" rows="6" |
125 |
x="1" y="2" width="6" readonly=""/> |
x="1" y="2" width="6" readonly=""/> |
126 |
<entry name="rateEntry" field="rate" style="label" rows="6" typecast="number" |
<entry name="rateEntry" field="rate" style="label" rows="6" typecast="number" |
127 |
displaymask="%4.2f" x="10" y="2" width="10" readonly=""/> |
displaymask="%4.2f" x="10" y="2" width="10" readonly=""/> |
128 |
<entry name="amountEntry" field="amount" style="label" rows="6" |
<entry name="amountEntry" field="amount" style="label" rows="6" |
129 |
x="21" y="2" width="20" readonly=""/> |
x="21" y="2" width="20" readonly=""/> |
130 |
<entry name="payEntry" field="pay" rows="6" x="38" y="2" width="20" |
<entry name="payEntry" field="pay" rows="6" x="38" y="2" width="20" |
131 |
typecast="number" displaymask="%10.2f"> |
typecast="number" displaymask="%10.2f"> |
132 |
<trigger type="PRE-FOCUSOUT" src="currencyTypeTrigger"/> |
<trigger type="PRE-FOCUSOUT" src="currencyTypeTrigger"/> |
133 |
</entry> |
</entry> |