984 |
<trigger name="totalCalcShowTrigger" type="NAMED"> |
<trigger name="totalCalcShowTrigger" type="NAMED"> |
985 |
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty(): |
986 |
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")) |
|
|
lBonus = hack.a2f(lRecord.getField("alien_item.bonus")) |
|
|
lDiscount = hack.a2f(lRecord.getField("alien_item.discount")) |
|
|
lUnitPrice = hack.a2f(lRecord.getField("alien_product_item.unit_price")) |
|
|
#lTax = hack.a2f(lRecord.getField("alien_item_tax.amount")) |
|
|
|
|
|
lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount |
|
|
lTNeto += lItemPrice |
|
|
lTTax += hack.a2f(lRecord.getField("alien_item_tax.amount")) |
|
|
|
|
|
#sum += lQty * lUnitPrice + lTax - lBonus - lDiscount |
|
987 |
|
|
988 |
totalShowBlock.netoEntry = str(lTNeto) |
totalShowBlock.totalEntry = str(hack.a2f(totalShowBlock.netoEntry,2)+hack.a2f(totalShowBlock.ivaEntry,2)) |
|
totalShowBlock.ivaEntry = str(lTTax) |
|
|
totalShowBlock.totalEntry = str(lTNeto+lTTax) |
|
989 |
else: |
else: |
|
totalShowBlock.netoEntry = "0.00" |
|
|
totalShowBlock.ivaEntry = "0.00" |
|
990 |
totalShowBlock.totalEntry = "0.00" |
totalShowBlock.totalEntry = "0.00" |
991 |
</trigger> |
</trigger> |
992 |
|
|
1520 |
<scrollbar page="5" |
<scrollbar page="5" |
1521 |
x="103" y="14" width="1" height="7"/> |
x="103" y="14" width="1" height="7"/> |
1522 |
</block> |
</block> |
1523 |
<block datasource="nil" name="totalShowBlock"> |
<block datasource="alienDocumentShowDataSource" name="totalShowBlock"> |
1524 |
<label name="totalLbl" text="Neto" x="55" y="21"/> |
<label name="totalLbl" text="Neto" x="55" y="21"/> |
1525 |
<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"/> |
1526 |
<label name="ivaLbl" text="IVA" x="65" y="21"/> |
<label name="ivaLbl" text="IVA" x="65" y="21"/> |
1527 |
<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"/> |
1528 |
<label name="totalLbl" text="Total" x="82" y="21"/> |
<label name="totalLbl" text="Total" x="82" y="21"/> |
1529 |
<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"/> |
1530 |
</block> |
</block> |