21 |
import hack |
import hack |
22 |
|
|
23 |
payBlock = getParameter ('amount') |
payBlock = getParameter ('amount') |
24 |
if hack.a2f(payBlock.cashAmountEntry) > 0: |
if hack.a2f(payBlock.cashAmountEntry,2) > 0: |
25 |
currencyTypeBlock.clear() |
currencyTypeBlock.clear() |
26 |
|
|
27 |
rs = currencyTypeDataSource.createResultSet() |
rs = currencyTypeDataSource.createResultSet() |
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") |
35 |
currencyTypeBlock.currencyBox.rateEntry = hack.a2f(rs.current.getField("rate")) |
currencyTypeBlock.currencyBox.rateEntry = hack.a2f(rs.current.getField("rate"),2) |
36 |
monto = hack.a2f(hack.a2f(payBlock.cashAmountEntry) / hack.a2f(rs.current.getField("rate")),2) |
monto = round(hack.a2f(payBlock.cashAmountEntry,2) / hack.a2f(rs.current.getField("rate"),2),2) |
37 |
currencyTypeBlock.currencyBox.formatEntry = rs.current.getField("format") |
currencyTypeBlock.currencyBox.formatEntry = rs.current.getField("format") |
38 |
currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto |
currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto |
39 |
currencyTypeBlock.currencyBox.payEntry = 0.0 |
currencyTypeBlock.currencyBox.payEntry = 0.0 |
47 |
|
|
48 |
payBlock = getParameter ('amount') |
payBlock = getParameter ('amount') |
49 |
|
|
50 |
total = hack.a2f(payBlock.cashAmountEntry) |
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) > 0: |
if hack.a2f(currencyTypeBlock.currencyBox.payEntry,2) > 0: |
55 |
total -= hack.a2f(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
total -= round(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
56 |
|
|
57 |
rc = currencyTypeBlock.getRecordCount() |
rc = currencyTypeBlock.getRecordCount() |
58 |
for recNum in range(rc): |
for recNum in range(rc): |
59 |
currencyTypeBlock.jumpRecord(recNum) |
currencyTypeBlock.jumpRecord(recNum) |
60 |
if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0: |
if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0: |
61 |
monto = hack.a2f(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
monto = round(total / hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
62 |
currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto |
currencyTypeBlock.currencyBox.amountEntry = str(currencyTypeBlock.currencyBox.formatEntry) % monto |
63 |
|
|
64 |
]]></trigger> |
]]></trigger> |
72 |
|
|
73 |
payBlock = getParameter ('amount') |
payBlock = getParameter ('amount') |
74 |
|
|
75 |
total = hack.a2f(payBlock.cashAmountEntry) |
total = hack.a2f(payBlock.cashAmountEntry,2) |
76 |
rc = currencyTypeBlock.getRecordCount() |
rc = currencyTypeBlock.getRecordCount() |
77 |
for recNum in range(rc): |
for recNum in range(rc): |
78 |
currencyTypeBlock.jumpRecord(recNum) |
currencyTypeBlock.jumpRecord(recNum) |
79 |
if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0: |
if hack.a2f(currencyTypeBlock.currencyBox.rateEntry) > 0: |
80 |
total -= hack.a2f(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
total -= round(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2) |
81 |
|
|
82 |
if total != 0: |
if total != 0: |
83 |
genericBox("El los montos no completan el total del documento\n",['Aceptar']) |
genericBox("El los montos no completan el total del documento\n",['Aceptar']) |
90 |
if not currencyMovementBlock.getCurrentRecord().isEmpty(): |
if not currencyMovementBlock.getCurrentRecord().isEmpty(): |
91 |
currencyMovementBlock.newRecord() |
currencyMovementBlock.newRecord() |
92 |
currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry) |
currencyMovementBlock.currencyTypeEntry = str(currencyTypeBlock.currencyBox.idEntry) |
93 |
currencyMovementBlock.amountEntry = str(hack.a2f(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2)) |
currencyMovementBlock.amountEntry = str(round(hack.a2f(currencyTypeBlock.currencyBox.payEntry) * hack.a2f(currencyTypeBlock.currencyBox.rateEntry),2)) |
94 |
tmpBlock.returnEntity = str(1) |
tmpBlock.returnEntity = str(1) |
95 |
exit() |
exit() |
96 |
]]> |
]]> |