﻿B4A=true
Group=Default Group
ModulesStructureVersion=1
Type=Class
Version=8.3
@EndOfDesignText@
'Custom View class 
#Event: ExampleEvent (Value As Int)
#DesignerProperty: Key: BooleanExample, DisplayName: Boolean Example, FieldType: Boolean, DefaultValue: True, Description: Example of a boolean property.
'#DesignerProperty: Key: IntExample, DisplayName: Int Example, FieldType: Int, DefaultValue: 10, MinRange: 0, MaxRange: 100, Description: Note that MinRange and MaxRange are optional.
#DesignerProperty: Key: cliClon, DisplayName: Clonado veces, FieldType: Int, DefaultValue: 0, MinRange: 0, MaxRange: 100, Description: esta propiedad representa las veces que se clono o replico un cliente. Mas usado para agregar un nuevo cliente Ocasional(1) y poder replicarlo para otros
#DesignerProperty: Key: cliCod, DisplayName: Codigo del cliente, FieldType: Int, DefaultValue: 0, MinRange: 0, MaxRange: 500, Description: Código del Cliente
'#DesignerProperty: Key: StringWithListExample, DisplayName: String With List, FieldType: String, DefaultValue: Sunday, List: Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday
'#DesignerProperty: Key: StringExample, DisplayName: String Example, FieldType: String, DefaultValue: Text
'#DesignerProperty: Key: ColorExample, DisplayName: Color Example, FieldType: Color, DefaultValue: 0xFFCFDCDC, Description: You can use the built-in color picker to find the color values.
'#DesignerProperty: Key: DefaultColorExample, DisplayName: Default Color Example, FieldType: Color, DefaultValue: Null, Description: Setting the default value to Null means that a nullable field will be displayed.

Sub Class_Globals
	Private mEventName As String 'ignore
	Private mCallBack As Object 'ignore
	Private mBase As Panel 'B4XView 'Panel
	'Private Const DefaultColorConstant As Int = -984833 'ignore
	
	'Private ShapeCli As Panel ' As B4XView ' No es necesario definirlo, al parecer se define cada vez que se va agregar
	Private lbconcre,lbruc,lbnom,lbmonto,lbcod,lbclon,lbdir,lbmeta,lbprop As Label ' lbconcre,
	Private lbResumCli As Label
	Private lbResumTot As Label
	Private lblAction1 As Label

	Public cliClon As Int = 0
	Public cliCod As Int =0

End Sub

Public Sub Initialize (Callback As Object, EventName As String ,fichaCliente As Map)
	mEventName = EventName
	mCallBack = Callback
End Sub

Public Sub DesignerCreateView (ShapeCli As Panel ,curClientes As Map, Props As Map) 
	mBase = ShapeCli
	Sleep(0)
	mBase.LoadLayout("ClienteCard2")
	
	cliClon = curClientes.Get("cli_clon")
	cliCod  = curClientes.Get("cli_codigo")

	Dim xConCre As Int = curClientes.Get("cli_concre")
	If xConCre=2 Then
		lbconcre.Text = "CR"
	Else
		lbconcre.Text = "CO"
	End If

	lbnom.Text = curClientes.Get("cli_descri")

	If curClientes.Get("cli_contacto")<>Null Then
		lbprop.Text = curClientes.Get("cli_contacto")
	Else
		lbprop.Text = ""
	End If

	If curClientes.Get("cli_ruc")<>Null Then
		lbruc.Text = "RUC:" & curClientes.Get("cli_ruc")
	Else
		lbruc.Text = "RUC:?"
	End If

	Dim elmonto As Double =curClientes.Get("total")
	lbmonto.Text = NumberFormat2(elmonto,0,0,0,False) ' xPriceDigDecimal,xPriceDigDecimal,False)

	lbdir.Text = curClientes.Get("cli_direcc")
    '
	mBase.Tag = Me ' " soy el tag de ClienteTarjeta"
	
End Sub

Public Sub GetBase As Panel
	Return mBase
End Sub
