cambios nachito a form factura

This commit is contained in:
fedpo
2024-08-04 21:38:55 +01:00
parent 5b78d74e54
commit be585cff1d
18 changed files with 415 additions and 21 deletions

View File

@@ -1 +1,5 @@
<<<<<<< HEAD
07cbdde4e47ec2d3a6db548797ff84a15aa08946633217fe5ed64773b3cc8491
=======
a7a9c23e29aac78d8fc99e5e2578c73ffe3d4cba
>>>>>>> 5b78d74e54350285696596720e82f5fbd99b4d02

View File

@@ -115,6 +115,8 @@ C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.d
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\refint\Controladora.dll
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\Controladora.pdb
C:\Users\Nacho\Desktop\final actual\Controladora\obj\Debug\net6.0\ref\Controladora.dll
<<<<<<< HEAD
=======
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.deps.json
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.dll
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\bin\Debug\net6.0\Controladora.pdb
@@ -132,3 +134,4 @@ C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\refint\Controladora.dll
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\Controladora.pdb
C:\Users\fedpo\Downloads\final actual\final actual\Controladora\obj\Debug\net6.0\ref\Controladora.dll
>>>>>>> 5b78d74e54350285696596720e82f5fbd99b4d02

View File

@@ -12,5 +12,17 @@ namespace Entidades
{
get { return Producto?.Nombre ?? string.Empty; }
}
<<<<<<< HEAD
public double PrecioUnitario
{
get { return Producto?.Precio ?? 0; }
}
public double Subtotal
{
get { return PrecioUnitario * CantidadDeProductos; }
}
=======
>>>>>>> 5b78d74e54350285696596720e82f5fbd99b4d02
}
}

View File

@@ -0,0 +1,124 @@
{
"format": 1,
"restore": {
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj": {}
},
"projects": {
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj",
"projectName": "Entidades",
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj",
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
},
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj",
"projectName": "Informes",
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj",
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
}
}
}

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\fedpo\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.6.0</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\fedpo\.nuget\packages\" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />

View File

@@ -0,0 +1,92 @@
{
"version": 3,
"targets": {
"net6.0": {
"Entidades/1.0.0": {
"type": "project",
"framework": ".NETCoreApp,Version=v6.0",
"compile": {
"bin/placeholder/Entidades.dll": {}
},
"runtime": {
"bin/placeholder/Entidades.dll": {}
}
}
}
},
"libraries": {
"Entidades/1.0.0": {
"type": "project",
"path": "../Entidades/Entidades.csproj",
"msbuildProject": "../Entidades/Entidades.csproj"
}
},
"projectFileDependencyGroups": {
"net6.0": [
"Entidades >= 1.0.0"
]
},
"packageFolders": {
"C:\\Users\\fedpo\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj",
"projectName": "Informes",
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj",
"packagesPath": "C:\\Users\\fedpo\\.nuget\\packages\\",
"outputPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\fedpo\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"net6.0"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"https://api.nuget.org/v3/index.json": {},
"https://fedesrv.ddns.net/git/api/packages/fede/nuget/index.json": {}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"projectReferences": {
"C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj": {
"projectPath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Entidades\\Entidades.csproj"
}
}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
}
},
"frameworks": {
"net6.0": {
"targetAlias": "net6.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\7.0.306\\RuntimeIdentifierGraph.json"
}
}
}
}

View File

@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "INVcMeeXX3RoJw93Ye8x1Z2zKXKisJfXRKwLszX9TOBmcSCPTpBbhbgBcrnpGdxF2t/KPFVRZ2CzsnGvpyudOQ==",
"success": true,
"projectFilePath": "C:\\Users\\fedpo\\Downloads\\final actual\\final actual\\Informes\\Informes.csproj",
"expectedPackageFiles": [],
"logs": []
}

View File

