VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FreemplazoporTpc 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Precio de TPC"
   ClientHeight    =   3795
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   5910
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3795
   ScaleWidth      =   5910
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton CMD_CANCELAR 
      Cancel          =   -1  'True
      Caption         =   "Cancelar"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   705
      Left            =   4215
      Picture         =   "FreemplazoporTpc.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   3015
      Width           =   1560
   End
   Begin VB.CommandButton CMD_ACEPTAR 
      Caption         =   "Aceptar"
      Default         =   -1  'True
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   705
      Left            =   2520
      Picture         =   "FreemplazoporTpc.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   2
      Tag             =   "R ASDASD"
      Top             =   3030
      Width           =   1560
   End
   Begin VB.Frame FraprecioTpc 
      Height          =   1890
      Left            =   30
      TabIndex        =   0
      Top             =   1050
      Width           =   5730
      Begin MSDataGridLib.DataGrid dbpreciotpc 
         Height          =   1530
         Left            =   90
         TabIndex        =   1
         Top             =   240
         Width           =   5535
         _ExtentX        =   9763
         _ExtentY        =   2699
         _Version        =   393216
         HeadLines       =   1
         RowHeight       =   15
         BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ColumnCount     =   2
         BeginProperty Column00 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   3082
               SubFormatType   =   0
            EndProperty
         EndProperty
         BeginProperty Column01 
            DataField       =   ""
            Caption         =   ""
            BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
               Type            =   0
               Format          =   ""
               HaveTrueFalseNull=   0
               FirstDayOfWeek  =   0
               FirstWeekOfYear =   0
               LCID            =   3082
               SubFormatType   =   0
            EndProperty
         EndProperty
         SplitCount      =   1
         BeginProperty Split0 
            BeginProperty Column00 
            EndProperty
            BeginProperty Column01 
            EndProperty
         EndProperty
      End
   End
   Begin VB.Label lblcodcliente 
      Height          =   285
      Left            =   3750
      TabIndex        =   11
      Top             =   765
      Visible         =   0   'False
      Width           =   1650
   End
   Begin VB.Label lblcodalmacen 
      Height          =   255
      Left            =   3075
      TabIndex        =   10
      Top             =   795
      Visible         =   0   'False
      Width           =   705
   End
   Begin VB.Label lblalmacen 
      BackColor       =   &H80000009&
      BorderStyle     =   1  'Fixed Single
      Height          =   270
      Left            =   1065
      TabIndex        =   9
      Top             =   780
      Width           =   1920
   End
   Begin VB.Label Label3 
      Caption         =   "Almacén"
      Height          =   285
      Left            =   75
      TabIndex        =   8
      Top             =   780
      Width           =   1125
   End
   Begin VB.Label lbldescripcion 
      BackColor       =   &H8000000E&
      BorderStyle     =   1  'Fixed Single
      Height          =   270
      Left            =   1065
      TabIndex        =   7
      Top             =   435
      Width           =   4185
   End
   Begin VB.Label lblcodigo 
      BackColor       =   &H80000009&
      BorderStyle     =   1  'Fixed Single
      Height          =   270
      Left            =   1050
      TabIndex        =   6
      Top             =   120
      Width           =   1470
   End
   Begin VB.Label Label2 
      Caption         =   "Descripción"
      Height          =   255
      Left            =   90
      TabIndex        =   5
      Top             =   465
      Width           =   1065
   End
   Begin VB.Label Label1 
      Caption         =   "Código"
      Height          =   300
      Left            =   105
      TabIndex        =   4
      Top             =   120
      Width           =   1125
   End
End
Attribute VB_Name = "FreemplazoporTpc"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private MobjCobranzas As DB_AR_CUENTASCOBRAR.C_COBRANZAS
Public Sub FormatoGrilla()
   
   dbpreciotpc.Columns(0).Visible = False
   dbpreciotpc.Columns(1).Caption = "TPC"
   dbpreciotpc.Columns(2).Visible = False
   dbpreciotpc.Columns(3).Visible = False
   dbpreciotpc.Columns(4).Alignment = dbgRight
   dbpreciotpc.Columns(4).Caption = "Precio_TPC"
   dbpreciotpc.Columns(4).NumberFormat = GMascara(GintDecPrecio)
   dbpreciotpc.Columns(5).Visible = False
   dbpreciotpc.Columns(6).Visible = False
      
