eliminar
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
<%@ Page Title="" Language="VB" MasterPageFile="~/Site.master" AutoEventWireup="false" CodeFile="DIOTChilo.aspx.vb" Inherits="Contabilidad_DIOTChilo" %>
|
||||
|
||||
<asp:Content ID="Content1" ContentPlaceHolderID="CP" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content2" ContentPlaceHolderID="Css" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content3" ContentPlaceHolderID="E" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content4" ContentPlaceHolderID="HB" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content5" ContentPlaceHolderID="H" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content6" ContentPlaceHolderID="HA" runat="Server">
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content7" ContentPlaceHolderID="C" runat="Server">
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<asp:TextBox ID="TxtPoliza" runat="server" Width="50%" CssClass="form-control"></asp:TextBox>
|
||||
<asp:Button ID="BtnContabilizar" runat="server" CssClass="form-control btn btn-primary" Text="Fierro Compa!" Width="50%" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</asp:Content>
|
||||
<asp:Content ID="Content8" ContentPlaceHolderID="JS" runat="Server">
|
||||
</asp:Content>
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
Imports System.Data
|
||||
Imports Extensiones
|
||||
|
||||
Partial Class Contabilidad_DIOTChilo
|
||||
Inherits Page
|
||||
|
||||
Private Sub Contabilidad_DIOTChilo_Load(sender As Object, e As EventArgs) Handles Me.Load
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub BtnContabilizar_Click(sender As Object, e As EventArgs) Handles BtnContabilizar.Click
|
||||
Dim ObjContabilidad As New ClsContabilidad
|
||||
Dim ObjConta As ClsContPAQi = Nothing
|
||||
Dim ObjEmpres As New Empresa()
|
||||
|
||||
ObjEmpres.Empresa = "EXPLORACIONES MINERAS DEL DESIERTO S.A DE C.V"
|
||||
ObjEmpres.ServerContPAQi = "192.168.0.2\COMPAC,1430"
|
||||
ObjEmpres.BDContPAQi = "ctEMD"
|
||||
ObjEmpres.UsrContPAQi = "sa"
|
||||
ObjEmpres.PwdContPAQi = "AsS151026r37"
|
||||
|
||||
Dim OcurrioError = False
|
||||
Dim Mensaje = ""
|
||||
|
||||
If ObjConta Is Nothing Then
|
||||
ObjConta = New ClsContPAQi(ObjEmpres)
|
||||
ObjConta.IniciaTransacSQL()
|
||||
End If
|
||||
|
||||
Dim tIdPoliza As Integer
|
||||
Dim Fecha As Date
|
||||
Dim ContaFolio As Integer
|
||||
|
||||
If ObjContabilidad.GetPrePoliza(TxtPoliza.Text.ToEntero, 13) Then
|
||||
tIdPoliza = ObjContabilidad.DtResultados(0)("IdPoliza").ToString.ToEntero
|
||||
Fecha = ObjContabilidad.DtResultados(0)("Fecha").ToString.ToDate
|
||||
ContaFolio = ObjContabilidad.DtResultados(0)("FolioPoliza").ToString.ToEntero
|
||||
End If
|
||||
|
||||
|
||||
If ObjContabilidad.GetDIOTValores(TxtPoliza.Text.ToEntero) Then
|
||||
|
||||
If ObjContabilidad.DtResultados.Rows.Count.ToEntero > 0 Then
|
||||
Dim IdProveedor As Integer
|
||||
|
||||
Dim RFC As String = ""
|
||||
Dim RazonSocial As String = ""
|
||||
Dim IdCtaContProveedores As Integer
|
||||
|
||||
|
||||
For Each dr As DataRow In ObjContabilidad.DtResultados.Rows
|
||||
RFC = dr("RFC").ToString
|
||||
RazonSocial = dr("RazonSocial").ToString
|
||||
IdCtaContProveedores = dr("IdCtaContProveedores").ToString.ToEntero
|
||||
|
||||
If IdCtaContProveedores > 0 Then
|
||||
|
||||
'busco la clave del proveedor en la contabilidad por su cuenta contable
|
||||
If ObjConta.GetProveedores(IdCuentaContable:=IdCtaContProveedores) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
Dim drt As DataRow = ObjConta.DtResultados.Rows(0) : IdProveedor = drt("Id").ToString.ToEntero
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
'busco la clave del proveedor en la contabilidad por su cuenta contable
|
||||
If ObjConta.GetProveedores(RFC:=RFC) Then
|
||||
If ObjConta.DtResultados.Rows.Count > 0 Then
|
||||
Dim drtt As DataRow = ObjConta.DtResultados.Rows(0) : IdProveedor = drtt("Id").ToString.ToEntero
|
||||
End If
|
||||
Else
|
||||
'registro el proveedor generico
|
||||
Select Case 13
|
||||
Case Else : IdProveedor = 0
|
||||
End Select
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
|
||||
If IdProveedor <= 0 Then
|
||||
IdProveedor = ObjConta.AddProveedor(IdCtaContProveedores, RFC, RazonSocial, "")
|
||||
If IdProveedor <= 0 Then
|
||||
OcurrioError = True
|
||||
End If
|
||||
End If
|
||||
|
||||
If Not OcurrioError Then
|
||||
If dr("Total").ToString.ToDecimal <> 0.00 Then
|
||||
If Not ObjConta.AddDevolucionesIVA(tIdPoliza, dr("CuentaBancos").ToString.ToEntero,
|
||||
IdProveedor,
|
||||
16,
|
||||
dr("SubTotal").ToString.ToDecimal,
|
||||
dr("IvaAcreditable").ToString.ToDecimal,
|
||||
dr("IVARetenido").ToString.ToDecimal,
|
||||
dr("ISRRetenido").ToString.ToDecimal,
|
||||
Fecha,
|
||||
ContaFolio,
|
||||
dr("Serie").ToString.ToString,
|
||||
dr("Folio").ToString.StrToNum, dr("FolioFiscal").ToString, 13) Then
|
||||
OcurrioError = True
|
||||
Mensaje = "La Poliza o la Cuenta no son válidas"
|
||||
Exit For
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
|
||||
If OcurrioError Then
|
||||
ObjConta.RollBack()
|
||||
Else
|
||||
'Alert(String.Format("<a href='/Contabilidad/RegPoliza.aspx?IdPoliza={0}' class='Texto' target='_blank'>{1}</a><br/>", tIdPoliza, ObjConta.Folio))
|
||||
ObjConta.Commit()
|
||||
End If
|
||||
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Reference in New Issue
Block a user