21 |
<cfield name="persona.id"/> |
<cfield name="persona.id"/> |
22 |
<cfield name="client.persona"/> |
<cfield name="client.persona"/> |
23 |
</eq> |
</eq> |
24 |
|
<null> |
25 |
|
<cfield name="entity.end_t"/> |
26 |
|
</null> |
27 |
</and> |
</and> |
28 |
</condition> |
</condition> |
29 |
</datasource> |
</datasource> |
100 |
if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.qtyEntry) > 0: |
if ownItemBlock.getRecordCount() > 0 and len(ownItemBlock.qtyEntry) > 0: |
101 |
if len(ownDocumentBlock.dateEntry) == 0: |
if len(ownDocumentBlock.dateEntry) == 0: |
102 |
ownDocumentBlock.dateEntry = mx.DateTime.localtime() |
ownDocumentBlock.dateEntry = mx.DateTime.localtime() |
103 |
ownDocumentBlock.processCommit() |
ownDocumentBlock.commit() |
104 |
lOwnDocId = "%s" % ownDocumentBlock.idEntry |
lOwnDocId = str(ownDocumentBlock.idEntry) |
|
ownItemBlock.processCommit() |
|
105 |
setFocus(ownDocumentBlock.dateEntry) |
setFocus(ownDocumentBlock.dateEntry) |
106 |
ownItemToUpdBlock.initQuery() |
ownItemToUpdBlock.initQuery() |
107 |
ownItemToUpdBlock.ownDocumentEntry = lOwnDocId |
ownItemToUpdBlock.ownDocumentEntry = lOwnDocId |
109 |
lRecordCount = ownItemToUpdBlock.getRecordCount() |
lRecordCount = ownItemToUpdBlock.getRecordCount() |
110 |
for recNum in range(lRecordCount): |
for recNum in range(lRecordCount): |
111 |
ownItemToUpdBlock.jumpRecord(recNum) |
ownItemToUpdBlock.jumpRecord(recNum) |
112 |
ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float("%s" % ownItemToUpdBlock.qtyEntry),4)) |
ownItemToUpdBlock.levelEntry.atomicModify(lambda x:x-round(float(str(ownItemToUpdBlock.qtyEntry)),4)) |
113 |
ownItemToUpdBlock.processRollback() |
ownItemToUpdBlock.processRollback() |
114 |
else: |
else: |
115 |
ownDocumentBlock.processRollback() |
ownDocumentBlock.processRollback() |
116 |
|
|
117 |
|
ownDocumentBlock.processRollback() |
118 |
|
ownItemBlock.processRollback() |
119 |
ownDocumentBlock.newRecord() |
ownDocumentBlock.newRecord() |
120 |
ownDocumentBlock.dateEntry = mx.DateTime.localtime() |
ownDocumentBlock.dateEntry = mx.DateTime.localtime() |
121 |
totalBlock.total = "" |
totalBlock.total = "" |
132 |
<trigger name="quitTrigger" type="NAMED"> |
<trigger name="quitTrigger" type="NAMED"> |
133 |
from gnue.forms.GFEvent import * |
from gnue.forms.GFEvent import * |
134 |
ownDocumentBlock.processRollback() |
ownDocumentBlock.processRollback() |
135 |
self._object.dispatchEvent(GFEvent('requestEXIT')) |
self.exit() |
136 |
</trigger> |
</trigger> |
137 |
|
|
138 |
<trigger name="totalCalcTrigger" type="NAMED"> |
<trigger name="totalCalcTrigger" type="NAMED"> |
140 |
lRecords = ownItemDataSource.getRecords() |
lRecords = ownItemDataSource.getRecords() |
141 |
for index in range(len(lRecords)): |
for index in range(len(lRecords)): |
142 |
lRecord = lRecords[index] |
lRecord = lRecords[index] |
143 |
lQty = eval("%s" % lRecord.getField("ownproditem.qty")) |
lQty = eval(str(lRecord.getField("ownproditem.qty"))) |
144 |
#print "cantidad:",lQty |
#print "cantidad:",lQty |
145 |
lBonus = eval("%s" % lRecord.getField("ownitem.bonus")) |
lBonus = eval(str(lRecord.getField("ownitem.bonus"))) |
146 |
lDiscount = eval("%s" % lRecord.getField("ownitem.discount")) |
lDiscount = eval(str(lRecord.getField("ownitem.discount"))) |
147 |
lResultSet = priceDataSource.createResultSet({"price.id":lRecord.getField("ownproditem.price")}) |
lResultSet = priceDataSource.createResultSet({"price.id":lRecord.getField("ownproditem.price")}) |
148 |
if (lResultSet.firstRecord()): |
if (lResultSet.firstRecord()): |
149 |
lUnitPrice = lResultSet.current.getField("price.unit_price") |
lUnitPrice = lResultSet.current.getField("price.unit_price") |
151 |
lUnitPrice = 0 |
lUnitPrice = 0 |
152 |
#print "lUnitPrice = ",lUnitPrice |
#print "lUnitPrice = ",lUnitPrice |
153 |
if (lQty == None): |
if (lQty == None): |
154 |
lQty = 0 |
lQty = 1 |
155 |
lRecord.setField("ownproditem.qty",1) |
lRecord.setField("ownproditem.qty",1) |
156 |
if (lBonus == None): |
if (lBonus == None): |
157 |
lBonus = 0 |
lBonus = 0 |
160 |
lDiscount = 0 |
lDiscount = 0 |
161 |
lRecord.setField("ownitem.discount",0.00) |
lRecord.setField("ownitem.discount",0.00) |
162 |
sum = sum + (lQty * lUnitPrice) - lBonus - lDiscount |
sum = sum + (lQty * lUnitPrice) - lBonus - lDiscount |
163 |
lHBonus = eval("%s" % ownDocumentDataSource.getCurrentRecord().getField("bonus")) |
lHBonus = eval(str(ownDocumentDataSource.getCurrentRecord().getField("bonus"))) |
164 |
if (lHBonus == None): |
if (lHBonus == None): |
165 |
lHBonus = 0 |
lHBonus = 0 |
166 |
ownDocumentBlock.hBonusEntry = "0.00" |
ownDocumentBlock.hBonusEntry = "0.00" |
167 |
sum = sum - lHBonus |
sum = sum - lHBonus |
168 |
totalBlock.total = "%s" % sum |
totalBlock.total = str(sum) |
169 |
</trigger> |
</trigger> |
170 |
|
|
171 |
<page name="Factura a Clientes"> |
<page name="Factura a Clientes"> |
174 |
|
|
175 |
<block datasource="ownDocumentDataSource" name="ownDocumentBlock"> |
<block datasource="ownDocumentDataSource" name="ownDocumentBlock"> |
176 |
<trigger name="t" type="Pre-Insert"> |
<trigger name="t" type="Pre-Insert"> |
177 |
if (ownDocumentBlock.idEntry == ""): |
ownDocumentBlock.idEntry.autofillBySequence('owndocument_id_seq') |
|
ownDocumentBlock.idEntry.autofillBySequence('owndocument_id_seq') |
|
178 |
ownDocumentBlock.typeEntry = "1" |
ownDocumentBlock.typeEntry = "1" |
179 |
</trigger> |
</trigger> |
180 |
|
|
188 |
width="30" style="dropdown" foreign_key="clientDataSource.entity.id" |
width="30" style="dropdown" foreign_key="clientDataSource.entity.id" |
189 |
foreign_key_description="entity.name" > |
foreign_key_description="entity.name" > |
190 |
<trigger type="PRE-FOCUSOUT" name="showScoreTrigger"> |
<trigger type="PRE-FOCUSOUT" name="showScoreTrigger"> |
191 |
ownDocumentBlock.clientRecipientBox.scoreEntry = "%s" % ownDocumentBlock.clientRecipientBox.clientEntry |
ownDocumentBlock.clientRecipientBox.scoreEntry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
192 |
ownDocumentBlock.clientRecipientBox.creditLimit1Entry = "%s" % ownDocumentBlock.clientRecipientBox.clientEntry |
ownDocumentBlock.clientRecipientBox.creditLimit1Entry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
193 |
ownDocumentBlock.clientRecipientBox.creditLimit2Entry = "%s" % ownDocumentBlock.clientRecipientBox.clientEntry |
ownDocumentBlock.clientRecipientBox.creditLimit2Entry = str(ownDocumentBlock.clientRecipientBox.clientEntry) |
194 |
</trigger> |
</trigger> |
195 |
<trigger type="PRE-FOCUSIN" name="showScoreTrigger"> |
<trigger type="PRE-FOCUSIN" name="showScoreTrigger"> |
196 |
ownDocumentBlock.clientRecipientBox.scoreEntry = "" |
ownDocumentBlock.clientRecipientBox.scoreEntry = "" |
243 |
ownItemBlock.ownDocumentEntry = ownDocumentBlock.idEntry |
ownItemBlock.ownDocumentEntry = ownDocumentBlock.idEntry |
244 |
</trigger> |
</trigger> |
245 |
|
|
|
<trigger name="insertItemTrigger" type="NAMED"> |
|
|
from gnue.forms.GFEvent import * |
|
|
ownItemBlock.newRecord() |
|
|
</trigger> |
|
246 |
<entry field="ownitem.own_document" name="ownDocumentEntry" hidden="" x="1" y="1"/> |
<entry field="ownitem.own_document" name="ownDocumentEntry" hidden="" x="1" y="1"/> |
247 |
|
|
248 |
<label name="qtyLbl" text="Cantidad" x="2" y="1"/> |
<label name="qtyLbl" text="Cantidad" x="2" y="1"/> |
254 |
width="20" rows="5" style="dropdown" foreign_key="priceDataSource.price.id" |
width="20" rows="5" style="dropdown" foreign_key="priceDataSource.price.id" |
255 |
foreign_key_description="product.name"> |
foreign_key_description="product.name"> |
256 |
<trigger type="PRE-FOCUSOUT" name="showPriceTrigger"> |
<trigger type="PRE-FOCUSOUT" name="showPriceTrigger"> |
257 |
ownItemBlock.priceEntry = "%s" % ownItemBlock.productPriceEntry |
ownItemBlock.priceEntry = str(ownItemBlock.productPriceEntry) |
258 |
</trigger> |
</trigger> |
259 |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
<trigger type="PRE-FOCUSOUT" src="totalCalcTrigger" /> |
260 |
</entry> |
</entry> |