1072 |
|
|
1073 |
</trigger> |
</trigger> |
1074 |
|
|
1075 |
<trigger name="totalCalcShowTrigger" type="NAMED"> |
<trigger name="totalCalcShowTrigger" type="NAMED"> |
1076 |
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
1077 |
import hack |
import hack |
|
|
|
|
|
|
|
lTNeto = 0 |
|
|
lTTax = 0 |
|
|
|
|
|
sum = 0 |
|
|
lRecords = alienItemShowDataSource.getRecords() |
|
|
for index in range(len(lRecords)): |
|
|
lRecord = lRecords[index] |
|
|
lQty = hack.a2f(lRecord.getField("alien_product_item.qty"),2) |
|
|
lBonus = hack.a2f(lRecord.getField("alien_item.bonus"),2) |
|
|
lDiscount = hack.a2f(lRecord.getField("alien_item.discount"),2) |
|
|
lUnitPrice = hack.a2f(lRecord.getField("alien_product_item.unit_price"),2) |
|
|
#lTax = hack.a2f(lRecord.getField("alien_item_tax.amount")) |
|
|
|
|
|
lItemPrice = round((lQty * lUnitPrice) - lBonus - lDiscount,2) |
|
|
lTNeto += lItemPrice |
|
|
lTTax += hack.a2f(lRecord.getField("alien_item_tax.amount"),2) |
|
1078 |
|
|
1079 |
#sum += lQty * lUnitPrice + lTax - lBonus - lDiscount |
totalShowBlock.totalEntry = str(hack.a2f(totalShowBlock.netoEntry,2)+hack.a2f(totalShowBlock.ivaEntry,2)) |
1080 |
|
else: |
1081 |
totalShowBlock.netoEntry = str(round(lTNeto,2)) |
totalShowBlock.totalEntry = "0.00" |
|
totalShowBlock.ivaEntry = str(round(lTTax,2)) |
|
|
totalShowBlock.totalEntry = str(round(lTNeto+lTTax,2)) |
|
|
else: |
|
|
totalShowBlock.netoEntry = "0.00" |
|
|
totalShowBlock.ivaEntry = "0.00" |
|
|
totalShowBlock.totalEntry = "0.00" |
|
1082 |
|
|
1083 |
</trigger> |
</trigger> |
1084 |
|
|
1640 |
</entry> |
</entry> |
1641 |
<scrollbar page="5" |
<scrollbar page="5" |
1642 |
x="103" y="14" width="1" height="7"/> |
x="103" y="14" width="1" height="7"/> |
1643 |
|
|
1644 |
</block> |
</block> |
1645 |
<block datasource="nil" name="totalShowBlock"> |
<block datasource="alienDocumentShowDataSource" name="totalShowBlock"> |
1646 |
<label name="totalLbl" text="Neto" x="55" y="21"/> |
<label name="totalLbl" text="Neto" x="55" y="21"/> |
1647 |
<entry name="netoEntry" readonly="" style="label" x="55" y="22" width="12" default="0.00"/> |
<entry name="netoEntry" field="net_total" readonly="" style="label" x="55" y="22" width="12" default="0.00"/> |
1648 |
<label name="ivaLbl" text="IVA" x="65" y="21"/> |
<label name="ivaLbl" text="IVA" x="65" y="21"/> |
1649 |
<entry name="ivaEntry" readonly="" style="label" x="65" y="22" width="12" default="0.00"/> |
<entry name="ivaEntry" field="tax_total" readonly="" style="label" x="65" y="22" width="12" default="0.00"/> |
1650 |
<label name="totalLbl" text="Total" x="82" y="21"/> |
<label name="totalLbl" text="Total" x="82" y="21"/> |
1651 |
<entry name="totalEntry" readonly="" style="label" x="82" y="22" width="12" default="0.00"/> |
<entry name="totalEntry" readonly="" style="label" x="82" y="22" width="12" default="0.00"/> |
1652 |
</block> |
</block> |