263 |
<!-- Valor final del servicio, con impuesto y todo --> |
<!-- Valor final del servicio, con impuesto y todo --> |
264 |
<trigger name="calculateEndPriceTrigger" type="NAMED"><![CDATA[ |
<trigger name="calculateEndPriceTrigger" type="NAMED"><![CDATA[ |
265 |
from hack import a2f |
from hack import a2f |
266 |
|
|
267 |
itemPrice= a2f (ownItemBlock.priceEntry) |
itemPrice= a2f (ownItemBlock.priceEntry) |
268 |
|
ownItemBlock.taxEntry = (a2f(ownItemBlock.taxPercentEntry)/100) * itemPrice |
269 |
itemTax= a2f (ownItemBlock.taxEntry) |
itemTax= a2f (ownItemBlock.taxEntry) |
270 |
ownItemBlock.endPriceEntry= str (round (itemPrice*(1 + itemTax/100), 2)) |
ownItemBlock.endPriceEntry= str (round (itemPrice + itemTax, 2)) |
271 |
|
|
272 |
# update total |
# update total |
273 |
callTrigger ('calculateTotalTrigger') |
callTrigger ('calculateTotalTrigger') |
274 |
]]></trigger> |
]]></trigger> |
275 |
|
|
276 |
|
|
277 |
<!-- Este trigger calcula el total facturado --> |
<!-- Este trigger calcula el total facturado --> |
278 |
<trigger name="calculateTotalTrigger" type="NAMED"><![CDATA[ |
<trigger name="calculateTotalTrigger" type="NAMED"><![CDATA[ |
373 |
currencyMovementBlock.currencyTypeEntry= "1" |
currencyMovementBlock.currencyTypeEntry= "1" |
374 |
currencyMovementBlock.amountEntry= str (paymentBlock.cashEntry) |
currencyMovementBlock.amountEntry= str (paymentBlock.cashEntry) |
375 |
|
|
|
# movimiento por cuenta corriente |
|
|
movementBlock.processRollback () |
|
|
if a2f (paymentBlock.ctaCteEntry)>0: |
|
|
movementBlock.proceedingEntry= str (proceedingBlock.idEntry) |
|
|
movementBlock.movementTypeEntry= "1" # Revisar com queda esto |
|
|
movementBlock.amountEntry= str (paymentBlock.ctaCteEntry) |
|
|
|
|
376 |
ownDocumentBlock.commit () |
ownDocumentBlock.commit () |
377 |
|
|
378 |
setFocus(ownDocumentBlock.clientRecipientBox.clientEntry) |
setFocus(ownDocumentBlock.clientRecipientBox.clientEntry) |
493 |
itemTaxTotal = 0 |
itemTaxTotal = 0 |
494 |
currItem = productInvoiceResultSet.current.getField("own_item.id") |
currItem = productInvoiceResultSet.current.getField("own_item.id") |
495 |
while productInvoiceResultSet.current.getField("own_item.id") == currItem and more: |
while productInvoiceResultSet.current.getField("own_item.id") == currItem and more: |
496 |
itemTaxTotal += item * (hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount"))/100) |
itemTaxTotal += hack.a2f(productInvoiceResultSet.current.getField("own_item_tax.amount")) |
497 |
more = productInvoiceResultSet.nextRecord() |
more = productInvoiceResultSet.nextRecord() |
498 |
invoiceTotal += item + itemTaxTotal |
invoiceTotal += item + itemTaxTotal |
499 |
|
|
521 |
while serviceInvoiceResultSet.current.getField ("own_item.id")==currentItem and more: |
while serviceInvoiceResultSet.current.getField ("own_item.id")==currentItem and more: |
522 |
# calculate the item price exactly as I do in the other trigger |
# calculate the item price exactly as I do in the other trigger |
523 |
# not revised yet, but I think it was like this |
# not revised yet, but I think it was like this |
524 |
taxAmount = hack.a2f(serviceInvoiceResultSet.current.getField ("own_item_tax.amount")) |
itemTaxTotal += hack.a2f(serviceInvoiceResultSet.current.getField ("own_item_tax.amount")) |
|
itemTaxTotal += round(item * (taxAmount/100), 2) |
|
525 |
more= serviceInvoiceResultSet.nextRecord () |
more= serviceInvoiceResultSet.nextRecord () |
526 |
# print "calc 7: %d:%d" % (item, itemTaxTotal) |
# print "calc 7: %d:%d" % (item, itemTaxTotal) |
527 |
|
|
643 |
</entry> |
</entry> |
644 |
<label name="taxLabel" text="IVA (%)" |
<label name="taxLabel" text="IVA (%)" |
645 |
x="53" y="1"/> |
x="53" y="1"/> |
646 |
<entry name="taxEntry" field="own_item_tax.amount" value="0" typecast="number" |
<entry name="taxPercentEntry" value="0" typecast="number" |
647 |
x="53" y="2" width="10" rows="5" rowSpacer="1"> |
x="53" y="2" width="10" rows="5" rowSpacer="1"> |
648 |
<trigger name="taxEntryPreFocusOut" type="PRE-FOCUSOUT" src="calculateEndPriceTrigger"/> |
<trigger name="taxPercentEntryPreFocusOut" type="POST-FOCUSOUT" src="calculateEndPriceTrigger"/> |
649 |
</entry> |
</entry> |
650 |
|
<entry name="taxEntry" field="own_item_tax.amount" value="0" typecast="number" hidden="" |
651 |
|
x="53" y="2" width="10" rows="5" rowSpacer="1"/> |
652 |
<label name="endPriceLabel" text="Precio final" |
<label name="endPriceLabel" text="Precio final" |
653 |
x="64" y="1"/> |
x="64" y="1"/> |
654 |
<entry name="endPriceEntry" style="label" |
<entry name="endPriceEntry" style="label" |
729 |
<entry name="currencyTypeEntry" field="currency_movement.currency_type" hidden="" |
<entry name="currencyTypeEntry" field="currency_movement.currency_type" hidden="" |
730 |
x="1" y="1" width="12"/> |
x="1" y="1" width="12"/> |
731 |
</block> |
</block> |
|
<block name="movementBlock" datasource="movementDataSource"> |
|
|
<entry name="proceedingEntry" field="movement.proceeding" hidden="" |
|
|
x="1" y="1" width="12"/> |
|
|
<entry name="movementTypeEntry" field="movement.movement_type" hidden="" |
|
|
x="1" y="1" width="12"/> |
|
|
<entry name="amountEntry" field="movement.amount" hidden="" |
|
|
x="1" y="1" width="12"/> |
|
|
</block> |
|
732 |
</page> |
</page> |
733 |
</form> |
</form> |