9 |
|
|
10 |
|
|
11 |
|
|
12 |
<datasource name="organizationDataSource" database="papo" |
<datasource name="ownOrganizationDataSource" database="papo" |
13 |
table="_entity_data, _own_entity_data, _organization_data, _persona_tax_profile_data, _tax_profile_data"> |
table="_entity_data, _own_entity_data, _organization_data, _persona_tax_profile_data, _tax_profile_data"> |
14 |
<condition> |
<condition> |
15 |
<and> |
<and> |
298 |
<datasource database="papo" name="ownDocumentDataSource" table="own_document" |
<datasource database="papo" name="ownDocumentDataSource" table="own_document" |
299 |
order_by="date" /> |
order_by="date" /> |
300 |
|
|
|
<!-- Este lo uso para tomar los datos de al sucursal actual en futuro debera ser compañando por un archide configuración --> |
|
|
<datasource database="papo" name="ownBranchDataSource" |
|
|
table="_entity_data, _own_entity_data, _own_branch_data, _persona_tax_profile_data, _tax_profile_data" prequery=""> |
|
|
<condition> |
|
|
<and> |
|
|
<eq> |
|
|
<cfield name="_entity_data._table"/> |
|
|
<cfield name="_own_entity_data.entity"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_own_entity_data._table"/> |
|
|
<cfield name="_own_branch_data.own_entity"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_entity_data._table"/> |
|
|
<cfield name="_persona_tax_profile_data.persona"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_tax_profile_data._table"/> |
|
|
<cfield name="_persona_tax_profile_data.tax_profile"/> |
|
|
</eq> |
|
|
<eq> |
|
|
<cfield name="_tax_profile_data.tax"/> |
|
|
<cconst value="1"/> <!-- Esto va para indicar que es IVA y no otro impuesto--> |
|
|
</eq> |
|
|
<null> |
|
|
<cfield name="_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_own_entity_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_own_branch_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_persona_tax_profile_data._end_t"/> |
|
|
</null> |
|
|
<null> |
|
|
<cfield name="_tax_profile_data._end_t"/> |
|
|
</null> |
|
|
</and> |
|
|
</condition> |
|
|
</datasource> |
|
|
|
|
301 |
<!-- Origen de datos que contiene el numero de la proxima factura --> |
<!-- Origen de datos que contiene el numero de la proxima factura --> |
302 |
<datasource name="branchDocumentDataSource" database="papo" |
<datasource name="branchDocumentDataSource" database="papo" |
303 |
table="branch_document, _branch_document_data" historytable="_branch_document_data"> |
table="branch_document, _branch_document_data" historytable="_branch_document_data"> |
534 |
proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp() |
proceedingBlock.dateEntry = proceedingDataSource.getTimeStamp() |
535 |
|
|
536 |
ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq') |
ownDocumentBlock.idEntry.autofillBySequence('own_document_id_seq') |
|
#typeValue = str(ownDocumentBlock.invoiceTypeEntry).strip().lower() |
|
|
#if typeValue == 'a': |
|
|
# ownDocumentBlock.typeEntry = "4" |
|
|
#elif typeValue == 'b': |
|
|
# ownDocumentBlock.typeEntry = "8" |
|
|
#elif typeValue == 'c': |
|
|
# ownDocumentBlock.typeEntry = "9" |
|
537 |
|
|
538 |
ownDocumentProceedingBlock.processRollback() |
ownDocumentProceedingBlock.processRollback() |
539 |
ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry) |
ownDocumentProceedingBlock.proceedingEntry = str(proceedingBlock.idEntry) |
558 |
ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4)) |
ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4)) |
559 |
ownItemToUpdBlock.processRollback() |
ownItemToUpdBlock.processRollback() |
560 |
|
|
|
#setFocus(ownDocumentBlock.clientRecipientBox.clientEntry) |
|
561 |
</trigger> |
</trigger> |
562 |
|
|
563 |
<trigger name="rollbackTrigger" type="NAMED"> |
<trigger name="rollbackTrigger" type="NAMED"> |
566 |
block.processRollback () |
block.processRollback () |
567 |
|
|
568 |
ownDocumentBlock.newRecord() |
ownDocumentBlock.newRecord() |
|
#branchDocumentBlock.initQuery() |
|
|
#branchDocumentBlock.processQuery() |
|
|
|
|
569 |
|
|
570 |
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
571 |
#setFocus(ownDocumentBlock.clientCodeEntry) |
#setFocus(ownDocumentBlock.clientCodeEntry) |
573 |
<trigger name="startUp" type="On-Startup"> |
<trigger name="startUp" type="On-Startup"> |
574 |
tmpValuesDataSource.priceTypeId = None |
tmpValuesDataSource.priceTypeId = None |
575 |
tmpValuesDataSource.onSwitch = "0" |
tmpValuesDataSource.onSwitch = "0" |
576 |
ownBranchBlock.processRollback() |
ownOrganizationBlock.processRollback() |
577 |
ownBranchBlock.initQuery() |
ownOrganizationBlock.initQuery() |
578 |
ownBranchBlock.processQuery() |
ownOrganizationBlock.processQuery() |
579 |
tmpValuesDataSource.ourIVACond = str(ownBranchBlock.condIVAEntry) |
tmpValuesDataSource.ownIVACond = str(ownOrganizationBlock.condIVAEntry) |
580 |
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
tmpBlock.tmpDateEntry = ownDocumentDataSource.getTimeStamp() |
581 |
</trigger> |
</trigger> |
582 |
|
|
598 |
lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount |
lItemPrice = (lQty * lUnitPrice) - lBonus - lDiscount |
599 |
|
|
600 |
sourceCode = str(tmpValuesDataSource.taxSourceCode) |
sourceCode = str(tmpValuesDataSource.taxSourceCode) |
601 |
ourIVACond = hack.a2f(tmpValuesDataSource.ourIVACond) |
ownIVACond = hack.a2f(tmpValuesDataSource.ownIVACond) |
602 |
alienIVACond = hack.a2f(tmpValuesDataSource.alienIVACond) |
alienIVACond = hack.a2f(tmpValuesDataSource.alienIVACond) |
603 |
amount = lItemPrice |
amount = lItemPrice |
604 |
taxPercent = hack.a2f(ownItemBlock.ivaEntry) |
taxPercent = hack.a2f(ownItemBlock.ivaEntry) |
605 |
|
|
606 |
exec(sourceCode) |
exec(sourceCode) |
607 |
ownItemBlock.taxAmountEntry = hack.a2f(graft(ourIVACond,alienIVACond,amount,taxPercent)) |
ownItemBlock.taxAmountEntry = hack.a2f(graft(ownIVACond,alienIVACond,amount,taxPercent)) |
608 |
ownItemBlock.itemNetoEntry = lItemPrice |
ownItemBlock.itemNetoEntry = lItemPrice |
609 |
ownItemBlock.itemTotalEntry = lItemPrice + hack.a2f(ownItemBlock.taxAmountEntry) |
ownItemBlock.itemTotalEntry = lItemPrice + hack.a2f(ownItemBlock.taxAmountEntry) |
610 |
|
|
803 |
tmpValuesDataSource.priceTypeId = clientResultSet.current.getField("_price_type_data._table") |
tmpValuesDataSource.priceTypeId = clientResultSet.current.getField("_price_type_data._table") |
804 |
# Calcula el tipo de factura qeu corresponde en funcion de la condicion ante el IVA de la empresa y la del cliente |
# Calcula el tipo de factura qeu corresponde en funcion de la condicion ante el IVA de la empresa y la del cliente |
805 |
clientIvaTaxProfle = int(str(tmpValuesDataSource.alienIVACond)) |
clientIvaTaxProfle = int(str(tmpValuesDataSource.alienIVACond)) |
806 |
lOrgResult = organizationDataSource.createResultSet() |
providerIvaTaxProfile = int(str(tmpValuesDataSource.ownIVACond)) |
|
if lOrgResult.firstRecord(): |
|
|
providerIvaTaxProfile = lOrgResult.current.getField('_tax_profile_data._table') |
|
|
else: |
|
|
providerIvaTaxProfile = 1 |
|
807 |
ownDocumentBlock.invoiceTypeEntry = hack.calcInvoiceType(clientIvaTaxProfle, providerIvaTaxProfile) |
ownDocumentBlock.invoiceTypeEntry = hack.calcInvoiceType(clientIvaTaxProfle, providerIvaTaxProfile) |
808 |
callTrigger('invoiceTypeValidation') |
callTrigger('invoiceTypeValidation') |
809 |
]]></trigger> |
]]></trigger> |
1268 |
|
|
1269 |
</block> |
</block> |
1270 |
</box> |
</box> |
1271 |
<block name="ownBranchBlock" datasource="ownBranchDataSource"> |
<block name="ownOrganizationBlock" datasource="ownOrganizationDataSource"> |
1272 |
<entry name="condIVAEntry" field="_tax_profile_data.tax" hidden="" x="1" y="1" width="10"/> |
<entry name="condIVAEntry" field="_tax_profile_data._table" hidden="" x="1" y="1" width="10"/> |
1273 |
</block> |
</block> |
1274 |
</page> |
</page> |
1275 |
</form> |
</form> |