1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
<?xml version="1.0" encoding="ISO-8859-1"?> |
2 |
<!DOCTYPE form SYSTEM "gnue-forms.dtd"> |
<!DOCTYPE form SYSTEM "gnue-forms.dtd"> |
3 |
|
|
4 |
<form width="84" height="17" title="Facturación a Clientes"> |
<form width="84" height="21" title="Facturación a Clientes"> |
5 |
<datasource name="total" cache="1"/> |
<datasource name="tmpValuesDataSource" cache="1"/> |
6 |
<datasource name="debt" cache="1"/> |
<datasource name="prodSearchDataSource" cache="1"/> |
7 |
|
<datasource name="prodResultDataSource" cache="1"/> |
8 |
|
|
9 |
<!-- Origen de datos que sirve para seleccionar el cleinte al que se le --> |
<!-- Origen de datos que sirve para seleccionar el cleinte al que se le --> |
10 |
<!-- va a facturar --> |
<!-- va a facturar --> |
127 |
</condition> |
</condition> |
128 |
</datasource> |
</datasource> |
129 |
|
|
130 |
<datasource name="priceDataSource" database="papo" table="_product_data, price" |
<datasource name="priceDataSource" database="papo" table="_price_data" /> |
|
order_by="_product_data.canonical_name"> |
|
|
<!-- <condition> --> |
|
|
<!-- <and> --> |
|
|
<!-- <eq> --> |
|
|
<!-- <cfield name="price.product"/> --> |
|
|
<!-- <cfield name="product.id"/> --> |
|
|
<!-- </eq> --> |
|
|
<!-- </and> --> |
|
|
<!-- </condition> --> |
|
|
</datasource> |
|
131 |
|
|
132 |
<!-- Origen de datos que contiene el encabezado de la factura --> |
<!-- Origen de datos que contiene el encabezado de la factura --> |
133 |
|
|
171 |
|
|
172 |
<datasource database="papo" detaillink="own_item.own_document" |
<datasource database="papo" detaillink="own_item.own_document" |
173 |
master="ownDocumentDataSource" masterlink="id" name="ownItemDataSource" |
master="ownDocumentDataSource" masterlink="id" name="ownItemDataSource" |
174 |
table="own_item, own_proditem"> |
table="own_item, own_proditem, own_item_tax"> |
175 |
<condition> |
<condition> |
176 |
<and> |
<and> |
177 |
<eq> |
<eq> |
178 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
179 |
<cfield name="own_proditem.own_item"/> |
<cfield name="own_proditem.own_item"/> |
180 |
</eq> |
</eq> |
181 |
|
<eq> |
182 |
|
<cfield name="own_item.id"/> |
183 |
|
<cfield name="own_item_tax.own_item"/> |
184 |
|
</eq> |
185 |
|
<eq> |
186 |
|
<cfield name="own_item_tax.tax"/> |
187 |
|
<cconst value="1"/> |
188 |
|
</eq> |
189 |
</and> |
</and> |
190 |
</condition> |
</condition> |
191 |
</datasource> |
</datasource> |
227 |
</datasource> |
</datasource> |
228 |
|
|
229 |
<!-- Este trigger sirve para calcular la deuda acumulada para poder saber --> |
<!-- Este trigger sirve para calcular la deuda acumulada para poder saber --> |
|
<!-- cuanto credito le queda con respecto al limite de credito asignado --> |
|
|
|
|
|
<trigger name="debtCalcTrigger" type="NAMED"> |
|
|
|
|
|
</trigger> |
|
230 |
|
|
231 |
<trigger name="commitTrigger" type="NAMED"> |
<trigger name="commitTrigger" type="NAMED"> |
232 |
if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.qtyEntry) > 0: |
if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.qtyEntry) > 0: |
267 |
self.exit() |
self.exit() |
268 |
</trigger> |
</trigger> |
269 |
|
|
270 |
|
<!-- Este trigger clacula el total facturado --> |
271 |
<trigger name="totalCalcTrigger" type="NAMED"> |
<trigger name="totalCalcTrigger" type="NAMED"> |
272 |
|
import hack |
273 |
|
|
274 |
sum = 0 |
sum = 0 |
275 |
lRecords = ownItemDataSource.getRecords() |
lRecords = ownItemDataSource.getRecords() |
276 |
for index in range(len(lRecords)): |
for index in range(len(lRecords)): |
277 |
lRecord = lRecords[index] |
lRecord = lRecords[index] |
278 |
lQty = eval(str(lRecord.getField("ownproditem.qty"))) |
lQty = hack.a2f(lRecord.getField("own_proditem.qty")) |
279 |
#print "cantidad:",lQty |
print "cantidad:",lQty |
280 |
lBonus = eval(str(lRecord.getField("ownitem.bonus"))) |
lBonus = hack.a2f(lRecord.getField("own_item.bonus")) |
281 |
lDiscount = eval(str(lRecord.getField("ownitem.discount"))) |
lDiscount = hack.a2f(lRecord.getField("own_item.discount")) |
282 |
lResultSet = priceDataSource.createResultSet({"price.id":lRecord.getField("ownproditem.price")}) |
lResultSet = priceDataSource.createResultSet({"_price_data.id":lRecord.getField("own_proditem.price")}) |
283 |
if (lResultSet.firstRecord()): |
if (lResultSet.firstRecord()): |
284 |
lUnitPrice = lResultSet.current.getField("price.unit_price") |
lUnitPrice = hack.a2f(lResultSet.current.getField("_price_data.unit_price")) |
285 |
else: |
else: |
286 |
lUnitPrice = 0 |
lUnitPrice = 0 |
287 |
#print "lUnitPrice = ",lUnitPrice |
print "lUnitPrice = ",lUnitPrice |
288 |
|
|
289 |
if (lQty == None): |
if (lQty == None): |
290 |
lQty = 1 |
lQty = 1 |
291 |
lRecord.setField("ownproditem.qty",1) |
lRecord.setField("own_proditem.qty",1) |
292 |
if (lBonus == None): |
if (lBonus == None): |
293 |
lBonus = 0 |
lBonus = 0 |
294 |
lRecord.setField("ownitem.bonus",0.00) |
lRecord.setField("own_item.bonus",0.00) |
295 |
if (lDiscount == None): |
if (lDiscount == None): |
296 |
lDiscount = 0 |
lDiscount = 0 |
297 |
lRecord.setField("ownitem.discount",0.00) |
lRecord.setField("own_item.discount",0.00) |
298 |
|
|
299 |
sum = sum + (lQty * lUnitPrice) - lBonus - lDiscount |
sum = sum + (lQty * lUnitPrice) - lBonus - lDiscount |
300 |
lHBonus = eval(str(ownDocumentDataSource.getCurrentRecord().getField("bonus"))) |
lHBonus = hack.a2f(ownDocumentDataSource.getCurrentRecord().getField("bonus")) |
301 |
if (lHBonus == None): |
if (lHBonus == None): |
302 |
lHBonus = 0 |
lHBonus = 0 |
303 |
ownDocumentBlock.hBonusEntry = "0.00" |
ownDocumentBlock.hBonusEntry = "0.00" |
305 |
totalBlock.total = str(sum) |
totalBlock.total = str(sum) |
306 |
</trigger> |
</trigger> |
307 |
|
|
308 |
|
|
309 |
<page name="Factura a Clientes"> |
<page name="Factura a Clientes"> |
|
|
|
|
|
|
310 |
<box height="10" label="Factura de Productos a Clientes" |
<box height="10" label="Factura de Productos a Clientes" |
311 |
name="invoiceHeaderBox" width="82" x="0" y="0"> |
name="invoiceHeaderBox" width="82" x="0" y="0"> |
312 |
<block name="debtBlock" datasource="debt"> |
<block datasource="ownDocumentDataSource" name="ownDocumentBlock" restrictInsert=""> |
|
<label text=" Deuda actual" x="65" y="2" /> |
|
|
|
|
|
<entry x="65" y="3" name="debtEntry" readonly="" width="8"> |
|
|
<!-- <trigger type="Pre-Focusout"> --> |
|
|
<!-- print str(debtBlock.dedtEntry) --> |
|
|
<!-- </trigger> --> |
|
|
</entry> |
|
|
</block> |
|
|
|
|
|
<block datasource="ownDocumentDataSource" name="ownDocumentBlock"> |
|
313 |
<trigger name="t" type="Pre-Insert"> |
<trigger name="t" type="Pre-Insert"> |
314 |
ownDocumentBlock.idEntry.autofillBySequence('owndocument_id_seq') |
ownDocumentBlock.idEntry.autofillBySequence('owndocument_id_seq') |
315 |
ownDocumentBlock.typeEntry = "1" |
ownDocumentBlock.typeEntry = "1" |
326 |
width="30" style="dropdown" foreign_key="clientDataSource._entity_data._table" |
width="30" style="dropdown" foreign_key="clientDataSource._entity_data._table" |
327 |
foreign_key_description="_entity_data.name" > |
foreign_key_description="_entity_data.name" > |
328 |
|
|
329 |
<trigger type="PRE-FOCUSOUT" name="showScoreTrigger"> |
<trigger type="PRE-FOCUSOUT" name="showClientDataTrigger"> |
330 |
if str(ownDocumentBlock.clientRecipientBox.clientEntry): |
if str(ownDocumentBlock.clientRecipientBox.clientEntry): |
331 |
|
# Actualiza el puntaje |
332 |
ownDocumentBlock.clientRecipientBox.scoreEntry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
ownDocumentBlock.clientRecipientBox.scoreEntry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
333 |
|
# Actualiza el limite de credito |
334 |
ownDocumentBlock.clientRecipientBox.creditLimit1Entry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
ownDocumentBlock.clientRecipientBox.creditLimit1Entry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
335 |
|
# Actualiza la Lista de precios asignada al cliente |
336 |
ownDocumentBlock.clientRecipientBox.priceTypeEntry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
ownDocumentBlock.clientRecipientBox.priceTypeEntry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
337 |
# Aca si existe un balance, calcula la deuda desde ese balance en adelante sino |
# Aca si existe un balance, calcula la deuda desde ese balance en adelante sino |
338 |
# calcula la deuda desde el primer documento vinculado al cliente actual |
# calcula la deuda desde el primer documento vinculado al cliente actual |
397 |
payTotal += hack.a2f(rs.current.getField("own_document_proceeding.amount")) |
payTotal += hack.a2f(rs.current.getField("own_document_proceeding.amount")) |
398 |
|
|
399 |
# Calculo del total adeudado |
# Calculo del total adeudado |
400 |
debtTotal = invTotal + balance - payTotal |
deudaTotal = invTotal - balance - payTotal |
401 |
|
|
402 |
|
ownDocumentBlock.clientRecipientBox.deuda = deudaTotal |
403 |
|
|
404 |
debtBlock.dedtEntry = "0.0" |
# Obtiene el id de la lista de precios para poder buscar y lo coloca |
405 |
|
# en una variable temporaria colgada del tmpValuesDataSource (un invento que parece que sirve no se si es prolijo) |
406 |
|
rs = clientDataSource.createResultSet({"_entity_data._table":ownDocumentBlock.clientRecipientBox.clientEntry}) |
407 |
|
rs.firstRecord() |
408 |
|
tmpValuesDataSource.priceTypeId = rs.current.getField("_price_type_data._table") |
409 |
</trigger> |
</trigger> |
410 |
<trigger type="PRE-FOCUSIN" name="showScoreTrigger"> |
<trigger type="PRE-FOCUSIN" name="showScoreTrigger"> |
411 |
ownDocumentBlock.clientRecipientBox.scoreEntry = "" |
ownDocumentBlock.clientRecipientBox.scoreEntry = "" |
412 |
ownDocumentBlock.clientRecipientBox.creditLimit1Entry = "" |
ownDocumentBlock.clientRecipientBox.creditLimit1Entry = "" |
413 |
ownDocumentBlock.clientRecipientBox.priceTypeEntry = "" |
ownDocumentBlock.clientRecipientBox.priceTypeEntry = "" |
414 |
|
ownDocumentBlock.clientRecipientBox.deuda = "" |
415 |
</trigger> |
</trigger> |
416 |
</entry> |
</entry> |
417 |
|
|
432 |
width="8" style="textlookup" foreign_key="tlCreditLimit1DataSource.entity" |
width="8" style="textlookup" foreign_key="tlCreditLimit1DataSource.entity" |
433 |
foreign_key_description="credit_limit"/> |
foreign_key_description="credit_limit"/> |
434 |
|
|
435 |
|
<label name="deudaLbl" text="| Deuda : " x="40" y="3"/> |
436 |
|
<entry name="deuda" style="label" x="52" y="3" width="12"/> |
437 |
|
|
438 |
</box> |
</box> |
439 |
<label name="dateLbl" rows="1" text="Fecha" x="1" y="7" /> |
<label name="dateLbl" rows="1" text="Fecha" x="1" y="7" /> |
440 |
<entry field="date" name="dateEntry" readonly="" typecast="date" |
<entry field="date" name="dateEntry" style="label" readonly="" typecast="date" |
441 |
rows="1" width="24" x="7" y="7"/> |
rows="1" width="24" x="7" y="7"/> |
442 |
|
|
443 |
<label name="bonusLbl" rows="1" text="Bonificación" x="33" y="7"/> |
<label name="bonusLbl" rows="1" text="Bonificación" x="33" y="7"/> |
455 |
name="quitBtn" height="1"/> |
name="quitBtn" height="1"/> |
456 |
</block> |
</block> |
457 |
</box> |
</box> |
458 |
|
<!-- ******************************** --> |
459 |
|
<!-- Busqueda del producto a facturar --> |
460 |
|
<!-- ******************************** --> |
461 |
|
|
462 |
|
<!-- Datasource que sirve para la búsqueda del producto --> |
463 |
|
<datasource database="papo" name="priceTypeDataSource" table="_price_type_data"> |
464 |
|
<condition> |
465 |
|
<null> |
466 |
|
<cfield name="_price_type_data._end_t"/> |
467 |
|
</null> |
468 |
|
</condition> |
469 |
|
</datasource> |
470 |
|
<!-- Bloque que sirve para la búsqueda del producto respetando lista de precios --> |
471 |
|
<block name="priceTypeBlock" datasource="priceTypeDataSource"> |
472 |
|
<entry name="priceTypeParentId" field="parent" x="1" |
473 |
|
y="2" width="40" hidden=""/> |
474 |
|
<entry name="priceTypeId" field="_table" x="40" y="2" width="10" hidden="" /> |
475 |
|
</block> |
476 |
|
<!-- Datasource que sirve para almacenar el resultado de la búsqueda --> |
477 |
|
<datasource database="papo" name="productResultDataSource" |
478 |
|
table="product_code_type, _product_code_type_data, product_code, _product_code_data, product, _product_data, price, _price_data, price_type, _price_type_data" |
479 |
|
historytable="_product_code_type_data, _product_code_data, _product_data , _price_data, _price_type_data" |
480 |
|
order_by = "_product_data.canonical_name,price_type.id desc" > |
481 |
|
<condition> |
482 |
|
<and> |
483 |
|
<eq> |
484 |
|
<cfield name="product_code_type.id"/> |
485 |
|
<cfield name="_product_code_type_data._table"/> |
486 |
|
</eq> |
487 |
|
<null> |
488 |
|
<cfield name="_product_code_type_data._end_t"/> |
489 |
|
</null> |
490 |
|
<eq> |
491 |
|
<cfield name="product_code.id"/> |
492 |
|
<cfield name="_product_code_data._table"/> |
493 |
|
</eq> |
494 |
|
<null> |
495 |
|
<cfield name="_product_code_data._end_t"/> |
496 |
|
</null> |
497 |
|
<eq> |
498 |
|
<cfield name="product.id"/> |
499 |
|
<cfield name="_product_data._table"/> |
500 |
|
</eq> |
501 |
|
<null> |
502 |
|
<cfield name="_product_data._end_t"/> |
503 |
|
</null> |
504 |
|
<eq> |
505 |
|
<cfield name="price.id"/> |
506 |
|
<cfield name="_price_data._table"/> |
507 |
|
</eq> |
508 |
|
<null> |
509 |
|
<cfield name="_price_data._end_t"/> |
510 |
|
</null> |
511 |
|
<eq> |
512 |
|
<cfield name="price_type.id"/> |
513 |
|
<cfield name="_price_type_data._table"/> |
514 |
|
</eq> |
515 |
|
<null> |
516 |
|
<cfield name="_price_type_data._end_t"/> |
517 |
|
</null> |
518 |
|
<eq> |
519 |
|
<cfield name="product_code_type.id"/> |
520 |
|
<cfield name="_product_code_data.product_code_type"/> |
521 |
|
</eq> |
522 |
|
<eq> |
523 |
|
<cfield name="product.id"/> |
524 |
|
<cfield name="_product_code_data.product"/> |
525 |
|
</eq> |
526 |
|
<eq> |
527 |
|
<cfield name="product.id"/> |
528 |
|
<cfield name="_price_data.product"/> |
529 |
|
</eq> |
530 |
|
<eq> |
531 |
|
<cfield name="price_type.id"/> |
532 |
|
<cfield name="_price_data.price_type"/> |
533 |
|
</eq> |
534 |
|
</and> |
535 |
|
</condition> |
536 |
|
</datasource> |
537 |
|
<!-- Bloque que sirve para almacenar el resultado intermedio de la búsqueda --> |
538 |
|
<block name="tmpProdResultBlock" datasource="productResultDataSource"> |
539 |
|
<entry name="prodNameEntry" field="_product_data.canonical_name" x="1" y="1" width="15" rows="2" hidden=""/> |
540 |
|
<entry name="prodIdEntry" field="_product_data._table" x="15" y="1" width="5" rows="2" hidden=""/> |
541 |
|
<entry name="prodCodeEntry" field="_product_code_data.code" x="20" y="1" width="10" rows="2" hidden=""/> |
542 |
|
<entry name="prodCodeTypeEntry" field="_product_code_data.product_code_type" x="30" y="1" width="5" rows="2" hidden=""/> |
543 |
|
<entry name="prodPriceTypeEntry" field="_price_type_data.name" x="35 " y="1" width="10" rows="2" hidden=""/> |
544 |
|
<entry name="prodPriceTypeIdEntry" field="_price_type_data._table" x="45" y="1" width="5" rows="2" hidden=""/> |
545 |
|
<entry name="prodUnitPriceEntry" field="_price_data.unit_price" x="50" y="1" width="20" rows="2" hidden=""/> |
546 |
|
<entry name="prodPriceEntry" field="_price_data.id" x="50" y="1" width="20" rows="2" hidden=""/> |
547 |
|
</block> |
548 |
|
|
549 |
|
<trigger name="prodSearchTrigger" type="NAMED"> |
550 |
|
#armado de la lista de recorrido del arbol |
551 |
|
search_id = str(tmpValuesDataSource.priceTypeId) |
552 |
|
priceListsChain=[] |
553 |
|
while search_id != "" : |
554 |
|
priceTypeBlock.initQuery() |
555 |
|
priceTypeBlock.priceTypeId = search_id |
556 |
|
priceTypeBlock.processQuery() |
557 |
|
search_id = str(priceTypeBlock.priceTypeParentId) |
558 |
|
priceListsChain.append("%s" % priceTypeBlock.priceTypeId) |
559 |
|
tmpProdResultBlock.processRollback() |
560 |
|
tmpProdResultBlock.initQuery() |
561 |
|
tmpProdResultBlock.prodNameEntry = ("%s" % prodSearchBlock.prodNameSEntry)+"%" |
562 |
|
tmpProdResultBlock.prodCodeEntry = ("%s" % prodSearchBlock.prodCodeSEntry)+"%" |
563 |
|
tmpProdResultBlock.prodCodeTypeEntry = "1" |
564 |
|
tmpProdResultBlock.processQuery() |
565 |
|
# cargar la parte visible de modificacion de precios |
566 |
|
tmpProdResultBlock.firstRecord() |
567 |
|
product_id_anterior = None |
568 |
|
prodResultBlock.processRollback() |
569 |
|
for index in range(tmpProdResultBlock.getRecordCount()): |
570 |
|
product_id=("%s" %tmpProdResultBlock.prodIdEntry) |
571 |
|
if product_id != product_id_anterior: |
572 |
|
for pricetype in priceListsChain: |
573 |
|
if pricetype == ("%s" %tmpProdResultBlock.prodPriceTypeIdEntry): |
574 |
|
prodResultBlock.prodNameEntry= ("%s" %tmpProdResultBlock.prodNameEntry) |
575 |
|
prodResultBlock.prodCodeEntry= ("%s" %tmpProdResultBlock.prodCodeEntry) |
576 |
|
prodResultBlock.prodPriceTypeEntry= ("%s" %tmpProdResultBlock.prodPriceTypeEntry) |
577 |
|
prodResultBlock.prodUnitPriceEntry= ("%s" %tmpProdResultBlock.prodUnitPriceEntry) |
578 |
|
prodResultBlock.prodPriceEntry = ("%s" %tmpProdResultBlock.prodPriceEntry) |
579 |
|
prodResultBlock.prodPricePreviousEntry= ("%s" %tmpProdResultBlock.prodUnitPriceEntry) |
580 |
|
prodResultBlock.prodProductIdEntry= ("%s" %tmpProdResultBlock.prodIdEntry) |
581 |
|
prodResultBlock.prodPriceListIdEntry= ("%s" %tmpProdResultBlock.prodPriceTypeIdEntry) |
582 |
|
prodResultBlock.newRecord() |
583 |
|
product_id_anterior=product_id |
584 |
|
break |
585 |
|
tmpProdResultBlock.nextRecord() |
586 |
|
</trigger> |
587 |
|
<!-- Este bloque sirve para capturar lo valores de la búsqueda --> |
588 |
|
<block name="prodSearchBlock" datasource="prodSearchDataSource"> |
589 |
|
<label text="Búsqueda de productos a facturar" x="1" y="10"/> |
590 |
|
<label text="Código" x="1" y="11"/> |
591 |
|
<entry name="prodCodeSEntry" width="20" x="8" y="11" /> |
592 |
|
<label text="Nombre" x="1" y="12"/> |
593 |
|
<entry name="prodNameSEntry" width="20" x="8" y="12" /> |
594 |
|
<button name="prodSearchButton" trigger="prodSearchTrigger" label="Buscar" width="8" height="1" x="29" y="12"/> |
595 |
|
</block> |
596 |
|
<!-- En este bloque se almacena el reultado final/real de la búsqueda para seleccion el correcto --> |
597 |
|
<block name="prodResultBlock" datasource="prodResultDataSource" restrictInsert=""> |
598 |
|
<label text="Código" x="38" y="10"/> |
599 |
|
<label text="Producto" x="49" y="10"/> |
600 |
|
<entry name="prodCodeEntry" width="10" x="38" y="11" rows="2" /> |
601 |
|
<entry name="prodNameEntry" width="22" x="48" y="11" rows="2" /> |
602 |
|
<entry name="prodPriceTypeEntry" x="1 " y="1" width="10" rows="8" hidden=""/> |
603 |
|
<entry name="prodUnitPriceEntry" x="1" y="1" width="10" rows="8" hidden=""/> |
604 |
|
<entry name="prodPriceEntry" x="1" y="1" width="20" rows="2" hidden=""/> |
605 |
|
<entry name="prodPricePreviousEntry" x="1" y="1" width="10" rows="8" hidden=""/> |
606 |
|
<entry name="prodProductIdEntry" x="1" y="1" width="5" rows="8" hidden=""/> |
607 |
|
<entry name="prodPriceListIdEntry" x="1" y="1" width="5" rows="8" hidden=""/> |
608 |
|
<scrollbar page="2" x="71" y="11" width="1" height="2"/> |
609 |
|
|
610 |
|
<button name="prodInsertButton" trigger="prodInsertTrigger" label="Insertar" width="9" height="1" x="73" y="12"/> |
611 |
|
</block> |
612 |
|
<!-- Insertar el producto seleccionado --> |
613 |
|
<trigger name="prodInsertTrigger" type="NAMED"> |
614 |
|
import hack |
615 |
|
|
616 |
|
recCount = ownItemBlock.getRecordCount() |
617 |
|
ownItemBlock.jumpRecord(recCount) |
618 |
|
if ownItemBlock.getCurrentRecord().getField("own_proditem.price"): |
619 |
|
print "new record" |
620 |
|
ownItemBlock.newRecord() |
621 |
|
ownItemBlock.qtyEntry = "1" |
622 |
|
ownItemBlock.productCNameEntry = str(prodResultBlock.prodNameEntry) |
623 |
|
ownItemBlock.priceEntry = str(prodResultBlock.prodPriceEntry) |
624 |
|
# *************** Esto hay que verlo ************************ |
625 |
|
ownItemBlock.taxAmountEntry = "21" |
626 |
|
ownItemBlock.priceWTaxEntry = hack.a2f(prodResultBlock.prodUnitPriceEntry)*hack.a2f(ownItemBlock.qtyEntry)* \ |
627 |
|
(1+hack.a2f(ownItemBlock.taxAmountEntry)/100) |
628 |
|
</trigger> |
629 |
|
<!-- ****** Fin búsqueda ************ --> |
630 |
|
|
631 |
|
<!-- Productos facturados --> |
632 |
<box height="11" label="Productos a facturar" name="invoiceItemBox" |
<box height="11" label="Productos a facturar" name="invoiceItemBox" |
633 |
width="82" x="0" y="9"> |
width="82" x="0" y="13"> |
634 |
<block datasource="ownItemDataSource" name="ownItemBlock"> |
<block datasource="ownItemDataSource" name="ownItemBlock" restrictInsert=""> |
635 |
|
|
636 |
<entry field="own_item.own_document" name="ownDocumentEntry" hidden="" x="1" y="1"/> |
<entry field="own_item.own_document" name="ownDocumentEntry" hidden="" x="1" y="1"/> |
637 |
|
|
640 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
641 |
</entry> |
</entry> |
642 |
<label name="productLbl" text="Producto" x="15" y="1"/> |
<label name="productLbl" text="Producto" x="15" y="1"/> |
643 |
<entry x="15" y="2" field="own_proditem.price" name="productPriceEntry" |
<entry x="15" y="2" name="productCNameEntry" width="20" rows="5" style="label"/> |
644 |
width="20" rows="5" style="dropdown" foreign_key="priceDataSource._price_data._table" |
|
645 |
foreign_key_description="_product_data.canonical_name"> |
<label name="priceLbl" text="Precio" x="42" y="1"/> |
646 |
<trigger type="PRE-FOCUSOUT" name="showPriceTrigger"> |
<entry x="42" y="2" readonly="" name="priceWTaxEntry" width="10" rows="5" style="label" /> |
647 |
ownItemBlock.priceEntry = str(ownItemBlock.productPriceEntry) |
|
648 |
</trigger> |
<entry x="1" y="1" readonly="" field="own_proditem.price" name="priceEntry" width="10" rows="5" hidden="" /> |
649 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<entry x="1" y="1" readonly="" field="own_item_tax.amount" name="taxAmountEntry" width="10" rows="5" hidden="" /> |
650 |
</entry> |
|
651 |
<label name="priceLbl" text="Precio" x="36" y="1"/> |
|
652 |
<entry x="36" y="2" readonly="" field="own_proditem.price" name="priceEntry" |
<label name="discountLbl" text="Descuento" x="55" y="1"/> |
|
width="10" rows="5" style="textlookup" foreign_key="priceDataSource.price.id" |
|
|
foreign_key_description="price.unit_price"/> |
|
|
<label name="discountLbl" text="Descuento" x="47" y="1"/> |
|
653 |
<entry field="own_item.discount" name="discountEntry" value="0" typecast="number" |
<entry field="own_item.discount" name="discountEntry" value="0" typecast="number" |
654 |
rows="5" width="12" x="47" y="2"> |
rows="5" width="10" x="55" y="2"> |
655 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
656 |
</entry> |
</entry> |
657 |
<label name="bonusLbl" text="Bonificación" x="60" y="1"/> |
<label name="bonusLbl" text="Bonificación" x="66" y="1"/> |
658 |
<entry field="own_item.bonus" name="bonusEntry" value="0" typecast="number" |
<entry field="own_item.bonus" name="bonusEntry" value="0" typecast="number" |
659 |
rows="5" width="12" x="60" y="2"> |
rows="5" width="10" x="66" y="2"> |
660 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
661 |
</entry> |
</entry> |
662 |
<scrollbar page="5" |
<scrollbar page="5" |
663 |
x="73" y="2" width="1" height="5"/> |
x="79" y="2" width="1" height="5"/> |
664 |
</block> |
</block> |
665 |
<block datasource="total" name="totalBlock"> |
<block datasource="tmpValuesDataSource" name="totalBlock"> |
666 |
<label name="totalLbl" text="Total" x="29" y="8"/> |
<label text="Neto " x="1" y="8"/> |
667 |
<entry name="total" readonly="" x="36" y="8" width="12"/> |
<entry name="neto" readonly="" x="6" y="8" width="12"/> |
668 |
|
<label text="IVA " x="19" y="8"/> |
669 |
|
<entry name="neto" readonly="" x="23" y="8" width="12"/> |
670 |
|
<label text="Total " x="36" y="8"/> |
671 |
|
<entry name="total" readonly="" x="42" y="8" width="12"/> |
672 |
</block> |
</block> |
673 |
<block datasource="ownItemToUpdDataSource" name="ownItemToUpdBlock"> |
<block datasource="ownItemToUpdDataSource" name="ownItemToUpdBlock"> |
674 |
<entry name="ownDocumentEntry" field="own_item.own_document" hidden="" x="1" y="109" width="10"/> |
<entry name="ownDocumentEntry" field="own_item.own_document" hidden="" x="1" y="109" width="10"/> |