本文解答了关于《备用金会计分录》相关内容,同时关于1、备用金会计分录怎么做,2、员工备用金会计分录,3、领取备用金会计分录,4、归还备用金会计分录,5、申请备用金会计分录,的相关问答本篇文章福途教育网小编也整理了进来,希望对您有帮助。
备用金会计分录
if dr.Cells(0).Value.ToString.TrimEnd <> "" Then
errorKey = True
MsgBox("存在非空行,无法自动生成凭证", MsgBoxStyle.Critical)
Exit Sub
End If
For x = 9 To 15
If dr.Cells(x).Value.ToString.TrimEnd <> "" Then
Select Case x
Case 9
v.SubjectID = 5111
v.DebitAmount = IIf(dr.Cells(x).Value > 0, dr.Cells(x).Value, 0)
v.CreditAmount = IIf(dr.Cells(x).Value < 0, -dr.Cells(x).Value, 0)
Case 10
v.SubjectID = 2117
v.DebitAmount = IIf(dr.Cells(x).Value < 0, -dr.Cells(x).Value, 0)
v.CreditAmount = IIf(dr.Cells(x).Value > 0, dr.Cells(x).Value, 0)
Case 11
v.SubjectID = 1321
v.DebitAmount = IIf(dr.Cells(x).Value > 0, dr.Cells(x).Value, 0)
v.CreditAmount = IIf(dr.Cells(x).Value < 0, -dr.Cells(x).Value, 0)
Case 12
v.SubjectID = 510
v.DebitAmount = IIf(dr.Cells(x).Value < 0, -dr.Cells(x).Value, 0)
v.CreditAmount = IIf(dr.Cells(x).Value > 0, dr.Cells(x).Value, 0)
Case 13
v.SubjectID = 5132
v.DebitAmount = IIf(dr.Cells(x).Value > 0, dr.Cells(x).Value, 0)
v.CreditAmount = IIf(dr.Cells(x).Value < 0, -dr.Cells(x).Value, 0)
Case 14
v.SubjectID = 1122
v.DebitAmount = IIf(dr.Cells(x).Value < 0, -dr.Cells(x).Value, 0)
v.CreditAmount = IIf(dr.Cells(x).Value > 0, dr.Cells(x).Value, 0)
Case 15
v.SubjectID = 1152
v.DebitAmount = IIf(dr.Cells(x).Value > 0, dr.Cells(x).Value, 0)
v.CreditAmount = IIf(dr.Cells(x).Value < 0, -dr.Cells(x).Value, 0)
End Select
v.Summary = txtSummary.Text
v.VoucherDate = dtpVoucherDte.Value
dblDebitSum = dblDebitSum + Math.Round(v.DebitAmount, 2)
dblCreditSum = dblCreditSum + Math.Round(v.CreditAmount, 2)
vlist.Add(v)
v = Nothing
v = New Voucher
v.VoucherID = lVoucherID
v.VoucherNo = lVoucherNo
End If
Next
For i As Short = 0 To vlist.Count - 1
vlist.Item(i).No = i + 1
Next
If Math.Round(dblDebitSum, 2) - Math.Round(dblCreditSum, 2) <> 0 Then
errorKey = True
MsgBox("此次凭证借贷方不平衡!", MsgBoxStyle.Critical)
Exit Sub
End If
vlist.Item(0).AttachCount = vlist.Count
vlist.Item(0).AccountID = saccount.ID
vlist.Item(0).ActualVoucherDate = vlist.Item(0).VoucherDate
vlist.Item(0).EntryDate = Now
Dim b As Balance
b = Balance.getBalanceBySubjectID(saccount.ID, vlist.Item(0).VoucherDate, vlist.Item(0).SubjectID)
If b Is Nothing Then
b = New Balance
b.AccountID = saccount.ID
b.SubjectID = vlist.Item(0).SubjectID
Dim sk As New List(Of Integer)
For Each v As Voucher In vlist
sk.Add(v.SubjectID)
Next
sk = sk.ToArray.Distinct.ToList()
Dim pb As New Dictionary(Of Integer, ParamBalance)
For Each si As Integer In sk
Try
pb.Add(si, ParamBalance.getParamBalanceBySubjectID(saccount.ID, si))
Catch ex As Exception
End Try
Next
b = Nothing
Return
Else
b.BalancePrice = b.BalancePrice + vlist.Item(0).DebitAmount - vlist.Item(0).CreditAmount
End If
trytosave(vlist, b)
End If
End Sub
Private Sub trytosave(ByVal vlist As List(Of Voucher), ByVal b As Balance)
If Not vlist Is Nothing And Not b Is Nothing Then
vds.KeepChanges = True
Dim subject As New List(Of Subject)
For Each v As Voucher In vlist
v.Insert(User.UserID)
subject.Add(Subject.Create(v))
Next
b.Insert(User.UserID)
vds.AcceptChanges()
subject2form(subject, b)
MsgBox("凭证自动生成成功!", , "自动生成凭证")
Return
Else
MsgBox("未能保存!凭证自动生成失败!", , "自动生成凭证")
End If
End Sub
Private Sub subject2form(ByVal subject As List(Of Subject), ByVal b As Balance)
For Each s As Subject In subject
lVoucherNo = s.VoucherNo
lVoucherID = s.VoucherID
txtSummary.Text = s.Summary
dtpVoucherDte.Value = s.VoucherDate
breakSubject(s)
Exit For
Next
For Each s As Subject In subject
If Not s.ParentID = s.ID Then
breakSubject(s)
End If
Next
ShowBalancePrice(b)
End Sub
Private Sub breakSubject(ByVal s As Subject)
If s.Direction = 1 Then
txtSubject.Text = s.SubjectName
txtSubjectID.Text = s.SubjectID
txtDebitAmount.Text = String.Format("{0:N}", s.DebitAmount)
txtCreditAmount.Text = 0
txtRemark.Text = s.Remark
insertNewRecord()
Else
txtSubject.Text = s.SubjectName
txtSubjectID.Text = s.SubjectID
txtDebitAmount.Text = 0
txtCreditAmount.Text = String.Format("{0:N}", s.CreditAmount)
txtRemark.Text = s.Remark
insertNewRecord()
End If
End Sub
End Class
总结:以上是编辑:【陆儿】整理及AI智能原创关于《备用金会计分录
》优质内容解答希望能帮助到您。