202 |
<!-- Origen de datos que srive para calcular el total facturado --> |
<!-- Origen de datos que srive para calcular el total facturado --> |
203 |
|
|
204 |
<datasource name="productInvoiceTotalDataSource" database="papo" |
<datasource name="productInvoiceTotalDataSource" database="papo" |
205 |
table="_entity_data, own_document, own_item, own_product_invoice_item, own_item_tax" |
table="_entity_data, own_document, own_item, own_product_item, own_item_tax" |
206 |
order_by="own_product_invoice_item.id"> |
order_by="own_product_item.id"> |
207 |
<condition> |
<condition> |
208 |
<and> |
<and> |
209 |
<eq> |
<eq> |
217 |
</eq> |
</eq> |
218 |
<eq> |
<eq> |
219 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
220 |
<cfield name="own_product_invoice_item.own_item"/> |
<cfield name="own_product_item.own_item"/> |
221 |
</eq> |
</eq> |
222 |
<eq> |
<eq> |
223 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
361 |
|
|
362 |
<datasource name="ownItemDataSource" database="papo" detaillink="own_item.own_document" |
<datasource name="ownItemDataSource" database="papo" detaillink="own_item.own_document" |
363 |
master="ownDocumentDataSource" masterlink="id" |
master="ownDocumentDataSource" masterlink="id" |
364 |
table="own_item, own_product_invoice_item, own_item_tax"> |
table="own_item, own_product_item, own_item_tax"> |
365 |
<condition> |
<condition> |
366 |
<and> |
<and> |
367 |
<eq> |
<eq> |
368 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
369 |
<cfield name="own_product_invoice_item.own_item"/> |
<cfield name="own_product_item.own_item"/> |
370 |
</eq> |
</eq> |
371 |
<eq> |
<eq> |
372 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
383 |
<!-- Origen de datos que sirve para consultar y asi actualizar el stock --> |
<!-- Origen de datos que sirve para consultar y asi actualizar el stock --> |
384 |
|
|
385 |
<datasource database="papo" name="ownItemToUpdDataSource" |
<datasource database="papo" name="ownItemToUpdDataSource" |
386 |
table="own_item, own_product_invoice_item, _price_data, _product_store_data"> |
table="own_item, own_product_item, _price_data, _product_store_data"> |
387 |
<condition> |
<condition> |
388 |
<and> |
<and> |
389 |
<eq> |
<eq> |
392 |
</eq> |
</eq> |
393 |
<eq> |
<eq> |
394 |
<cfield name="own_item.id"/> |
<cfield name="own_item.id"/> |
395 |
<cfield name="own_product_invoice_item.own_item"/> |
<cfield name="own_product_item.own_item"/> |
396 |
</eq> |
</eq> |
397 |
<eq> |
<eq> |
398 |
<cfield name="_price_data.id"/> |
<cfield name="_price_data.id"/> |
399 |
<cfield name="own_product_invoice_item.price"/> |
<cfield name="own_product_item.price"/> |
400 |
</eq> |
</eq> |
401 |
<eq> |
<eq> |
402 |
<cfield name="_price_data.product"/> |
<cfield name="_price_data.product"/> |
513 |
callTrigger ('commitTrigger') |
callTrigger ('commitTrigger') |
514 |
# it's _such_ a pitty |
# it's _such_ a pitty |
515 |
# pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) }) |
# pleasePrint ('serviceInvoice', { 'id': str(ownDocumentBlock.idEntry) }) |
516 |
# BUG: select the correct type of invoice? |
report='productInvoice-%s' % str(ownDocumentBlock.typeEntry) |
517 |
# pleasePrint (self, 'p1', '1', 'serviceInvoice-discriminated', [ 'id='+str(ownDocumentBlock.idEntry) ]) |
hack.pleasePrint (self, str(ownDocumentBlock.typeEntry), report, [ 'id='+str(ownDocumentBlock.idEntry) ],branchDocumentBlock.documentPrintCommand) |
|
hack.pleasePrint (self, 'p1', '1', 'productInvoice', [ 'id='+str(ownDocumentBlock.idEntry) ],branchDocumentBlock.documentPrintCommand) |
|
518 |
callTrigger('rollbackTrigger') |
callTrigger('rollbackTrigger') |
519 |
callTrigger('endWaitingModeTrigger') |
callTrigger('endWaitingModeTrigger') |
520 |
]]></trigger> |
]]></trigger> |
613 |
lRecords = ownItemDataSource.getRecords() |
lRecords = ownItemDataSource.getRecords() |
614 |
for index in range(len(lRecords)): |
for index in range(len(lRecords)): |
615 |
lRecord = lRecords[index] |
lRecord = lRecords[index] |
616 |
lQty = hack.a2f(lRecord.getField("own_product_invoice_item.qty")) |
lQty = hack.a2f(lRecord.getField("own_product_item.qty")) |
617 |
#print "cantidad: ",lQty |
#print "cantidad: ",lQty |
618 |
lBonus = hack.a2f(lRecord.getField("own_item.bonus")) |
lBonus = hack.a2f(lRecord.getField("own_item.bonus")) |
619 |
lDiscount = hack.a2f(lRecord.getField("own_item.discount")) |
lDiscount = hack.a2f(lRecord.getField("own_item.discount")) |
620 |
lUnitPrice = hack.a2f(lRecord.getField("own_product_invoice_item.unit_price")) |
lUnitPrice = hack.a2f(lRecord.getField("own_product_item.unit_price")) |
621 |
#lResultSet = priceDataSource.createResultSet({"id":lRecord.getField("own_product_invoice_item.price")}) |
#lResultSet = priceDataSource.createResultSet({"id":lRecord.getField("own_product_item.price")}) |
622 |
#if (lResultSet.firstRecord()): |
#if (lResultSet.firstRecord()): |
623 |
#lUnitPrice = hack.a2f(lResultSet.current.getField("unit_price")) |
#lUnitPrice = hack.a2f(lResultSet.current.getField("unit_price")) |
624 |
#else: |
#else: |
723 |
invoiceTotal = 0 |
invoiceTotal = 0 |
724 |
currOwnDoc = productInvoiceResultSet.current.getField("own_document.id") |
currOwnDoc = productInvoiceResultSet.current.getField("own_document.id") |
725 |
while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more: |
while productInvoiceResultSet.current.getField("own_document.id") == currOwnDoc and more: |
726 |
lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_invoice_item.qty")) |
lQty = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.qty")) |
727 |
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("own_product_invoice_item.unit_price")) |
lUnitPrice = hack.a2f(productInvoiceResultSet.current.getField("own_product_item.unit_price")) |
728 |
lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus")) |
lBonus = hack.a2f(productInvoiceResultSet.current.getField("own_item.bonus")) |
729 |
lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount")) |
lDiscount = hack.a2f(productInvoiceResultSet.current.getField("own_item.discount")) |
730 |
item = lQty * lUnitPrice - lBonus - lDiscount |
item = lQty * lUnitPrice - lBonus - lDiscount |
1162 |
|
|
1163 |
<label name="qtyLbl" text="Cantidad" x="45" y="10"/> |
<label name="qtyLbl" text="Cantidad" x="45" y="10"/> |
1164 |
<!-- mdione's bookmark --> |
<!-- mdione's bookmark --> |
1165 |
<entry field="own_product_invoice_item.qty" name="qtyEntry" rows="10" typecast="number" displaymask="%0.3f" width="11" x="45" y="11"> |
<entry field="own_product_item.qty" name="qtyEntry" rows="10" typecast="number" displaymask="%0.3f" width="11" x="45" y="11"> |
1166 |
<trigger name="qtyEntryPreFocusout" type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger name="qtyEntryPreFocusout" type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
1167 |
</entry> |
</entry> |
1168 |
|
|
1169 |
<label name="priceLbl" text="Precio" x="56" y="10"/> |
<label name="priceLbl" text="Precio" x="56" y="10"/> |
1170 |
<entry x="56" y="11" name="unitPriceEntry" field="own_product_invoice_item.unit_price" width="10" rows="10" typecast="number" displaymask="%0.2f"> |
<entry x="56" y="11" name="unitPriceEntry" field="own_product_item.unit_price" width="10" rows="10" typecast="number" displaymask="%0.2f"> |
1171 |
<trigger name="unitPriceEntryPreFocusout" type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger name="unitPriceEntryPreFocusout" type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
1172 |
</entry> |
</entry> |
1173 |
<entry x="1" y="14" readonly="" field="own_product_invoice_item.price" name="priceEntry" width="10" rows="5" hidden=""/> |
<entry x="1" y="14" readonly="" field="own_product_item.price" name="priceEntry" width="10" rows="5" hidden=""/> |
1174 |
<entry x="1" y="14" readonly="" field="own_item_tax.tax" name="taxTypeEntry" width="10" rows="5" default="1" hidden="" typecast="number" displaymask="%0.2f"/> |
<entry x="1" y="14" readonly="" field="own_item_tax.tax" name="taxTypeEntry" width="10" rows="5" default="1" hidden="" typecast="number" displaymask="%0.2f"/> |
1175 |
<entry x="1" y="14" readonly="" field="own_item_tax.amount" name="taxAmountEntry" width="10" rows="5" hidden="" typecast="number" displaymask="%0.2f"/> |
<entry x="1" y="14" readonly="" field="own_item_tax.amount" name="taxAmountEntry" width="10" rows="5" hidden="" typecast="number" displaymask="%0.2f"/> |
1176 |
|
|
1225 |
<block datasource="ownItemToUpdDataSource" name="ownItemToUpdBlock"> |
<block datasource="ownItemToUpdDataSource" name="ownItemToUpdBlock"> |
1226 |
<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"/> |
1227 |
<entry name="prodIdEntry" field="_price_data.product" hidden="" x="11" y="109" width="10"/> |
<entry name="prodIdEntry" field="_price_data.product" hidden="" x="11" y="109" width="10"/> |
1228 |
<entry name="qtyEntry" field="own_product_invoice_item.qty" hidden="" x="22" y="109" width="10"/> |
<entry name="qtyEntry" field="own_product_item.qty" hidden="" x="22" y="109" width="10"/> |
1229 |
<entry name="levelEntry" field="_product_store_data.level" hidden="" x="33" y="109" width="10"/> |
<entry name="levelEntry" field="_product_store_data.level" hidden="" x="33" y="109" width="10"/> |
1230 |
<entry name="productEntry" field="_product_store_data.product" hidden="" x="33" y="109" width="10"/> |
<entry name="productEntry" field="_product_store_data.product" hidden="" x="33" y="109" width="10"/> |
1231 |
<entry name="storehouseEntry" field="_product_store_data.storehouse" hidden="" x="33" y="109" width="10"/> |
<entry name="storehouseEntry" field="_product_store_data.storehouse" hidden="" x="33" y="109" width="10"/> |