@@ -29,33 +29,49 @@
private void InitializeComponent()
{
groupBox1 = new GroupBox();
dataGridView2 = new DataGridView();
dataGridView1 = new DataGridView();
BtnAdd = new Button();
groupBox1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)dataGridView2).BeginInit();
((System.ComponentModel.ISupportInitialize)dataGridView1).BeginInit();
SuspendLayout();
//
// groupBox1
//
groupBox1.Controls.Add(dataGridView2);
groupBox1.Controls.Add(dataGridView1);
groupBox1.Controls.Add(BtnAdd);
groupBox1.Location = new Point(12, 12);
groupBox1.Name = "groupBox1";
groupBox1.Size = new Size(776, 351);
groupBox1.Size = new Size(1041, 426);
groupBox1.TabIndex = 5;
groupBox1.TabStop = false;
//
// dataGridView2
//
dataGridView2.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView2.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView2.Location = new Point(623, 0);
dataGridView2.Name = "dataGridView2";
dataGridView2.RowTemplate.Height = 25;
dataGridView2.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView2.Size = new Size(384, 426);
dataGridView2.TabIndex = 4;
//
// dataGridView1
//
dataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
dataGridView1.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
dataGridView1.Location = new Point(6, 22);
dataGridView1.Location = new Point(6, 16);
dataGridView1.Name = "dataGridView1";
dataGridView1.RowTemplate.Height = 25;
dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
dataGridView1.Size = new Size(594, 235);
dataGridView1.Size = new Size(508, 241);
dataGridView1.TabIndex = 3;
dataGridView1.CellBorderStyleChanged += dataGridView1_CellBorderStyleChanged;
dataGridView1.CellClick += dataGridView1_CellClick;
dataGridView1.CellContentClick += dataGridView1_CellContentClick;
//
// BtnAdd
//
@@ -71,12 +87,13 @@
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(800, 450);
ClientSize = new Size(1068, 450);
Controls.Add(groupBox1);
Name = "FrmFacturas";
Text = "Ventas";
WindowState = FormWindowState.Maximized;
groupBox1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)dataGridView2).EndInit();
((System.ComponentModel.ISupportInitialize)dataGridView1).EndInit();
ResumeLayout(false);
}
@@ -86,5 +103,6 @@
private GroupBox groupBox1;
private DataGridView dataGridView1;
private Button BtnAdd;
private DataGridView dataGridView2;
}
}

View File

@@ -1,4 +1,6 @@
using Controladora;
using Entidades;
using System.Collections.ObjectModel;
namespace Vista
{
@@ -9,6 +11,8 @@ namespace Vista
{
InitializeComponent();
ActualizarGrilla();
dataGridView1.CellClick += dataGridView1_CellClick;
ConfigurarDataGridView2();
}
private void ActualizarGrilla()
{
@@ -26,5 +30,60 @@ namespace Vista
{
}
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
}
private void ConfigurarDataGridView2()
{
dataGridView2.AutoGenerateColumns = false;
dataGridView2.Columns.Add(new DataGridViewTextBoxColumn
{
DataPropertyName = "Producto",
HeaderText = "Producto"
});
dataGridView2.Columns.Add(new DataGridViewTextBoxColumn
{
DataPropertyName = "Cantidad",
HeaderText = "Cantidad"
});
dataGridView2.Columns.Add(new DataGridViewTextBoxColumn
{
DataPropertyName = "PrecioUnitario",
HeaderText = "PrecioUnitariod"
});
dataGridView2.Columns.Add(new DataGridViewTextBoxColumn
{
DataPropertyName = "Subtotal",
HeaderText = "Subtotal"
});
}
private void ActualizarGrillaLotes(ReadOnlyCollection<Lote> lotes)
{
dataGridView2.DataSource = null;
if (lotes.Any())
{
var loteDatos = lotes.Select(lote => new
{
Producto = lote.NombreProducto,
Cantidad = lote.CantidadDeProductos,
Subtotal = lote.Subtotal,
PrecioUnitario = lote.PrecioUnitario,
}).ToList();
dataGridView2.DataSource = loteDatos;
}
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0)
{
var selectedFactura = (Factura)dataGridView1.Rows[e.RowIndex].DataBoundItem;
var lotes = ControladoraLotes.Instance.ListarPorFacturaId(selectedFactura.Id);
ActualizarGrillaLotes(lotes);
}
}
}
}

View File

@@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Compile Update="AddCategoria.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="AddProducto.cs">
<SubType>Form</SubType>
</Compile>
<<<<<<< HEAD
<Compile Update="FrmFacturas.cs">
<SubType>Form</SubType>
</Compile>
=======
>>>>>>> 5b78d74e54350285696596720e82f5fbd99b4d02
<Compile Update="FrmInforme.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPresupuesto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmCliente.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmFactura.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPedidosDePresupuestos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmOrdenDeCompra.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProducto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProveedor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmRemitos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProductos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProveedores.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmClientes.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="PantallaPrincipal.cs">
<SubType>Form</SubType>
</Compile>
</ItemGroup>
</Project>

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
<ItemGroup>
<Compile Update="AddCategoria.cs">
<SubType>Form</SubType>
@@ -7,43 +8,43 @@
<Compile Update="AddProducto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmInforme.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPresupuesto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmCliente.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmClientes.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmFactura.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPedidosDePresupuestos.cs">
<Compile Update="FrmFacturas.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmInforme.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmOrdenDeCompra.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPedidosDePresupuestos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmPresupuesto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProducto.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProveedor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmRemitos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProductos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProveedor.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmProveedores.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmFacturas.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="FrmClientes.cs">
<Compile Update="FrmRemitos.cs">
<SubType>Form</SubType>
</Compile>
<Compile Update="PantallaPrincipal.cs">