VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form FAcumulado 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Acumulado por Artículo"
   ClientHeight    =   4740
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   9705
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4740
   ScaleWidth      =   9705
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdsalir 
      Cancel          =   -1  'True
      Caption         =   "Salir"
      Height          =   540
      Left            =   7950
      TabIndex        =   4
      Top             =   4080
      Width           =   1695
   End
   Begin VB.Frame Frame1 
      Height          =   3915
      Left            =   75
      TabIndex        =   0
      Top             =   45
      Width           =   9555
      Begin MSDataGridLib.DataGrid Dbresumenarticulos 
         Height          =   3045
         Left            =   135
         TabIndex        =   1
         ToolTipText     =   "El precio es el último registrado en el rango de fechas seleccionado"
         Top             =   225
         Width           =   9300
         _ExtentX        =   16404
         _ExtentY        =   5371
         _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
      Begin VB.Label lbltotal 
         Alignment       =   1  'Right Justify
         Appearance      =   0  'Flat
         BackColor       =   &H80000004&
         BorderStyle     =   1  'Fixed Single
         Caption         =   "0.00"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   315
         Left            =   8130
         TabIndex        =   3
         Top             =   3435
         Width           =   1275
      End
      Begin VB.Label lbltotalmon 
         Caption         =   "Total"
         Height          =   255
         Left            =   7350
         TabIndex        =   2
         Top             =   3495
         Width           =   825
      End
   End
End
Attribute VB_Name = "FAcumulado"
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
 Private MrsListadoMoneda As ADODB.Recordset

Private Sub cmdsalir_Click()
   Unload Me
End Sub

Private Sub Form_Load()

   Me.Top = (Screen.Width - Me.Width) / 2
   Me.Left = (Screen.Height - Me.Height) / 2
            
   Set MobjCobranzas = New DB_AR_CUENTASCOBRAR.C_COBRANZAS
            
   Set Dbresumenarticulos.DataSource = MobjCobranzas.ObtenerResumendeArticulos(FDocuPorCobrar.MDblCorrelativo)
   Dbresumenarticulos.Refresh
   FormatodeGrilla
   ActulizaTotalesResumen
   
   
End Sub

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

Public Sub FormatodeGrilla()

  Dbresumenarticulos.Columns(0).Visible = False
  Dbresumenarticulos.Columns(1).Caption = "Almacén"
  Dbresumenarticulos.Columns(1).Width = 1500
  Dbresumenarticulos.Columns(2).Caption = "Código"
  Dbresumenarticulos.Columns(2).Width = 1000
  Dbresumenarticulos.Columns(3).Caption = "Descripción"
  Dbresumenarticulos.Columns(3).Width = 3350
  Dbresumenarticulos.Columns(4).Caption = "Cantidad"
  Dbresumenarticulos.Columns(4).Width = 940
  Dbresumenarticulos.Columns(4).Alignment = dbgRight
  Dbresumenarticulos.Columns(4).NumberFormat = GMascara(GintDecStock)
  Dbresumenarticulos.Columns(5).Width = 940
  Dbresumenarticulos.Columns(5).Caption = "Precio_Venta"
  Dbresumenarticulos.Columns(5).Alignment = dbgRight
  Dbresumenarticulos.Columns(5).NumberFormat = GMascara(GintDecPrecio)
  
  If FDocuPorCobrar.Dtcmoneda.BoundText = GstrCodMonedaBase Then
     Dbresumenarticulos.Columns(6).Caption = "Total"
     Dbresumenarticulos.Columns(6).Visible = True
     Dbresumenarticulos.Columns(6).NumberFormat = GMascara(GintDecResultado)
     Dbresumenarticulos.Columns(7).Visible = False
  Else
     Dbresumenarticulos.Columns(7).Caption = "Total"
     Dbresumenarticulos.Columns(7).Visible = True
     Dbresumenarticulos.Columns(7).NumberFormat = GMascara(GintDecResultado)
     Dbresumenarticulos.Columns(6).Visible = False
  End If
  Dbresumenarticulos.Columns(8).Visible = False
  Dbresumenarticulos.Columns(9).Visible = False
 
End Sub
Public Sub ActulizaTotalesResumen()

  'strsql = " Select sum(TOTALPEN) AS SUMTOTALPEN,sum(TOTALUSD) AS SUMTOTALUSD, " & _
  '         " sum(TAXPEN) AS SUMTAXPEN,sum(TAXUSD) AS SUMTAXUSD " & _
  '         " from tmp_ar_salesdet where CORRNBR =" & DblCorrelativo
  
   
  Dim LrsTotalesResumen As ADODB.Recordset
  Set LrsTotalesResumen = MobjCobranzas.ObtenerTotalesResumen(FDocuPorCobrar.MDblCorrelativo)
  
  If FDocuPorCobrar.Dtcmoneda.BoundText = GstrCodMonedaBase Then
     If IsNull(LrsTotalesResumen!SUMTOTALPEN) Then
        lbltotal.Caption = GFormatodeNumero(0, GintDecResultado)
     Else
        lbltotal.Caption = GFormatodeNumero(LrsTotalesResumen!SUMTOTALPEN, GintDecResultado)
     End If
  Else
     If IsNull(LrsTotalesResumen!SUMTOTALUSD) Then
       lbltotal.Caption = GFormatodeNumero(0, GintDecResultado)
     Else
       lbltotal.Caption = GFormatodeNumero(LrsTotalesResumen!SUMTOTALUSD, GintDecResultado)
     End If
  End If
          
  Set LrsTotalesResumen = Nothing
  
End Sub