End Sub

Private Sub CMD_ACEPTAR_Click()

   If MsgBox("Seguro que desea Actualizar ", vbQuestion + vbYesNo, "Advertencia") = vbYes Then
      'Hay que que Validar que el precio este en la moneda del Artículo
      If Not IsNull(dbpreciotpc.Bookmark) Then
       If FDocuPorCobrar.Dtcmoneda.BoundText = dbpreciotpc.Columns(5).Text Then
         'Ar_Actualizar_PrecioProc
        
         
           MobjCobranzas.ActualizarPrecios FDocuPorCobrar.MDblCorrelativo, FDocuPorCobrar.Dtcmoneda.BoundText, _
                                           lblcodalmacen.Caption, lblcodigo.Caption, dbpreciotpc.Columns(4).Text, _
                                           FDocuPorCobrar.LblTipoCambio.Caption, FDocuPorCobrar.lblcodcliente.Caption
                                          
           FDocuPorCobrar.RefrescarGrilla
           FDocuPorCobrar.ActulizaTotalesResumen
           Unload Me
       Else
           MsgBox "Moneda de Precio TPC es diferente a la moneda en que se está Procesando ", vbDefaultButton1 + vbExclamation, "No se puede Actualizar"
           Unload Me
       End If
      Else
        MsgBox "No existe TPC para Actualizar", vbDefaultButton1 + vbExclamation, "Advertencia"
      End If
   End If
End Sub

Private Sub CMD_CANCELAR_Click()
  Unload Me
End Sub

Private Sub Form_Load()

   ' " SELECT OP_CUSTOMER_PRCLVL.custidss,OP_PRCLVLCUST.PRCLVLCUSTID, " & _
   ' " dbo.OP_PRCLVLCUST.SITEID,dbo.OP_PRCLVLCUSTDET.INVTIDSKU,dbo.OP_PRCLVLCUSTDET.SLS_PRICECUST, " & _
   ' " dbo.OP_PRCLVLCUST.CURYID , dbo.OP_PRCLVLCUSTDET.SLS_PRICE " & _
   ' " From dbo.OP_CUSTOMER_PRCLVL " & _
   ' " INNER JOIN dbo.OP_PRCLVLCUST " & _
   ' " ON dbo.OP_CUSTOMER_PRCLVL.PRCLVLCUSTID = dbo.OP_PRCLVLCUST.PRCLVLCUSTID " & _
   ' " INNER JOIN  dbo.OP_PRCLVLCUSTDET " & _
   ' " ON dbo.OP_PRCLVLCUST.PRCLVLCUSTID = dbo.OP_PRCLVLCUSTDET.PRCLVLCUSTID AND " & _
   ' " dbo.OP_PRCLVLCUST.SITEID = dbo.OP_PRCLVLCUSTDET.SITEID " & _
   ' " WHERE STATUS=1 AND dbo.OP_PRCLVLCUST.SITEID='" & StrAlmacen & "' AND " & _
   ' " INVTIDSKU='" & StrArticulo & "' AND dbo.OP_CUSTOMER_PRCLVL.custidss='" & _
   ' StrCliente & "'"
   
   Me.Top = (Screen.Width - Me.Width) / 2
   Me.Left = (Screen.Height - Me.Height) / 2
   
   
   lblalmacen.Caption = FDocuPorCobrar.Dbresumenarticulos.Columns(1).Text

   Set MobjCobranzas = New DB_AR_CUENTASCOBRAR.C_COBRANZAS
   Set dbpreciotpc.DataSource = MobjCobranzas.ObtenerPrecioTpcArticulo(FDocuPorCobrar.Dbresumenarticulos.Columns(0).Text, _
                                FDocuPorCobrar.Dbresumenarticulos.Columns(2).Text, _
                                FDocuPorCobrar.lblcodcliente.Caption)
   dbpreciotpc.Refresh
    
   FormatoGrilla
   
End Sub

Private Sub Form_Unload(Cancel As Integer)
   Set MobjCobranzas = Nothing
End Sub


