164 |
# Calculo del total facturado |
# Calculo del total facturado |
165 |
rs = invTotDataSource.createResultSet(cond) |
rs = invTotDataSource.createResultSet(cond) |
166 |
more = rs.firstRecord() |
more = rs.firstRecord() |
|
invTotal = 0 |
|
167 |
|
|
168 |
while more: |
while more: |
169 |
print "un Documento",rs.current.getField("own_document.id") |
invTotal = 0 |
170 |
itemTot = 0 |
itemTot = 0 |
171 |
currOwnDoc = rs.current.getField("own_document.id") |
currOwnDoc = rs.current.getField("own_document.id") |
172 |
while rs.current.getField("own_document.id") == currOwnDoc and more: |
while rs.current.getField("own_document.id") == currOwnDoc and more: |
183 |
|
|
184 |
invTotal += itemTot - hack.a2f(rs.current.getField("own_document.bonus")) |
invTotal += itemTot - hack.a2f(rs.current.getField("own_document.bonus")) |
185 |
# Calcula los impuestos del documento en si |
# Calcula los impuestos del documento en si |
|
print invTotal |
|
186 |
odt_rs = invTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc}) |
odt_rs = invTaxTotDataSource.createResultSet({"own_document.id":currOwnDoc}) |
187 |
odt_more = odt_rs.firstRecord() |
odt_more = odt_rs.firstRecord() |
188 |
while odt_more: |
while odt_more: |
|
print " un Tax de Producto" |
|
189 |
invTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount")) |
invTotal += hack.a2f(odt_rs.current.getField("own_document_tax.amount")) |
190 |
odt_more = odt_rs.nextRecord() |
odt_more = odt_rs.nextRecord() |
191 |
|
|
193 |
tmpInvToPayedBlock.dateEntry = rs.current.getField("own_document.date") |
tmpInvToPayedBlock.dateEntry = rs.current.getField("own_document.date") |
194 |
tmpInvToPayedBlock.amountEntry = str(invTotal) |
tmpInvToPayedBlock.amountEntry = str(invTotal) |
195 |
tmpInvToPayedBlock.payedEntry = "0.0" |
tmpInvToPayedBlock.payedEntry = "0.0" |
|
print "Grabo ", tmpInvToPayedBlock.amountEntry |
|
196 |
tmpInvToPayedBlock.newRecord() |
tmpInvToPayedBlock.newRecord() |
197 |
|
|
198 |
# Busco las que ya han sido pagadas |
# Busco las que ya han sido pagadas |
211 |
# Busco las que ya han sido pagadas y lleno el block de pedido |
# Busco las que ya han sido pagadas y lleno el block de pedido |
212 |
rc = tmpInvToPayedBlock.getRecordCount() |
rc = tmpInvToPayedBlock.getRecordCount() |
213 |
for recNum in range(rc): |
for recNum in range(rc): |
|
print "Un documento que hay" |
|
214 |
tmpInvToPayedBlock.jumpRecord(recNum) |
tmpInvToPayedBlock.jumpRecord(recNum) |
215 |
if hack.a2f(tmpInvToPayedBlock.payedEntry) < hack.a2f(tmpInvToPayedBlock.amountEntry): |
if hack.a2f(tmpInvToPayedBlock.payedEntry) < hack.a2f(tmpInvToPayedBlock.amountEntry): |
|
print "Un documento A pagar" |
|
216 |
invoiceToPayedBlock.invoiceBox.idEntry = tmpInvToPayedBlock.idEntry |
invoiceToPayedBlock.invoiceBox.idEntry = tmpInvToPayedBlock.idEntry |
217 |
invoiceToPayedBlock.invoiceBox.dateEntry = tmpInvToPayedBlock.dateEntry |
invoiceToPayedBlock.invoiceBox.dateEntry = tmpInvToPayedBlock.dateEntry |
218 |
invoiceToPayedBlock.invoiceBox.amountEntry = tmpInvToPayedBlock.amountEntry |
invoiceToPayedBlock.invoiceBox.amountEntry = tmpInvToPayedBlock.amountEntry |
224 |
|
|
225 |
]]></trigger> |
]]></trigger> |
226 |
|
|
227 |
|
<trigger type="NAMED" name="cancelTrigger"><![CDATA[ |
228 |
|
import hack |
229 |
|
|
230 |
|
hack.rollback(invoiceToPayedBlock) |
231 |
|
hack.rollback(ownDocumentBlock) |
232 |
|
hack.rollback(tmpInvToPayedBlock) |
233 |
|
|
234 |
|
]]></trigger> |
235 |
|
|
236 |
|
<trigger type="NAMED" name="acceptTrigger"><![CDATA[ |
237 |
|
import hack |
238 |
|
|
239 |
|
rc = invoiceToPayedBlock.getRecordCount() |
240 |
|
|
241 |
|
for recNum in range(rc): |
242 |
|
invoiceToPayedBlock.jumpRecord(recNum) |
243 |
|
if hack.a2f(invoiceToPayedBlock.invoiceBox.payedEntry) > 0: |
244 |
|
print "hola" |
245 |
|
|
246 |
|
]]></trigger> |
247 |
|
|
248 |
<page name="Emision de Recibos"> |
<page name="Emision de Recibos"> |
249 |
|
|
250 |
<block datasource="ownDocumentDataSource" name="ownDocumentBlock"> |
<block datasource="ownDocumentDataSource" name="ownDocumentBlock"> |
251 |
<entry field="id" hidden="" name="idEntry" x="1" y="1"/> |
<entry field="id" hidden="" name="idEntry" x="1" y="1"/> |
252 |
<entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
<entry field="own_document_type" hidden="" name="typeEntry" x="1" y="1"/> |
253 |
<box height="5" label="Datos del Cliente" name="clientRecipientBox" width="65" x="0" y="1"> |
<box height="5" label="Datos del Cliente" name="clientRecipientBox" width="64" x="0" y="1"> |
254 |
<label name="clientLbl" text="Cliente" x="1" y="1" /> |
<label name="clientLbl" text="Cliente" x="1" y="1" /> |
255 |
<entry x="1" y="2" field="recipient" name="clientEntry" |
<entry x="1" y="2" field="recipient" name="clientEntry" |
256 |
width="40" style="dropdown" foreign_key="clientDataSource._entity_data._table" |
width="40" style="dropdown" foreign_key="clientDataSource._entity_data._table" |
270 |
|
|
271 |
<block name="invoiceToPayedBlock" datasource="invoiceToPayedDataSource"> |
<block name="invoiceToPayedBlock" datasource="invoiceToPayedDataSource"> |
272 |
<box height="12" label="Facturas Pendientes de Pago" name="invoiceBox" |
<box height="12" label="Facturas Pendientes de Pago" name="invoiceBox" |
273 |
width="65" x="0" y="8"> |
width="64" x="0" y="8"> |
274 |
<label name="dateLbl" text="Fecha" x="1" y="1"/> |
<label name="dateLbl" text="Fecha" x="1" y="1"/> |
275 |
<label name="amountLbl" text="Monto" x="10" y="1"/> |
<label name="amountLbl" text="Monto" x="13" y="1"/> |
276 |
<label name="payedLbl" text="Pagado" x="21" y="1"/> |
<label name="payedLbl" text="Pagado" x="24" y="1"/> |
277 |
<label name="payLbl" text="A Pagar" x="32" y="1"/> |
<label name="payLbl" text="A Pagar" x="35" y="1"/> |
278 |
|
|
279 |
<entry name="idEntry" field="id" hidden="" rows="8" x="1" y="2" width="1" /> |
<entry name="idEntry" field="id" hidden="" rows="8" x="1" y="2" width="1" /> |
280 |
<entry name="dateEntry" field="date" rows="8" x="1" y="2" width="8" readonly=""/> |
<entry name="dateEntry" field="date" rows="8" x="1" y="2" width="11" readonly=""/> |
281 |
<entry name="amountEntry" field="amount" rows="8" x="10" y="2" width="10" readonly=""/> |
<entry name="amountEntry" field="amount" rows="8" x="13" y="2" width="10" readonly=""/> |
282 |
<entry name="payedEntry" field="payed" rows="8" x="21" y="2" width="10" readonly=""/> |
<entry name="payedEntry" field="payed" rows="8" x="24" y="2" width="10" readonly=""/> |
283 |
<entry name="payEntry" field="pay" rows="8" x="32" y="2" width="10"/> |
<entry name="payEntry" field="pay" rows="8" x="35" y="2" width="10"/> |
284 |
<scrollbar page="2" x="43" y="2" width="1" height="8"/> |
<scrollbar page="2" x="46" y="2" width="1" height="8"/> |
285 |
|
|
286 |
|
<button name="acceptButton" trigger="acceptTrigger" label="Aceptar" |
287 |
|
width="10" height="1" x="49" y="8"/> |
288 |
|
<button name="cancelButton" trigger="cancelTrigger" label="Cancelar" |
289 |
|
width="10" height="1" x="49" y="9"/> |
290 |
</box> |
</box> |
291 |
</block> |
</block> |
292 |
|
|