Offert. Kostenkalk
This commit is contained in:
BIN
SDL/Resources/Kostenkalkulation_AG.xlsx
Normal file
BIN
SDL/Resources/Kostenkalkulation_AG.xlsx
Normal file
Binary file not shown.
BIN
SDL/Resources/Kostenkalkulation_CS.xlsx
Normal file
BIN
SDL/Resources/Kostenkalkulation_CS.xlsx
Normal file
Binary file not shown.
BIN
SDL/Resources/Kostenkalkulation_IMEX.xlsx
Normal file
BIN
SDL/Resources/Kostenkalkulation_IMEX.xlsx
Normal file
Binary file not shown.
@@ -4551,7 +4551,9 @@
|
|||||||
<None Include="Resources\FA_Graz_EV-Veranlagung_Muster.xlsx">
|
<None Include="Resources\FA_Graz_EV-Veranlagung_Muster.xlsx">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="Resources\Kostenkalkulation.xlsx" />
|
<None Include="Resources\Kostenkalkulation_CS.xlsx" />
|
||||||
|
<None Include="Resources\Kostenkalkulation_AG.xlsx" />
|
||||||
|
<None Include="Resources\Kostenkalkulation_IMEX.xlsx" />
|
||||||
<None Include="Resources\LKW_Liste.xlsx" />
|
<None Include="Resources\LKW_Liste.xlsx" />
|
||||||
<None Include="Resources\MDM_Schreiben\GOBOX_UMSTELLUNG.dotx">
|
<None Include="Resources\MDM_Schreiben\GOBOX_UMSTELLUNG.dotx">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Imports VERAG_PROG_ALLGEMEIN
|
Imports VERAG_PROG_ALLGEMEIN
|
||||||
|
Imports VERAG_PROG_ALLGEMEIN.TESTJSON
|
||||||
|
|
||||||
Public Class usrCntlOfferte
|
Public Class usrCntlOfferte
|
||||||
|
|
||||||
@@ -816,9 +817,16 @@ Public Class usrCntlOfferte
|
|||||||
If True Then
|
If True Then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Dim KD As New VERAG_PROG_ALLGEMEIN.cKunde(kdNr)
|
||||||
|
Dim ADR As New VERAG_PROG_ALLGEMEIN.cAdressen(kdNr)
|
||||||
|
Dim FIRMA_TMP = VERAG_PROG_ALLGEMEIN.cAllgemein.getFirmaFromFiliale(KD.FilialenNr)
|
||||||
|
|
||||||
|
|
||||||
Dim sqlKostenkalk = " Select OffertenNr, isnull(LeistungsNr,'') as LeistungsNr,isnull(LeistungsBez,'' ) as LeistungsBez,isnull(Preis,'') as Preis,isnull([Geändert am],[Eingegeben am]) as Datum
|
Dim sqlKostenkalk = " Select OffertenNr, isnull(LeistungsNr,'') as LeistungsNr,isnull(LeistungsBez,'' ) as LeistungsBez,isnull(Preis,'') as Preis,isnull([Geändert am],[Eingegeben am]) as Datum
|
||||||
FROM [VERAG].[dbo].[Offertenpositionen] where KundenNr = " & kdNr & " and OffertenNr in (38, 1) and LeistungsNr in (340, 324, 348, 440)
|
FROM [VERAG].[dbo].[Offertenpositionen] where KundenNr = " & kdNr & " and OffertenNr in (38, 1) and LeistungsNr in (340, 324, 348, 440)
|
||||||
order by cast([Eingegeben am] as date) desc, LeistungsNr, Preis desc"
|
order by Preis desc"
|
||||||
|
|
||||||
|
|
||||||
Dim dtKostenkalk As DataTable = (New SQL).loadDgvBySql(sqlKostenkalk, "FMZOLL")
|
Dim dtKostenkalk As DataTable = (New SQL).loadDgvBySql(sqlKostenkalk, "FMZOLL")
|
||||||
@@ -840,15 +848,32 @@ Public Class usrCntlOfferte
|
|||||||
Dim Blatt As Object 'Microsoft.Office.Interop.Excel.Worksheet 'As Object 'as Worksheet
|
Dim Blatt As Object 'Microsoft.Office.Interop.Excel.Worksheet 'As Object 'as Worksheet
|
||||||
exclApp = CreateObject("Excel.Application")
|
exclApp = CreateObject("Excel.Application")
|
||||||
|
|
||||||
|
Dim ExcelBez = "Kostenkalkulation"
|
||||||
|
|
||||||
|
Select Case FIRMA_TMP
|
||||||
|
Case "IMEX" : ExcelBez &= "_IMEX "
|
||||||
|
Case "VERAG" : ExcelBez &= "_AG "
|
||||||
|
Case Else : ExcelBez &= " "
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
With exclApp
|
With exclApp
|
||||||
.Visible = False
|
.Visible = False
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Path = sPath & "Kostenkalkulation " & kdNr & " .xlsx"
|
Path = sPath & ExcelBez & kdNr & " .xlsx"
|
||||||
While System.IO.File.Exists(Path)
|
While System.IO.File.Exists(Path)
|
||||||
Path = sPath & "Kostenkalkulation " & kdNr & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
|
Path = sPath & ExcelBez & kdNr & "_" & Now.ToString("ddMMyyyyHHmmss") & ".xlsx"
|
||||||
End While
|
End While
|
||||||
My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.Kostenkalkulation, False)
|
|
||||||
|
Select Case FIRMA_TMP
|
||||||
|
Case "IMEX" : My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.Kostenkalkulation_IMEX, False)
|
||||||
|
Case "VERAG" : My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.Kostenkalkulation_AG, False)
|
||||||
|
Case Else : My.Computer.FileSystem.WriteAllBytes(Path, My.Resources.Kostenkalkulation, False)
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Catch ex As System.Exception
|
Catch ex As System.Exception
|
||||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
Me.Cursor = Cursors.Default
|
Me.Cursor = Cursors.Default
|
||||||
@@ -859,8 +884,6 @@ Public Class usrCntlOfferte
|
|||||||
Datei = .Workbooks.Open(Path) 'Anpassen
|
Datei = .Workbooks.Open(Path) 'Anpassen
|
||||||
Blatt = Datei.Worksheets(1) 'Anpassen
|
Blatt = Datei.Worksheets(1) 'Anpassen
|
||||||
|
|
||||||
Dim KD As New VERAG_PROG_ALLGEMEIN.cKunde(kdNr)
|
|
||||||
Dim ADR As New VERAG_PROG_ALLGEMEIN.cAdressen(kdNr)
|
|
||||||
|
|
||||||
Blatt.Range("B8").Value = ADR.Name_1
|
Blatt.Range("B8").Value = ADR.Name_1
|
||||||
Blatt.Range("B9").Value = ADR.AdressenNr
|
Blatt.Range("B9").Value = ADR.AdressenNr
|
||||||
@@ -869,13 +892,15 @@ Public Class usrCntlOfferte
|
|||||||
|
|
||||||
Dim currentRow As Integer = 13
|
Dim currentRow As Integer = 13
|
||||||
|
|
||||||
|
Dim DatumDerZollabf As String = SQL.getValueTxtBySql("select top(1) isnull([Geändert am],[Eingegeben am]) as Datum FROM [VERAG].[dbo].[Offertenpositionen] where KundenNr = 704150 and OffertenNr in (38, 1) and LeistungsNr in (340, 324, 348, 440) order by Preis desc", "FMZOLL")
|
||||||
|
|
||||||
For Each row In dtKostenkalk.Rows
|
For Each row In dtKostenkalk.Rows
|
||||||
Blatt.Range("A" & currentRow).Value = row("LeistungsBez")
|
Blatt.Range("A" & currentRow).Value = row("LeistungsBez")
|
||||||
Blatt.Range("B" & currentRow).Value = row("Preis")
|
Blatt.Range("B" & currentRow).Value = row("Preis")
|
||||||
|
|
||||||
If IsDate(row("Datum")) Then
|
If IsDate(DatumDerZollabf) Then
|
||||||
|
|
||||||
Select Case CDate(row("Datum")).Year
|
Select Case CDate(DatumDerZollabf).Year
|
||||||
'Berechnungssätze laut Johanna Luxbauer
|
'Berechnungssätze laut Johanna Luxbauer
|
||||||
Case 2018 : Blatt.Range("D" & currentRow).Value = 0.3387
|
Case 2018 : Blatt.Range("D" & currentRow).Value = 0.3387
|
||||||
Case 2019 : Blatt.Range("D" & currentRow).Value = 0.3048
|
Case 2019 : Blatt.Range("D" & currentRow).Value = 0.3048
|
||||||
|
|||||||
Reference in New Issue
Block a user