165 |
ownDocumentResultSet = ownDocumentDataSource.createResultSet(condProductInvoice) |
ownDocumentResultSet = ownDocumentDataSource.createResultSet(condProductInvoice) |
166 |
more = ownDocumentResultSet.firstRecord() |
more = ownDocumentResultSet.firstRecord() |
167 |
while more: |
while more: |
168 |
if not invoiceToPayedBlock.getCurrentRecord().isEmpty(): |
monto = hack.a2f(ownDocumentResultSet.current.getField("own_document.tax_total"),2) + hack.a2f(ownDocumentResultSet.current.getField("own_document.net_total"),2) |
|
invoiceToPayedBlock.newRecord() |
|
|
|
|
|
if ownDocumentResultSet.current.getField("own_document.own_document_type") < 10: |
|
|
invoiceToPayedBlock.invoiceBox.docEntry = "Fac" |
|
|
else: |
|
|
invoiceToPayedBlock.invoiceBox.docEntry = "NC " |
|
|
|
|
|
invoiceToPayedBlock.invoiceBox.typeEntry = documentType[str(ownDocumentResultSet.current.getField("own_document.own_document_type"))] |
|
|
invoiceToPayedBlock.invoiceBox.numberEntry = str(ownDocumentResultSet.current.getField("own_document.number")) |
|
|
invoiceToPayedBlock.invoiceBox.dateEntry = str(ownDocumentResultSet.current.getField("own_document.date")) |
|
|
invoiceToPayedBlock.invoiceBox.amountEntry = str(hack.a2f(ownDocumentResultSet.current.getField("own_document.tax_total")) + hack.a2f(ownDocumentResultSet.current.getField("own_document.net_total"))) |
|
169 |
|
|
170 |
pagado = 0.0 |
pagado = 0.0 |
171 |
proceeding = GConditions.GCondition() |
proceedingResultSet = ownDocumentProceedingDataSource.createResultSet({'own_document':str(ownDocumentResultSet.current.getField("own_document.id"))}) |
172 |
eq = GConditions.GCeq(condProductInvoice) |
rs = proceedingResultSet.firstRecord() |
|
GConditions.GCField(eq,"own_document") |
|
|
GConditions.GCConst(eq,str(ownDocumentResultSet.current.getField("own_document.number"))) |
|
|
|
|
|
ownDocumentProceedingResultSet = ownDocumentDataSource.createResultSet(proceeding) |
|
|
rs = ownDocumentProceedingResultSet.firstRecord() |
|
173 |
while rs: |
while rs: |
174 |
pagado += ownDocumentProceedingResultSet.current.getField("amount") |
pagado += hack.a2f(proceedingResultSet.current.getField("amount"),2) |
175 |
rs = ownDocumentProceedingResultSet.nextRecord() |
rs = proceedingResultSet.nextRecord() |
|
|
|
|
invoiceToPayedBlock.invoiceBox.totalEntry = str(pagado) |
|
|
|
|
|
total += hack.a2f(invoiceToPayedBlock.invoiceBox.amountEntry) |
|
|
more = ownDocumentResultSet.nextRecord() |
|
176 |
|
|
177 |
|
if pagado != monto: |
178 |
|
if not invoiceToPayedBlock.getCurrentRecord().isEmpty(): |
179 |
|
invoiceToPayedBlock.newRecord() |
180 |
|
|
181 |
|
if ownDocumentResultSet.current.getField("own_document.own_document_type") < 10: |
182 |
|
invoiceToPayedBlock.invoiceBox.docEntry = "Fac" |
183 |
|
else: |
184 |
|
invoiceToPayedBlock.invoiceBox.docEntry = "NC " |
185 |
|
|
186 |
|
invoiceToPayedBlock.invoiceBox.typeEntry = documentType[str(ownDocumentResultSet.current.getField("own_document.own_document_type"))] |
187 |
|
invoiceToPayedBlock.invoiceBox.numberEntry = str(ownDocumentResultSet.current.getField("own_document.number")) |
188 |
|
invoiceToPayedBlock.invoiceBox.dateEntry = str(ownDocumentResultSet.current.getField("own_document.date")) |
189 |
|
invoiceToPayedBlock.invoiceBox.payedEntry = str(pagado) |
190 |
|
invoiceToPayedBlock.invoiceBox.amountEntry = str(monto) |
191 |
|
|
192 |
|
total += monto - pagado |
193 |
|
|
194 |
|
more = ownDocumentResultSet.nextRecord() |
195 |
|
|
196 |
invoiceToPayedBlock.invoiceBox.totalEntry = str(total) |
invoiceToPayedBlock.invoiceBox.totalEntry = str(total) |
197 |
callTrigger('endWaitingModeTrigger') |
callTrigger('endWaitingModeTrigger') |
208 |
if rc > 0: |
if rc > 0: |
209 |
callTrigger('startWaitingModeTrigger') |
callTrigger('startWaitingModeTrigger') |
210 |
import printing |
import printing |
211 |
|
import hack |
212 |
|
|
213 |
table = [] |
table = [] |
214 |
line = "\n\nListado de Cuenta Corrientes de Clientes\n\n\n" |
line = "\n\nListado de Cuenta Corrientes de Clientes\n\n\n" |
215 |
table.append(line) |
table.append(line) |
216 |
|
|
217 |
line = printing.printTitle("Documento",12) |
line = printing.printTitle("Documento",14) + '|' |
218 |
line += printing.printTitle("Numero",15) |
line += printing.printTitle("Fecha",11) + '|' |
219 |
line += printing.printTitle("Fecha",15) |
line += printing.printTitle("Monto",15) + '|' |
220 |
line += printing.printTitle("Importe",15) |
line += printing.printTitle("Pagado",15) + '|' |
221 |
|
line += printing.printTitle("Saldo",15) |
222 |
table.append(line) |
table.append(line) |
223 |
|
|
224 |
for recNum in range(rc): |
for recNum in range(rc): |
225 |
invoiceToPayedBlock.jumpRecord(recNum) |
invoiceToPayedBlock.jumpRecord(recNum) |
226 |
line = printing.printField(invoiceToPayedBlock.invoiceBox.docEntry,4) |
line = printing.printField(invoiceToPayedBlock.invoiceBox.docEntry,4) |
227 |
line += printing.printField(invoiceToPayedBlock.invoiceBox.typeEntry,2) |
line += printing.printField(invoiceToPayedBlock.invoiceBox.typeEntry,2) |
228 |
line += printing.printField(invoiceToPayedBlock.invoiceBox.numberEntry,8) |
line += printing.printField(invoiceToPayedBlock.invoiceBox.numberEntry,8) + '|' |
229 |
line += printing.printField(invoiceToPayedBlock.invoiceBox.dateEntry,11) |
line += printing.printField(invoiceToPayedBlock.invoiceBox.dateEntry,11) + '|' |
230 |
line += printing.printField(invoiceToPayedBlock.invoiceBox.amountEntry,14,'r') |
line += printing.printField(invoiceToPayedBlock.invoiceBox.amountEntry,15,'r') + '|' |
231 |
|
line += printing.printField(invoiceToPayedBlock.invoiceBox.payedEntry,15,'r') + '|' |
232 |
|
line += printing.printField(str(hack.a2f(invoiceToPayedBlock.invoiceBox.amountEntry,2) - hack.a2f(invoiceToPayedBlock.invoiceBox.payedEntry,2)),15,'r') |
233 |
table.append(line) |
table.append(line) |
234 |
|
|
235 |
callTrigger('endWaitingModeTrigger') |
callTrigger('endWaitingModeTrigger') |
326 |
<box height="12" label="Documentos" name="invoiceBox" |
<box height="12" label="Documentos" name="invoiceBox" |
327 |
width="74" x="0" y="8"> |
width="74" x="0" y="8"> |
328 |
<label name="numberLbl" text="Numero" x="1" y="1"/> |
<label name="numberLbl" text="Numero" x="1" y="1"/> |
329 |
<label name="dateLbl" text="Fecha" x="12" y="1"/> |
<label name="dateLbl" text="Fecha" x="18" y="1"/> |
330 |
<label name="amountLbl" text="Monto" x="23" y="1"/> |
<label name="amountLbl" text="Monto" x="31" y="1"/> |
331 |
<label name="payedLbl" text="Pagado" x="34" y="1"/> |
<label name="payedLbl" text="Pagado" x="52" y="1"/> |
332 |
|
|
333 |
<entry name="idEntry" field="id" style="label" hidden="" rows="8" x="1" y="2" width="1" /> |
<entry name="idEntry" field="id" style="label" hidden="" rows="8" x="1" y="2" width="1" /> |
334 |
<entry name="docEntry" field="doc" style="label" rows="8" |
<entry name="docEntry" field="doc" style="label" rows="8" |
340 |
<entry name="dateEntry" field="date" style="label" rows="8" |
<entry name="dateEntry" field="date" style="label" rows="8" |
341 |
x="18" y="2" width="11" readonly=""/> |
x="18" y="2" width="11" readonly=""/> |
342 |
<entry name="amountEntry" field="amount" style="label" rows="8" |
<entry name="amountEntry" field="amount" style="label" rows="8" |
343 |
typecast="number" displaymask="%0.2f" |
typecast="number" displaymask="%8.2f" |
344 |
x="31" y="2" width="10" readonly=""/> |
x="31" y="2" width="10" readonly=""/> |
345 |
|
<entry name="payedEntry" field="payed" style="label" rows="8" |
346 |
|
typecast="number" displaymask="%8.2f" |
347 |
|
x="52" y="2" width="10" readonly=""/> |
348 |
<entry name="totalEntry" field="total" style="label" x="60" y="6" |
<entry name="totalEntry" field="total" style="label" x="60" y="6" |
349 |
width="10" readonly="" typecast="number" displaymask="%0.2f"/> |
width="10" readonly="" typecast="number" displaymask="%8.2f"/> |
350 |
</box> |
</box> |
351 |
</block> |
</block> |
352 |
|
|