$document_name => ''
$document_type_A => ''
$document_type_B => ''
$document_type_C => ''
$stock_alta => ''
$stock_borrado => ''
#cargo el own-pos entity id
callTrigger('searchOwnPosData')
#/cargo el own-pos entity id
= 0.5
from gnue.common.events.Event import Event as GFEvent
# busy clock
self._object.dispatchEvent(GFEvent('beginWAIT'))
]]>
= 0.5
from gnue.common.events.Event import Event as GFEvent
self._object.dispatchEvent(GFEvent('endWAIT'))
setStatusText("Listo")
]]>
clear()
callTrigger('searchOwnPosData')
if genericBox("¿ Está seguro que desea borrar ?",['Sí','No']) == 1 and ownDocumentShowBlock.idEntry \
and len(str(ownDocumentShowBlock.idEntry).strip()):
from gnue.common.GDataObjects import ConnectionError as DBError
try:
lOwnDocId = str(ownDocumentShowBlock.idEntry)
ownDocumentProceedingShowBlock.initQuery()
ownDocumentProceedingShowBlock.ownDocumentEntry = lOwnDocId
ownDocumentProceedingShowBlock.processQuery()
proceedingId = str(ownDocumentProceedingShowBlock.proceedingEntry)
ownDocumentProceedingShowBlock.deleteRecord()
postChangeAdvance = 0
ownDocumentProceedingShowBlock.postChanges()
if proceedingId:
currencyMovementBlock.initQuery()
currencyMovementBlock.proceedingEntry = proceedingId
currencyMovementBlock.processQuery()
postChangeAdvance = 1
rc = currencyMovementBlock.getRecordCount()
for recNum in range(rc):
currencyMovementBlock.jumpRecord(recNum)
currencyMovementBlock.deleteRecord()
currencyMovementBlock.postChanges()
proceedingBlock.initQuery()
proceedingBlock.idEntry = proceedingId
proceedingBlock.processQuery()
postChangeAdvance = 2
proceedingBlock.deleteRecord()
proceedingBlock.postChanges()
postChangeAdvance = 3
tmpValuesDataSource.idEntry = str(ownDocumentShowBlock.idEntry)
if ($document_type_A eq "13") {
if not str(ownPosBlock.stockByInvoice) == "1":
} else {
if str(ownPosBlock.stockByInvoice) == "1":
}
print "llamado al trigger"
callTrigger('$stock_borrado')
lRecordCount = ownItemShowBlock.getRecordCount()
for recNum in range(lRecordCount):
ownItemShowBlock.jumpRecord(recNum)
ownItemTaxShowBlock.initQuery()
ownItemTaxShowBlock.ownItemEntry = str(ownItemShowBlock.idEntry)
ownItemTaxShowBlock.processQuery()
lTaxRecordCount = ownItemTaxShowBlock.getRecordCount()
for taxRecNum in range(lTaxRecordCount):
ownItemTaxShowBlock.jumpRecord(taxRecNum)
ownItemTaxShowBlock.deleteRecord()
ownItemTaxShowBlock.postChanges()
ownItemDeleteBlock.initQuery()
ownItemDeleteBlock.idEntry = str(ownItemShowBlock.idEntry)
ownItemDeleteBlock.processQuery()
ownItemDeleteBlock.deleteRecord()
ownItemDeleteBlock.postChanges()
ownItemShowBlock.clear()
postChangeAdvance = 4
if ($document_type_A ne "13") {
ownDocumentTaxShowBlock.initQuery()
ownDocumentTaxShowBlock.ownDocumentEntry = tmpValuesDataSource.idEntry
ownDocumentTaxShowBlock.processQuery()
lRecordCount = ownDocumentTaxShowBlock.getRecordCount()
for recNum in range(lRecordCount):
ownDocumentTaxShowBlock.jumpRecord(recNum)
ownDocumentTaxShowBlock.deleteRecord()
ownDocumentTaxShowBlock.postChanges()
postChangeAdvance = 5
}
ownDocumentShowBlock.deleteRecord()
ownDocumentShowBlock.postChanges()
commitConnection()
except DBError, err:
rollbackConnection()
callTrigger('rollbackTrigger')
message = ["'el procedimiento de la '.$document_name",
"'Los Montos de la '.$document_name",
"el procedimiento","'los Items de la '.$document_name",
if ($document_type_A ne "13") {
"'los impuestos de la '.$document_name",
}
"'la '.$document_name"]
genericBox("Hay problemas para borrar "+message[postChangeAdvance]+"\n"+str(err),['Aceptar'])
if ($document_type_A ne "13") {
totalShowBlock.ivaEntry = "0.00"
totalShowBlock.netoEntry = "0.00"
totalShowBlock.totalEntry = "0.00"
totalShowBlock.clear()
}
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():
typeInvoice = int(str(ownDocumentShowBlock.typeEntry))
result = ""
if typeInvoice == 4:
result = "A"
elif typeInvoice == 8:
result = "B"
elif typeInvoice == 9:
result = "C"
ownDocumentShowBlock.invoiceTypeEntry = result
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():
import hack
recordCount = ownItemShowBlock.getRecordCount()
ownItemShowBlock.firstRecord()
for index in range(recordCount):
ownItemShowBlock.jumpRecord(index)
try:
ownItemShowBlock.taxPercentEntry = round(hack.a2f(ownItemShowBlock.taxAmountEntry,2) / \
hack.a2f(ownItemShowBlock.unitPriceEntry,2) / \
hack.a2f(ownItemShowBlock.qtyEntry,2) * 100,0)
except:
print "Error en el calculo del total"
pass
ownItemShowBlock.firstRecord()
totalShowBlock.totalEntry = str(hack.a2f(totalShowBlock.netoEntry,2)+hack.a2f(totalShowBlock.ivaEntry,2))
else:
totalShowBlock.clear()
clear()
resultBlock.clear()
import gnue.common.GConditions as GConditions
import hack
searchCond = GConditions.GCondition()
tmpAnd = GConditions.GCand(searchCond)
if hack.emptyEntry(ownDocumentSearchBlock.clientSEntry):
like = GConditions.GClike(tmpAnd)
GConditions.GCField(like,"own_document.recipient")
GConditions.GCConst(like,str(ownDocumentSearchBlock.clientSEntry))
if hack.emptyEntry(ownDocumentSearchBlock.numberSEntry):
like1 = GConditions.GClike(tmpAnd)
GConditions.GCField(like1,"own_document.number")
GConditions.GCConst(like1,str(ownDocumentSearchBlock.numberSEntry)+" %")
if hack.emptyEntry(ownDocumentSearchBlock.dateSEntry):
endTime = hack.addNDaysToDate(ownDocumentSearchBlock.dateSEntry)
ge = GConditions.GCge(tmpAnd)
GConditions.GCField(ge,"own_document.date")
GConditions.GCConst(ge,str(ownDocumentSearchBlock.dateSEntry))
lt = GConditions.GClt(tmpAnd)
GConditions.GCField(lt,"own_document.date")
GConditions.GCConst(lt,endTime)
try:
resultOwnDocumentDataSource.createResultSet(searchCond)
except GConditions.ConditionError:
resultOwnDocumentDataSource.createResultSet()
genericBox("No implementado",["Aceptar"])
codeToSearch = str(ownDocumentSearchBlock.clientCodeSEntry)
nameToSearch = str(ownDocumentSearchBlock.clientNameSEntry)
callTrigger('startWaitingModeTrigger')
clientResultBlock.reset()
clientResultBlock.initQuery()
if codeToSearch:
clientResultBlock.uidEntry = codeToSearch+"%"
if nameToSearch:
clientResultBlock.nameEntry = nameToSearch+"%"
clientResultBlock.processQuery()
callTrigger('endWaitingModeTrigger')
recordCount = clientResultBlock.getRecordCount()
if recordCount > 1:
def callback (returnValue):
global block
if returnValue >= 0:
clientResultBlock.jumpRecord(returnValue)
callTrigger('afterClientSearchTrigger')
runForm ('clientSelect.gfd', {'data': clientResultBlock, 'callback': callback})
elif recordCount == 1:
clientResultBlock.jumpRecord(0)
callTrigger('afterClientSearchTrigger')
ownDocumentSearchBlock.clientCodeSEntry = str(clientResultBlock.uidEntry)
ownDocumentSearchBlock.clientNameSEntry = str(clientResultBlock.nameEntry)
ownDocumentSearchBlock.clientSEntry = str(clientResultBlock.idEntry)
import hack
ownDocumentShowBlock.clear()
ownItemShowBlock.clear()
if resultBlock.getRecordCount() > 0 and not resultBlock.getCurrentRecord().isEmpty():
ownDocumentShowBlock.initQuery()
ownDocumentShowBlock.idEntry = ("%s" % resultBlock.idREntry)
ownDocumentShowBlock.processQuery()
ownItemShowBlock.initQuery()
ownItemShowBlock.ownDocumentEntry = ("%s" % ownDocumentShowBlock.idEntry)
ownItemShowBlock.processQuery()
recordCount = ownItemShowBlock.getRecordCount()
ownItemShowBlock.firstRecord()
if str(ownDocumentShowBlock.isVoidEntry):
ownDocumentShowBlock.stateEntry = "ANULADA"
else:
ownDocumentShowBlock.stateEntry = "Vigente"
runForm('client.gfd')
runForm('product.gfd')
if ($document_type_A ne "13") {
}
if ($document_type_A ne "13") {
}
if ($document_type_A ne "13") {
}
if ($document_type_A ne "13") {
}