234 |
<cfield name="_entity_uid_data.entity_uid_type"/> |
<cfield name="_entity_uid_data.entity_uid_type"/> |
235 |
<cfield name="entity_type_uid_conf.entity_uid_type"/> |
<cfield name="entity_type_uid_conf.entity_uid_type"/> |
236 |
</eq> |
</eq> |
237 |
|
<null> |
238 |
|
<cfield name="_entity_data._end_t"/> |
239 |
|
</null> |
240 |
|
<null> |
241 |
|
<cfield name="_entity_uid_data._end_t"/> |
242 |
|
</null> |
243 |
</and> |
</and> |
244 |
</condition> |
</condition> |
245 |
</datasource> |
</datasource> |
246 |
|
|
247 |
<datasource name="providerNameDataSource" database="papo" |
<datasource name="providerNameDataSource" database="papo" |
248 |
table="_entity_data"> |
table="_entity_data"> |
249 |
|
<conditions> |
250 |
|
<null> |
251 |
|
<cfield name="_entity_data._end_t"/> |
252 |
|
</null> |
253 |
|
</conditions> |
254 |
</datasource> |
</datasource> |
255 |
|
|
256 |
<datasource name="transportUIDDataSource" database="papo" |
<datasource name="transportUIDDataSource" database="papo" |
269 |
<cfield name="_entity_uid_data.entity_uid_type"/> |
<cfield name="_entity_uid_data.entity_uid_type"/> |
270 |
<cfield name="entity_type_uid_conf.entity_uid_type"/> |
<cfield name="entity_type_uid_conf.entity_uid_type"/> |
271 |
</eq> |
</eq> |
272 |
|
<null> |
273 |
|
<cfield name="_entity_data._end_t"/> |
274 |
|
</null> |
275 |
|
<null> |
276 |
|
<cfield name="_entity_uid_data._end_t"/> |
277 |
|
</null> |
278 |
</and> |
</and> |
279 |
</condition> |
</condition> |
280 |
</datasource> |
</datasource> |
281 |
|
|
282 |
<datasource name="transportNameDataSource" database="papo" |
<datasource name="transportNameDataSource" database="papo" |
283 |
table="_entity_data"> |
table="_entity_data"> |
284 |
|
<conditions> |
285 |
|
<null> |
286 |
|
<cfield name="_entity_data._end_t"/> |
287 |
|
</null> |
288 |
|
</conditions> |
289 |
</datasource> |
</datasource> |
290 |
|
|
291 |
<datasource name="transportDataSource" database="papo" |
<datasource name="transportDataSource" database="papo" |
534 |
</condition> |
</condition> |
535 |
</datasource> |
</datasource> |
536 |
|
|
537 |
<datasource database="papo" name="alienDocumentShowDataSource" table="alien_document" |
<datasource database="papo" name="alienDocumentShowDataSource" |
538 |
|
table="alien_document, _entity_data as provider, _entity_data as transport" |
539 |
order_by="date"> |
order_by="date"> |
540 |
<condition> |
<condition> |
541 |
<or> |
<and> |
542 |
<eq> |
<eq> |
543 |
<cfield name="alien_document.alien_document_type"/> |
<cfield name="alien_document.sender"/> |
544 |
<cconst value="2"/> |
<cfield name="provider.id"/> |
545 |
</eq> |
</eq> |
546 |
<eq> |
<eq> |
547 |
<cfield name="alien_document.alien_document_type"/> |
<cfield name="alien_document.transport"/> |
548 |
<cconst value="10"/> |
<cfield name="transport.id"/> |
549 |
</eq> |
</eq> |
550 |
<eq> |
<or> |
551 |
<cfield name="alien_document.alien_document_type"/> |
<eq> |
552 |
<cconst value="11"/> |
<cfield name="alien_document.alien_document_type"/> |
553 |
|
<cconst value="2"/> |
554 |
</eq> |
</eq> |
555 |
</or> |
<eq> |
556 |
|
<cfield name="alien_document.alien_document_type"/> |
557 |
|
<cconst value="10"/> |
558 |
|
</eq> |
559 |
|
<eq> |
560 |
|
<cfield name="alien_document.alien_document_type"/> |
561 |
|
<cconst value="11"/> |
562 |
|
</eq> |
563 |
|
</or> |
564 |
|
</and> |
565 |
</condition> |
</condition> |
566 |
</datasource> |
</datasource> |
567 |
|
|
568 |
|
|
569 |
<datasource database="papo" detaillink="alien_item.alien_document" |
<datasource database="papo" detaillink="alien_item.alien_document" |
570 |
master="alienDocumentDataSource" masterlink="id" name="alienItemDataSource" |
master="alienDocumentDataSource" masterlink="id" name="alienItemDataSource" |
571 |
table="alien_item, alien_product_item, alien_item_tax"> |
table="alien_item, alien_product_item, alien_item_tax"> |
1191 |
alienItemShowBlock.firstRecord() |
alienItemShowBlock.firstRecord() |
1192 |
setParameter('invoiceDate',str(alienDocumentShowBlock.dateEntry)) |
setParameter('invoiceDate',str(alienDocumentShowBlock.dateEntry)) |
1193 |
|
|
|
import gnue.common.GConditions as GConditions |
|
|
|
|
|
providerCondition = GConditions.GCondition() |
|
|
|
|
|
tmpAnd = GConditions.GCand(providerCondition) |
|
|
eq = GConditions.GCeq(tmpAnd) |
|
|
GConditions.GCField(eq,"_entity_data.id") |
|
|
GConditions.GCConst(eq,str(alienDocumentShowBlock.providerEntry)) |
|
|
le = GConditions.GCle(tmpAnd) |
|
|
GConditions.GCField(le,"_entity_uid_data._start_t") |
|
|
GConditions.GCConst(le,str(alienDocumentShowBlock.dateEntry)) |
|
|
tmpOr = GConditions.GCor(tmpAnd) |
|
|
tmpNull = GConditions.GCnull(tmpOr) |
|
|
GConditions.GCField(tmpNull,"_entity_uid_data._end_t") |
|
|
le2 = GConditions.GCle(tmpOr) |
|
|
GConditions.GCConst(le2,str(alienDocumentShowBlock.dateEntry)) |
|
|
GConditions.GCField(le2,"_entity_uid_data._end_t") |
|
|
|
|
|
providerResultSet = providerUIDDataSource.createResultSet(providerCondition) |
|
|
result = providerResultSet.firstRecord() |
|
|
if result: |
|
|
alienDocumentShowBlock.providerCodeSEntry = providerResultSet.current.getField("_entity_uid_data.uid") |
|
|
|
|
|
transportCondition = GConditions.GCondition() |
|
|
|
|
|
tmpAnd = GConditions.GCand(transportCondition) |
|
|
eq = GConditions.GCeq(tmpAnd) |
|
|
GConditions.GCField(eq,"_entity_data.id") |
|
|
GConditions.GCConst(eq,str(alienDocumentShowBlock.transportEntry)) |
|
|
le = GConditions.GCle(tmpAnd) |
|
|
GConditions.GCField(le,"_entity_uid_data._start_t") |
|
|
GConditions.GCConst(le,str(alienDocumentShowBlock.dateEntry)) |
|
|
tmpOr = GConditions.GCor(tmpAnd) |
|
|
tmpNull = GConditions.GCnull(tmpOr) |
|
|
GConditions.GCField(tmpNull,"_entity_uid_data._end_t") |
|
|
le2 = GConditions.GCle(tmpOr) |
|
|
GConditions.GCConst(le2,str(alienDocumentShowBlock.dateEntry)) |
|
|
GConditions.GCField(le2,"_entity_uid_data._end_t") |
|
|
|
|
|
transportResultSet = transportUIDDataSource.createResultSet(transportCondition) |
|
|
result = transportResultSet.firstRecord() |
|
|
if result: |
|
|
alienDocumentShowBlock.transportCodeSEntry = transportResultSet.current.getField("_entity_uid_data.uid") |
|
|
|
|
|
|
|
|
#for index in range(recordCount): |
|
|
# alienItemShowBlock.taxPercentEntry = (hack.a2f(alienItemShowBlock.taxAmountEntry) / (hack.a2f(alienItemShowBlock.unitPriceEntry) * \ |
|
|
# hack.a2f(alienItemShowBlock.qtyEntry))) * 100 |
|
|
# if index != recordCount-1: |
|
|
# alienItemShowBlock.nextRecord() |
|
|
|
|
1194 |
</trigger> |
</trigger> |
1195 |
|
|
1196 |
<trigger name="providerTrigger" type="NAMED"> |
<trigger name="providerTrigger" type="NAMED"> |
1398 |
|
|
1399 |
<block datasource="alienDocumentShowDataSource" name="alienDocumentShowBlock" restrictInsert="t"> |
<block datasource="alienDocumentShowDataSource" name="alienDocumentShowBlock" restrictInsert="t"> |
1400 |
|
|
1401 |
<entry field="id" hidden="" name="idEntry" x="1" y="1"/> |
<entry field="alien_document.id" hidden="" name="idEntry" x="1" y="1"/> |
1402 |
<entry field="alien_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
<entry field="alien_document.alien_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
1403 |
|
|
1404 |
<label name="providerLbl" text="Proveedor" x="1" y="1" /> |
<label name="providerLbl" text="Proveedor" x="1" y="1" /> |
1405 |
<entry x="1" y="2" name="providerCodeSEntry" readonly="" width="20" style="label"/> |
<entry x="1" y="2" field="provider._table" name="providerCodeSEntry" readonly="" |
1406 |
<!-- <entry x="1" y="2" field="alien_document.sender" name="providerCodeSEntry" readonly="" --> |
width="20" style="textlookup" foreign_key="providerUIDDataSource._entity_data._table" |
1407 |
<!-- width="20" style="textlookup" foreign_key="providerUIDDataSource._entity_data.id" --> |
foreign_key_description="_entity_uid_data.uid" > |
1408 |
<!-- foreign_key_description="_entity_uid_data.uid" > --> |
</entry> |
1409 |
<!-- <entry x="1" y="2" name="providerCodeSEntry" width="20"> --> |
<entry x="1" y="3" field="provider._table" name="providerNameSEntry" readonly="" |
1410 |
<entry x="1" y="3" field="alien_document.sender" name="providerNameSEntry" readonly="" |
width="35" style="textlookup" foreign_key="providerNameDataSource._table" |
|
width="35" style="textlookup" foreign_key="providerNameDataSource.id" |
|
1411 |
foreign_key_description="name" > |
foreign_key_description="name" > |
|
<!-- <entry x="1" y="3" name="providerNameSEntry" width="35"> --> |
|
1412 |
</entry> |
</entry> |
1413 |
<entry x="1" y="2" field="alien_document.sender" name="providerEntry" width="25" hidden="" /> |
<entry x="1" y="2" field="alien_document.sender" name="providerEntry" width="25" hidden="" /> |
1414 |
|
|
1415 |
<label name="transportLbl" text="Transporte" x="56" y="1" /> |
<label name="transportLbl" text="Transporte" x="56" y="1" /> |
1416 |
<entry x="56" y="2" name="transportCodeSEntry" readonly="" width="20" style="label"/> |
<entry x="56" y="2" field="transport._table" name="transportCodeSEntry" readonly="" |
1417 |
<!-- <entry x="56" y="2" field="alien_document.transport" name="transportCodeSEntry" readonly="" --> |
width="20" style="textlookup" foreign_key="transportUIDDataSource._entity_data._table" |
1418 |
<!-- width="20" style="textlookup" foreign_key="transportUIDDataSource._entity_data.id" --> |
foreign_key_description="_entity_uid_data.uid" > |
1419 |
<!-- foreign_key_description="_entity_uid_data.uid" > --> |
</entry> |
1420 |
<!-- </entry> --> |
<entry x="56" y="3" field="transport._table" name="transportNameSEntry" readonly="" |
1421 |
<entry x="56" y="3" field="alien_document.transport" name="transportNameSEntry" readonly="" |
width="35" style="textlookup" foreign_key="transportNameDataSource._table" |
|
width="35" style="textlookup" foreign_key="transportNameDataSource.id" |
|
1422 |
foreign_key_description="name" > |
foreign_key_description="name" > |
1423 |
</entry> |
</entry> |
1424 |
|
|
1426 |
|
|
1427 |
|
|
1428 |
<label name="numberLbl" text="Número" x="1" y="8" /> |
<label name="numberLbl" text="Número" x="1" y="8" /> |
1429 |
<entry field="number" name="numberEntry" width="20" x="1" y="9" style="label"/> |
<entry field="alien_document.number" name="numberEntry" width="20" x="1" y="9" style="label"/> |
1430 |
|
|
1431 |
<label name="dateLbl" text="Fecha" x="22" y="8" /> |
<label name="dateLbl" text="Fecha" x="22" y="8" /> |
1432 |
<entry field="date" name="dateEntry" typecast="date" |
<entry field="alien_document.date" name="dateEntry" typecast="date" |
1433 |
rows="1" width="22" x="22" y="9" style="label"/> |
rows="1" width="22" x="22" y="9" style="label"/> |
1434 |
|
|
1435 |
<label name="invoiceTypeLbl" text="Tipo" x="48" y="8" /> |
<label name="invoiceTypeLbl" text="Tipo" x="48" y="8" /> |
1436 |
<entry name="invoiceTypeEntry" width="4" x="48" y="9" readonly="t" style="label"/> |
<entry name="invoiceTypeEntry" width="4" x="48" y="9" readonly="t" style="label"/> |
1437 |
|
|
1438 |
<label name="guideNumberLbl" text="Número de guía" x="53" y="8" /> |
<label name="guideNumberLbl" text="Número de guía" x="53" y="8" /> |
1439 |
<entry field="guide_number" name="guideNumerEntry" width="20" x="53" y="9" style="label"/> |
<entry field="alien_document.guide_number" name="guideNumerEntry" width="20" x="53" y="9" style="label"/> |
1440 |
|
|
1441 |
<label name="bundlesLbl" text="Bultos" x="74" y="8" /> |
<label name="bundlesLbl" text="Bultos" x="74" y="8" /> |
1442 |
<entry field="bundles" name="bundlesEntry" width="10" x="74" y="9" style="label"/> |
<entry field="alien_document.bundles" name="bundlesEntry" width="10" x="74" y="9" style="label"/> |
1443 |
|
|
1444 |
</block> |
</block> |
1445 |
</box> |
</box> |
1511 |
</block> |
</block> |
1512 |
<block datasource="alienDocumentShowDataSource" name="totalShowBlock"> |
<block datasource="alienDocumentShowDataSource" name="totalShowBlock"> |
1513 |
<label name="totalLbl" text="Neto" x="55" y="21"/> |
<label name="totalLbl" text="Neto" x="55" y="21"/> |
1514 |
<entry name="netoEntry" field="net_total" readonly="" style="label" x="55" y="22" width="12" default="0.00"/> |
<entry name="netoEntry" field="alien_document.net_total" readonly="" style="label" x="55" y="22" width="12" default="0.00"/> |
1515 |
<label name="ivaLbl" text="IVA" x="65" y="21"/> |
<label name="ivaLbl" text="IVA" x="65" y="21"/> |
1516 |
<entry name="ivaEntry" field="tax_total" readonly="" style="label" x="65" y="22" width="12" default="0.00"/> |
<entry name="ivaEntry" field="alien_document.tax_total" readonly="" style="label" x="65" y="22" width="12" default="0.00"/> |
1517 |
<label name="totalLbl" text="Total" x="82" y="21"/> |
<label name="totalLbl" text="Total" x="82" y="21"/> |
1518 |
<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"/> |
1519 |
</block> |
</block> |