This commit is contained in:
2018-08-07 14:52:41 +02:00
parent 37c9ce7495
commit 788ea08e95
8 changed files with 149 additions and 208 deletions
@@ -23,6 +23,7 @@ Public Class InvoiceVC
Public Event InitWork(ByVal _Minimum As Long, ByVal _Step As Long, ByVal _Maximum As Long)
Public Event DoWork()
Public Event FinalWork()
Public Event FireNAVmanageInvoiceFinalWork(ByVal _InvoiceHeader As InvoiceHeader)
Public Sub New()
MyBase.New()
@@ -740,16 +741,10 @@ Public Class InvoiceVC
_p_InvoiceHeader.RecalculateInvoice(_p_InvoiceHeader, _ocur)
_ocur.CommitChanges()
If _p_InvoiceHeader.TotalVATHUF >= 100000 And
_p_InvoiceHeader.DateCreated >= #2018-07-01# And
_p_InvoiceHeader.NAV_InvoiceStatus <> "DONE" And
_p_InvoiceHeader.IsEditable = False And
_p_InvoiceHeader.IsProforma = False And
String.IsNullOrEmpty(_p_InvoiceHeader.DocumentNumber) = False Then
'Számla NAV feladása
If _p_InvoiceHeader.DateCreated >= #2018-07-01# And _p_InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_p_InvoiceHeader.DocumentNumber) = False And _p_InvoiceHeader.IsProforma = False Then
If Math.Abs(_p_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_p_InvoiceHeader)
End If
End If
@@ -22,7 +22,7 @@ Public Class OrderInVC
Protected _selection As New ArrayList
Protected _noselect As Boolean = False
Private _getAlertFromOrderIn As String
Public Event FireNAVmanageInvoiceFinalWork(ByVal _InvoiceHeader As InvoiceHeader)
Public Sub New()
MyBase.New()
InitializeComponent()
@@ -2792,6 +2792,11 @@ CheckError:
_InvoiceHeader.RecalculateInvoice(_InvoiceHeader, _onew)
_onew.CommitChanges()
If _InvoiceHeader.DateCreated >= #2018-07-01# And _InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_InvoiceHeader.DocumentNumber) = False And _InvoiceHeader.IsProforma = False Then
If Math.Abs(_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_InvoiceHeader)
End If
End If
If _ORI_Invoice_Popup.IsLiquidAssets AndAlso _ORI_Invoice_Popup.PaymentOption.PayMode = ePayMode.InCash And _ORI_Invoice_Popup.IsFinalInvoice Then
CreateGLCassa(_InvoiceHeader, _onew, _ORI_Invoice_Popup)
@@ -3097,6 +3102,12 @@ CheckError:
_InvoiceHeader.RecalculateInvoice(_InvoiceHeader, _ocur)
_ocur.CommitChanges()
If _InvoiceHeader.DateCreated >= #2018-07-01# And _InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_InvoiceHeader.DocumentNumber) = False And _InvoiceHeader.IsProforma = False Then
If Math.Abs(_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_InvoiceHeader)
End If
End If
Exit Sub
CheckError:
If Err.Number = 91 Then Resume Next
@@ -3562,6 +3573,13 @@ CheckError:
_onew.CommitChanges()
_InvoiceHeader.RecalculateInvoice(_InvoiceHeader, _onew)
_onew.CommitChanges()
If _InvoiceHeader.DateCreated >= #2018-07-01# And _InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_InvoiceHeader.DocumentNumber) = False And _InvoiceHeader.IsProforma = False Then
If Math.Abs(_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_InvoiceHeader)
End If
End If
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.OkOnly + MsgBoxStyle.Critical, String.Format(CaptionHelper.GetLocalizedText("Exceptions\NuvolarExceptions", "MsgBoxCheckItAgain")))
@@ -3831,6 +3849,12 @@ CheckError:
_InvoiceHeader.RecalculateInvoice(_InvoiceHeader, _onew)
_onew.CommitChanges()
If _InvoiceHeader.DateCreated >= #2018-07-01# And _InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_InvoiceHeader.DocumentNumber) = False And _InvoiceHeader.IsProforma = False Then
If Math.Abs(_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_InvoiceHeader)
End If
End If
'Készpénz esetén pénztári bizonylat is !!!
If _ORI_Invoice_Popup.IsLiquidAssets AndAlso _ORI_Invoice_Popup.PaymentOption.PayMode = ePayMode.InCash And _ORI_Invoice_Popup.IsFinalInvoice Then
CreateGLCassa(_InvoiceHeader, _onew, _ORI_Invoice_Popup)
@@ -3912,6 +3936,13 @@ CheckError:
For Each _InvoiceHeader As InvoiceHeader In _InvoiceHeaderNew_Collection
_InvoiceHeader.RecalculateInvoice(_InvoiceHeader, _onew)
_onew.CommitChanges()
If _InvoiceHeader.DateCreated >= #2018-07-01# And _InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_InvoiceHeader.DocumentNumber) = False And _InvoiceHeader.IsProforma = False Then
If Math.Abs(_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_InvoiceHeader)
End If
End If
Next
Frame.GetController(Of RefreshController).RefreshAction.DoExecute()
Catch ex As Exception
@@ -4014,6 +4045,12 @@ CheckError:
_InvoiceHeader.RecalculateInvoice(_InvoiceHeader, _onew)
_onew.CommitChanges()
If _InvoiceHeader.DateCreated >= #2018-07-01# And _InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_InvoiceHeader.DocumentNumber) = False And _InvoiceHeader.IsProforma = False Then
If Math.Abs(_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_InvoiceHeader)
End If
End If
Dim _uow_pci As New UnitOfWork(_onew.Session.DataLayer)
GLFunctions.ReconfigurePCI(_uow_pci, _InvoiceHeader.CustomersFrom, _InvoiceHeader.Customers, 0, _InvoiceHeader.ConnectInfo)
@@ -4215,6 +4252,12 @@ CheckError:
_InvoiceHeader.RecalculateInvoice(_InvoiceHeader, _ocur)
_ocur.CommitChanges()
If _InvoiceHeader.DateCreated >= #2018-07-01# And _InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_InvoiceHeader.DocumentNumber) = False And _InvoiceHeader.IsProforma = False Then
If Math.Abs(_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_InvoiceHeader)
End If
End If
Dim _uow_pci As New UnitOfWork(_ocur.Session.DataLayer)
GLFunctions.ReconfigurePCI(_uow_pci, _InvoiceHeader.CustomersFrom, _InvoiceHeader.Customers, 0, _InvoiceHeader.ConnectInfo)
@@ -4620,6 +4663,12 @@ CheckError:
_ocur.Session.ExecuteNonQuery(_SQL)
If _InvoiceHeader.DateCreated >= #2018-07-01# And _InvoiceHeader.IsEditable = False And String.IsNullOrEmpty(_InvoiceHeader.DocumentNumber) = False And _InvoiceHeader.IsProforma = False Then
If Math.Abs(_InvoiceHeader.TotalVATHUF) >= 100000 Then
RaiseEvent FireNAVmanageInvoiceFinalWork(_InvoiceHeader)
End If
End If
If TryCast(e.PopupWindow.View.SelectedObjects(0), ORI_Invoice_Popup).IsFinalInvoice Then
Dim _uow_pci As New UnitOfWork(_ocur.Session.DataLayer)
GLFunctions.ReconfigurePCI(_uow_pci, _InvoiceHeader.CustomersFrom, _InvoiceHeader.Customers, 0, _InvoiceHeader.ConnectInfo)