$masterDatasource # el nombre del datasource del abm
$masterBlock => 'posEntityBlock'
$fields # una referencia a un array de referencias a hashes. Claves usadas: label, entry, width, name, field
$masterBoxLabel => 'Sucursal'
$detailBlockLabel => 'puntos de venta'
$name => 'Puntos de venta' # el nombre de la página (lo que dice en el tag de la página)
import gnue.common.GConditions as GConditions
import hack
#search conditions
#
# relation type -> pos_of
# entity relation from -> sucursal
# entity relation to -> caja1
#
condPosSearch = GConditions.GCondition()
tmpAnd = GConditions.GCand(condPosSearch)
#igualdades
eq1 = GConditions.GCeq(tmpAnd)
GConditions.GCField(eq1,"_entity_relation_data.entity_to")
GConditions.GCField(eq1,"_entity_data._table")
eq2 = GConditions.GCeq(tmpAnd)
GConditions.GCField(eq2,"_entity_relation_data.entity_from")
GConditions.GCConst(eq2,str($masterBlock.branchIdEntry))
eq3 = GConditions.GCeq(tmpAnd)
GConditions.GCField(eq3,"_entity_relation_data._table")
GConditions.GCField(eq3,"_relation_types_data.entity_relation")
eq4 = GConditions.GCeq(tmpAnd)
GConditions.GCField(eq4,"_relation_types_data.relation_type")
GConditions.GCConst(eq4,'"'.PAPO::posOfType.'"')
posDataSource.createResultSet(condPosSearch)
def searchPos ():
callTrigger("searchPosTrigger")
runForm ('ownPos.gfd', {
'master':$masterBlock,
'edit':"",
'callback': searchPos
})
def searchPos ():
callTrigger("searchPosTrigger")
runForm ('ownPos.gfd', {
'master':$masterBlock,
'edit':posBlock,
'callback': searchPos
})
my $x = 1; foreach (@$fields) {$x+=$_->{width};}