Автор: Пользователь скрыл имя, 10 Июня 2014 в 22:50, дипломная работа
В данном дипломном проекте была решена задача по автоматизации учета основных средств на предприятии ООО "Алеф". В качестве основы для автоматизации был выбран и сконфигурирован под нужды предприятия комплекс УСН 1С Бухгалтерия. Второй частью создания АРМ бухгалтера была разработка отдельного программного блока для формирования унифицированных форм учета основных средств предприятия. Программный блок был разработан в СУБД MS Access, что позволяет автономно быстро и легко формировать унифицированные формы документов. Основными плюсами разработанного модуля является его относительная автономность, низкая экономическая затратность, легкость с точки зрения технологической установки, а также широкие возможности по дальнейшему усовершенствованию. Проведена предварительная работа по подбору технических средств реализации блока, проанализирована и доказана его экономическая окупаемость. Продумана дальнейшая оптимизация бухгалтерского документооборота и учета на предприятии "Алеф" - добавление полной его интеграции с экспортными данными из программного комплекса УСН 1С Бухгалтерии 7.7.
РЕФЕРАТ
ВВЕДЕНИЕ
1. АНАЛИТИЧЕСКАЯ ЧАСТЬ
1.1 ОРГАНИЗАЦИОННО-ЭКОНОМИЧЕСКАЯ ХАРАКТЕРИСТИКА ПРЕДМЕТНОЙ ОБЛАСТИ. КРАТКОЕ ОПИСАНИЕ КОМПАНИИ ООО "АЛЕФ", АНАЛИЗ АДМИНИСТРАТИВНОЙ И ХОЗЯЙСТВЕННОЙ ДЕЯТЕЛЬНОСТИ ПРЕДПРИЯТИЯ
1.1.1 ОРГАНИЗАЦИОННАЯ СТРУКТУРА ОБЪЕКТА УПРАВЛЕНИЯ
1.1.2 ФУНКЦИОНАЛЬНАЯ ХАРАКТЕРИСТИКА ОБЪЕКТА УПРАВЛЕНИЯ
1.1.3 ЭКОНОМИЧЕСКАЯ ХАРАКТЕРИСТИКА ПРЕДМЕТНОЙ ОБЛАСТИ
1.2 ЭКОНОМИЧЕСКАЯ СУЩНОСТЬ КОМПЛЕКСА ЭКОНОМИЧЕСКИХ ИНФОРМАЦИОННЫХ ЗАДАЧ. РЕАЛИЗАЦИЯ ЭКОНОМИЧЕСКОЙ МОДЕЛИ ПРЕДПРИЯТИЯ С ПОМОЩЬЮ УЧЕТНОЙ СИСТЕМЫ 1С УCН
1.2.1 ОБЩИЕ СВЕДЕНИЯ О ЗАДАЧАХ. ОПИСАНИЕ ИМЕЮЩЕЙСЯ УЧЕТНОЙ СХЕМЫ ПРЕДПРИЯТИЯ В РАМКАХ УСН 1С
1.2.2 ОБОСНОВАНИЕ ВЫБОРА ЗАДАЧ, ВХОДЯЩИХ В КОМПЛЕКС. ПРЕИМУЩЕСТВА ОСНОВНОЙ УЧЕТНОЙ СИСТЕМЫ 1С УСН, А ТАКЖЕ НЕДОСТАЮЩИЕ ЗВЕНЬЯ АВТОМАТИЗИРОВАННОГО УЧЕТА
1.2.3 СПОСОБЫ РЕШЕНИЯ ЗАДАЧИ. ОБЩАЯ МОДЕЛЬ ПОДБОРА РЕШЕНИЯ
1.3 ОБОСНОВАНИЕ ПРОЕКТНЫХ РЕШЕНИЙ ПО АВТОМАТИЗИРОВАННОМУ РЕШЕНИЮ ЭКОНОМИКО-ИНФОРМАЦИОННЫХ ЗАДАЧ. ОСНОВНЫЕ МОМЕНТЫ АВТОМАТИЗАЦИИ УЧЕТА ДЕЯТЕЛЬНОСТИ ПРЕДПРИЯТИЯ. РЕШЕНИЕ НАШИХ ЗАДАЧ С ТОЧКИ ЗРЕНИЯ АВТОМАТИЗАЦИИ УЧЕТА НА ПРЕДПРИЯТИИ
1.3.1 ОБОСНОВАНИЕ ПРОЕКТНЫХ РЕШЕНИЙ ПО ИНФОРМАЦИОННОМУ ОБЕСПЕЧЕНИЮ КОМПЛЕКСА ЗАДАЧ. ПОДБОР ИНФОРМАЦИОННОГО ОБЕСПЕЧЕНИЯ ДЛЯ БЛОКА РАБОТЫ С УНИФИЦИРОВАННЫМИ ФОРМАМИ
1.3.2 ОБОСНОВАНИЕ ПРОЕКТНЫХ РЕШЕНИЙ ПО ТЕХНОЛОГИИ СБОРА, ПЕРЕДАЧИ, ОБРАБОТКИ И ВЫДАЧИ ИНФОРМАЦИИ. РЕАЛИЗАЦИЯ НЕДОСТАЮЩЕГО В УСН БЛОКА РАБОТЫ С УНИФИЦИРОВАННЫМИ ФОРМАМИ
1.3.3 ОБОСНОВАНИЕ ПРОЕКТНЫХ РЕШЕНИЙ ПО ПРОГРАММНОМУ ОБЕСПЕЧЕНИЮ КОМПЛЕКСА ЗАДАЧ
1.3.4 ОБОСНОВАНИЕ НЕОБХОДИМОСТИ ИСПОЛЬЗОВАНИЯ ВЫЧИСЛИТЕЛЬНОЙ ТЕХНИКИ И СОЗДАНИЯ АРМ ДЛЯ РЕШЕНИЯ ДАННОГО КОМПЛЕКСА ЗАДАЧ
2. ПРОЕКТНАЯ ЧАСТЬ
2.1 ИНФОРМАЦИОННОЕ ОБЕСПЕЧЕНИЕ КОМПЛЕКСА ЗАДАЧ
2.1.1 ИНФОЛОГИЧЕСКАЯ (ИНФОРМАЦИОННАЯ) МОДЕЛЬ (СХЕМА ДАННЫХ) И ЕЕ ОПИСАНИЕ
2.1.2 ИСПОЛЬЗУЕМЫЕ КЛАССИФИКАТОРЫ И СИСТЕМЫ КОДИРОВАНИЯ
2.1.3 ХАРАКТЕРИСТИКА ВХОДНОЙ ИНФОРМАЦИИ
2.1.4 НОРМАТИВНО-СПРАВОЧНАЯ ИНФОРМАЦИЯ
2.1.5 ХАРАКТЕРИСТИКА РЕЗУЛЬТАТНОЙ ИНФОРМАЦИИ
2.2 ВНУТРИМАШИННАЯ РЕАЛИЗАЦИЯ КОМПЛЕКСА ЗАДАЧ
2.2.1 ФОРМАЛИЗАЦИЯ РАСЧЕТОВ (АЛГОРИТМЫ РАСЧЕТА И РЕШЕНИЯ ЗАДАЧ)
2.2.2 СТРУКТУРНАЯ СХЕМА ИСПОЛЬЗОВАНИЯ КОМПЛЕКСА ПРОГРАММ (ДЕРЕВО ДИАЛОГА). ВЗАИМОДЕЙСТВИЕ УСН С БЛОКОМ ФОРМИРОВАНИЯ УНИФИЦИРОВАННЫХ ФОРМ
2.2.3 ОПИСАНИЕ ИНТЕРФЕЙСА ПРИЛОЖЕНИЯ.
2.3.1 ОРГАНИЗАЦИЯ ТЕХНОЛОГИИ СБОРА, ПЕРЕДАЧИ, ОБРАБОТКИ И ВЫДАЧИ ИНФОРМАЦИИ
2.3.2 СХЕМА ТЕХНОЛОГИЧЕСКОГО ПРОЦЕССА СБОРА, ПЕРЕДАЧИ, ОБРАБОТКИ И ВЫДАЧИ ИНФОРМАЦИИ
2.4 ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ КОМПЛЕКСА ЗАДАЧ
2.4.1 ОБЩИЕ ПОЛОЖЕНИЯ
2.4.2 СТРУКТУРНАЯ СХЕМА ПАКЕТА (ДЕРЕВО ВЫЗОВА ПРОЦЕДУР И ПРОГРАММ). ОПИСАНИЕ ПРОГРАММНЫХ МОДУЛЕЙ
2.5 СХЕМА ВЗАИМОСВЯЗИ ПРОГРАММНЫХ МОДУЛЕЙ И ИНФОРМАЦИОННЫХ ФАЙЛОВ
2.6 ВЫБОР И ОБОСНОВАНИЕ ТЕХНИЧЕСКИХ СРЕДСТВ
2.7 ЭКОНОМИЧЕСКОЕ ОБОСНОВАНИЕ ПРОЕКТА
ЗАКЛЮЧЕНИЕ
СПИСОК ИСПОЛЬЗОВАННЫХ ИСТОЧНИКОВ
oApp. ActiveWorkbook. Sheets (3). Select
oApp. Cells (riKolNomProp2, ciKolNomProp2). Value = translateNumber (i)
oApp. Cells (riKolProp2, ciKolProp2). Value = translateNumber (StrItogKol)
oApp. Cells (riSumProp2, ciSumProp2). Value = translateNumber (Int (StrItog))
oApp. Cells (riSumKopProp2, ciSumKopProp2). Value = Format$ (Int ( (StrItog - Int (StrItog)) * 100 + 0.5), "00")
oApp. Cells (rPredsName, cPredsName). Value = StrPredsName
oApp. Cells (rPredsDolzh, cPredsDolzh). Value = StrPredsDolzh
oApp. Cells (rChl1Name, cChl1Name). Value = StrChl1Name
oApp. Cells (rChl1Dolzh, cChl1Dolzh). Value = StrChl1Dolzh
oApp. Cells (rChl2Name, cChl2Name). Value = StrChl2Name
oApp. Cells (rChl2Dolzh, cChl2Dolzh). Value = StrChl2Dolzh
oApp. Cells (rChl3Name, cChl3Name). Value = StrChl3Name
oApp. Cells (rChl3Dolzh, cChl3Dolzh). Value = StrChl3Dolzh
oApp. Cells (r2MatDolzhn1, c2MatDolzhn1). Value = StrMatDolzhn1
oApp. Cells (r2MatDolzhn2, c2MatDolzhn2). Value = StrMatDolzhn2
oApp. Cells (r2MatDolzhn3, c2MatDolzhn3). Value = StrMatDolzhn3
oApp. Cells (r2MatName1, c2MatName1). Value = StrMatName1
oApp. Cells (r2MatName2, c2MatName2). Value = StrMatName2
oApp. Cells (r2MatName3, c2MatName3). Value = StrMatName3
oApp. Cells (rDatPodpDay, cDatPodpDay). Value = Format$ (StrDatePodp, "dd")
oApp. Cells (rDatPodpMon, cDatPodpMon). Value = StrMonthPodp
oApp. Cells (rDatPodpYear, cDatPodpYear). Value = Format$ (StrDatePodp, "yyyy")
oApp. Cells (rDatProvDay, cDatProvDay). Value = Format$ (StrDateProv, "dd")
oApp. Cells (rDatProvMon, cDatProvMon). Value = StrMonthProv
oApp. Cells (rDatProvYear, cDatProvYear). Value = Format$ (StrDateProv, "yyyy")
ex:
Application. SysCmd acSysCmdRemoveMeter
If Not (oApp Is Nothing) Then oApp. Visible = True
Set RecList = Nothing
Set oApp = Nothing
Set db = Nothing
Exit Sub
LblErr:
MsgBox Err. Description, vbCritical + vbOKOnly
GoTo ex
End Sub
Код модуля OS1
Option Compare Database
Option Explicit
Private Const NomerForm As Long = 3
Private Const cRukDolzh As Byte = 56
Private Const rRukDolzh As Integer = 4
Private Const cRukName As Byte = 85
Private Const rRukName As Integer = 4
Private Const cDatRukDay As Byte = 62
Private Const rDatRukDay As Integer = 6
Private Const cDatRukMon As Byte = 66
Private Const rDatRukMon As Integer = 6
Private Const cDatRukYear As Byte = 79
Private Const rDatRukYear As Integer = 6
Private Const cFirmName As Byte = 16
Private Const rFirmName As Integer = 9
Private Const cFirmOKPO As Byte = 88
Private Const rFirmOKPO As Integer = 9
Private Const cFirmAddr As Byte = 1
Private Const rFirmAddr As Integer = 11
Private Const cFirmReq As Byte = 1
Private Const rFirmReq As Integer = 13
Private Const cOsn As Byte = 18
Private Const rOsn As Integer = 25
Private Const cDatPriem As Byte = 88
Private Const rDatPriem As Integer = 28
Private Const cSchet As Byte = 88
Private Const rSchet As Integer = 30
Private Const cAmort As Byte = 88
Private Const rAmort As Integer = 32
Private Const cInv As Byte = 88
Private Const rInv As Integer = 33
Private Const cNomer As Byte = 36
Private Const rNomer As Integer = 32
Private Const cDat As Byte = 49
Private Const rDat As Integer = 32
Private Const cTovar As Byte = 15
Private Const rTovar As Integer = 36
Private Const cMest As Byte = 29
Private Const rMest As Integer = 39
Private Const cPerv As Byte = 65
Private Const rPerv As Integer = 13
Private Const cSrok As Byte = 73
Private Const rSrok As Integer = 13
Private Const cType As Byte = 81
Private Const rType As Integer = 13
Private Const cName2 As Byte = 1
Private Const rName2 As Integer = 24
Private Const cKol As Byte = 37
Private Const rKol As Integer = 24
Private Const cDatIspDay As Byte = 20
Private Const rDatIspDay As Integer = 3
Private Const cDatIspMon As Byte = 24
Private Const rDatIspMon As Integer = 3
Private Const cDatIspYear As Byte = 37
Private Const rDatIspYear As Integer = 3
Private Const cSootv1 As Byte = 31
Private Const rSootv1 As Integer = 5
Private Const cSootv2 As Byte = 31
Private Const rSootv2 As Integer = 6
Private Const cDorab1 As Byte = 57
Private Const rDorab1 As Integer = 5
Private Const cDorab2 As Byte = 57
Private Const rDorab2 As Integer = 6
Private Const cSootvInf As Byte = 1
Private Const rSootvInf As Integer = 7
Private Const cDorabInf As Byte = 51
Private Const rDorabInf As Integer = 7
Private Const cResult As Byte = 13
Private Const rResult As Integer = 11
Private Const cTDoc As Byte = 22
Private Const rTDoc As Integer = 13
Private Const cPredsDolzh As Byte = 15
Private Const rPredsDolzh As Integer = 14
Private Const cChl1Dolzh As Byte = 15
Private Const rChl1Dolzh As Integer = 16
Private Const cChl2Dolzh As Byte = 15
Private Const rChl2Dolzh As Integer = 18
Private Const cPredsName As Byte = 49
Private Const rPredsName As Integer = 14
Private Const cChl1Name As Byte = 49
Private Const rChl1Name As Integer = 16
Private Const cChl2Name As Byte = 49
Private Const rChl2Name As Integer = 18
Private Const cPrinDolzh As Byte = 56
Private Const rPrinDolzh As Integer = 24
Private Const cPrinName As Byte = 85
Private Const rPrinName As Integer = 24
Private Const cDatPrinDay As Byte = 52
Private Const rDatPrinDay As Integer = 27
Private Const cDatPrinMon As Byte = 56
Private Const rDatPrinMon As Integer = 27
Private Const cDatPrinYear As Byte = 69
Private Const rDatPrinYear As Integer = 27
Private Const cDatDovDay As Byte = 63
Private Const rDatDovDay As Integer = 28
Private Const cDatDovMon As Byte = 67
Private Const rDatDovMon As Integer = 28
Private Const cDatDovYear As Byte = 80
Private Const rDatDovYear As Integer = 28
Private Const cDatDovNomer As Byte = 85
Private Const rDatDovNomer As Integer = 28
Private Const cDatDovOsn As Byte = 57
Private Const rDatDovOsn As Integer = 29
Private Const cXranDolzh As Byte = 51
Private Const rXranDolzh As Integer = 32
Private Const cXranName As Byte = 80
Private Const rXranName As Integer = 32
Private Const cDatXranDay As Byte = 52
Private Const rDatXranDay As Integer = 35
Private Const cDatXranMon As Byte = 56
Private Const rDatXranMon As Integer = 35
Private Const cDatXranYear As Byte = 69
Private Const rDatXranYear As Integer = 35
Private Const cXranNomer As Byte = 85
Private Const rXranNomer As Integer = 34
Private Const cNomer2 As Byte = 80
Private Const rNomer2 As Integer = 39
Private Const cDatSost As Byte = 90
Private Const rDatSost As Integer = 39
Private Const cBuchName As Byte = 75
Private Const rBuchName As Integer = 41
Sub PrintFormOS1 (ByVal nomer As Long)
Dim db As Database, Rec As DAO. Recordset, RecList As DAO. Recordset
Dim oApp As Object
Dim StrFormName As String
Dim StrFile As String, s_folder As String, StrPath As String
Dim StrGlBuch As String
Dim StrFirmName As String, StrFirmOKPO As String, StrFirmAddr As String, StrFirmReq As String
Dim StrRukName As String, StrRukDolzh As String
Dim StrDatePodp As Date, StrDatePriem As Date, StrDate As Date, StrDateIsp As Date, StrPrinDate As Date, StrDovDate As Date, StrXranDate As Date
Dim StrOsn As String, StrSchet As String, StrAmort As String
Dim NomerVnutr As String, StrTovar As String
Dim StrInv As String
Dim StrStoim As Double, StrSroki As Long
Dim StrMethod As String, StrMest As String
Dim StrKol As Long
Dim vbSootv As Boolean, vbDorab As Boolean
Dim StrSootv As String, StrDorab As String
Dim StrZakl As String, StrTechDoc As String
Dim StrPredsName As String, StrPredsDolzh As String
Dim StrChl1Name As String, StrChl1Dolzh As String
Dim StrChl2Name As String, StrChl2Dolzh As String
Dim StrPrinName As String, StrPrinDolzh As String
Dim StrDovFor As String, StrDovNom As String
Dim StrXranName As String, StrXranDolzh As String, StrXranNomer As String
Dim StrMonthPodp As String, StrMonthIsp As String, StrMonthPrin As String, StrMonthDov As String, StrMonthXran As String
On Error GoTo LblErr
If nomer = 0 Then Exit Sub
s_folder = CurrentProject. Path
If Right$ (s_folder,
1) <> "\" Then s_folder = s_folder + "\"
s_folder = s_folder + "blanks\"
If Len (Dir$ (s_folder, vbDirectory)) = 0 Then
MsgBox "Путь к папке с бланками " & s_folder & " не обнаружен!", vbCritical + vbOKOnly
Exit Sub
End If
Set db = CurrentDb
Set Rec = db. OpenRecordset ("select * from Формы where НомерФорма = " & NomerForm, dbOpenSnapshot)
If Rec. RecordCount > 0 Then
StrFormName = Rec. Fields ("Наименование"). Value
StrFile = Rec. Fields ("Файл"). Value
Else
Set Rec = Nothing
MsgBox "Нет информации о форме №" & NomerForm & "!", vbCritical + vbOKOnly
Exit Sub
End If
Set Rec = Nothing
StrPath = s_folder + StrFile
If Len (Dir$ (StrPath)) = 0 Then
MsgBox "Файл бланка формы '" & StrFormName & "' " & StrPath & " не обнаружен!", vbCritical + vbOKOnly
Exit Sub
End If
Set Rec = db. OpenRecordset ("SELECT Параметры. *, Сотрудники. Сотрудник FROM Сотрудники INNER JOIN Параметры ON Сотрудники. НомерСотр = Параметры. ГлБухгалтер", dbOpenSnapshot)
If Rec. RecordCount > 0 Then
StrFirmName = Nz (Rec. Fields ("НаименованиеФирмы"). Value, "")
StrFirmOKPO = Nz (Rec. Fields ("ОКПО"). Value, "")
StrGlBuch = Nz (Rec. Fields ("Сотрудник"). Value, "")
StrFirmAddr = Nz (Rec. Fields ("ЮрАдрес"). Value, "")
StrFirmReq = Nz (Rec. Fields ("БанкРеквизиты"). Value, "")
Else
MsgBox "Общие параметры фирмы не занесены!", vbCritical + vbOKOnly
Exit Sub
End If
Set Rec = Nothing
Set Rec = db. OpenRecordset ("select * from запрос_АктыПриемки where НомерАкт = " & nomer, dbOpenSnapshot)
If Rec. RecordCount > 0 Then
StrRukName = Nz (Rec. Fields ("s_ruk"). Value, "")
StrRukDolzh = Nz (Rec. Fields ("d_ruk"). Value, "")
StrDatePodp = Nz (Rec. Fields ("ДатаПодписи"). Value, Date)
StrOsn = Nz (Rec. Fields ("Основание"). Value, "")
StrDatePriem = Nz (Rec. Fields ("ДатаПриемки"). Value, Date)
StrSchet = Nz (Rec. Fields ("Счет"). Value, "")
StrAmort = Nz (Rec. Fields ("НомерАмортГруппы"). Value, "")
NomerVnutr = Nz (Rec. Fields ("НомерВнутр"). Value, nomer)
StrDate = Nz (Rec. Fields ("ДатаАкта"). Value, Date)
StrTovar = Nz (Rec. Fields ("Товар"). Value, "")
StrInv = Nz (Rec. Fields ("ИнвКод"). Value, "")
StrStoim = Nz (Rec. Fields ("ПервСтоииость"). Value, 0)
StrSroki = Nz (Rec. Fields ("СрокИспользования"). Value, 0)
StrMethod = Nz (Rec. Fields ("СпособАморт"). Value, "")
StrMest = Nz (Rec. Fields ("Местонахождение"). Value, "")
StrKol = Nz (Rec. Fields ("Количество"). Value,
1)
StrDateIsp = Nz (Rec. Fields ("ДатаИспытания"). Value, Date)
vbSootv = Nz (Rec. Fields ("Соотвествие"). Value, True)
vbDorab = Nz (Rec. Fields ("Доработка"). Value, False)
StrSootv = Nz (Rec. Fields ("ЧтоСоотв"). Value, "")
StrDorab = Nz (Rec. Fields ("ЧтоДораб"). Value, "")
StrZakl = Nz (Rec. Fields ("Заключение"). Value, "")
StrTechDoc = Nz (Rec. Fields ("ТехДок"). Value, "")
StrPredsName = Nz (Rec. Fields ("s_preds"). Value, "")
StrPredsDolzh = Nz (Rec. Fields ("d_preds"). Value, "")
StrChl1Name = Nz (Rec. Fields ("s_4l1"). Value, "")
StrChl1Dolzh = Nz (Rec. Fields ("d_4l1"). Value, "")
StrChl2Name = Nz (Rec. Fields ("s_4l2"). Value, "")
StrChl2Dolzh = Nz (Rec. Fields ("d_4l2"). Value, "")
StrPrinName = Nz (Rec. Fields ("s_prin"). Value, "")
StrPrinDolzh = Nz (Rec. Fields ("d_prin"). Value, "")
StrPrinDate = Nz (Rec. Fields ("ДатаПринятия"). Value, Date)
StrDovFor = Nz (Rec. Fields ("ВыданаДов"). Value, "")
StrDovDate = Nz (Rec. Fields ("ДатаДов"). Value, Date)
StrDovNom = Nz (Rec. Fields ("НомерДов"). Value, "1")
StrXranName = Nz (Rec. Fields ("s_xran"). Value, "")
StrXranDolzh = Nz (Rec. Fields ("d_xran"). Value, "")
StrXranNomer = Nz (Rec. Fields ("s_nomer"). Value, "")
StrXranDate = Nz (Rec. Fields ("ДатаХранения"). Value, Date)
Else
MsgBox "Акт приемки №" & nomer & " не найден!", vbCritical + vbOKOnly
Exit Sub
End If
Set Rec = Nothing
Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrDatePodp), dbOpenSnapshot)
If Rec. RecordCount > 0 Then
StrMonthPodp = Nz (Rec. Fields ("НазвМес"). Value, "")
Else
StrMonthPodp = "нет названия"
End If
Set Rec = Nothing
Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrDateIsp), dbOpenSnapshot)
If Rec. RecordCount > 0 Then
StrMonthIsp = Nz (Rec. Fields ("НазвМес"). Value, "")
Else
StrMonthIsp = "нет названия"
End If
Set Rec = Nothing
Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrPrinDate), dbOpenSnapshot)
If Rec. RecordCount > 0 Then
StrMonthPrin = Nz (Rec. Fields ("НазвМес"). Value, "")
Else
StrMonthPrin = "нет названия"
End If
Set Rec = Nothing
Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrDovDate), dbOpenSnapshot)
If Rec. RecordCount > 0 Then
StrMonthDov = Nz (Rec. Fields ("НазвМес"). Value, "")
Else
StrMonthDov = "нет названия"
End If
Set Rec = Nothing
Set Rec = db. OpenRecordset ("select * from ВспомДата where НомерМес = " & Month (StrXranDate), dbOpenSnapshot)
If Rec. RecordCount > 0 Then
StrMonthXran = Nz (Rec. Fields ("НазвМес"). Value, "")
Else
StrMonthXran = "нет названия"
End If
Set Rec = Nothing
Set oApp = CreateObject ("Excel. Application")
oApp. Workbooks. Open FileName: =StrPath, ReadOnly: =True
oApp. ActiveWorkbook. Sheets (1). Select
oApp. Cells (rRukName, cRukName). Value = StrRukName
oApp. Cells (rRukDolzh, cRukDolzh). Value = StrRukDolzh
oApp. Cells (rDatRukDay, cDatRukDay). Value = Format$ (StrDatePodp, "dd")
oApp. Cells (rDatRukMon, cDatRukMon). Value = StrMonthPodp
oApp. Cells (rDatRukYear, cDatRukYear). Value = Right$ (Format$ (StrDatePodp, "yyyy"),
1)
oApp. Cells (rFirmName, cFirmName). Value = StrFirmName
oApp. Cells (rFirmOKPO, cFirmOKPO). Value = StrFirmOKPO
oApp. Cells (rFirmAddr, cFirmAddr). Value = StrFirmAddr
oApp. Cells (rFirmReq, cFirmReq). Value = StrFirmReq
oApp. Cells (rOsn, cOsn). Value = StrOsn
oApp. Cells (rDatPriem, cDatPriem). Value = Format$ (StrDatePriem, "dd. mm. yyyy")
oApp. Cells (rSchet, cSchet). Value = StrSchet
oApp. Cells (rAmort, cAmort). Value = StrAmort
oApp. Cells (rInv, cInv). Value = StrInv
oApp. Cells (rNomer, cNomer). Value = NomerVnutr
oApp. Cells (rDat, cDat). Value = Format$ (StrDate, "dd. mm. yyyy")
oApp. Cells (rTovar, cTovar). Value = StrTovar
oApp. Cells (rMest, cMest). Value = StrMest
oApp. ActiveWorkbook. Sheets (2). Select
oApp. Cells (rPerv, cPerv). Value = StrStoim
oApp. Cells (rSrok, cSrok). Value = StrSroki
oApp. Cells (rType, cType). Value = StrMethod
oApp. Cells (rName2, cName2). Value = StrTovar
oApp. Cells (rKol, cKol). Value = StrKol & " шт."
oApp. ActiveWorkbook. Sheets (3). Select
oApp. Cells (rDatIspDay, cDatIspDay). Value = Format$ (StrDateIsp, "dd")
oApp. Cells (rDatIspMon, cDatIspMon). Value = StrMonthIsp
oApp. Cells (rDatIspYear, cDatIspYear). Value = Right$ (Format$ (StrDateIsp, "yyyy"),
1)
If vbSootv = True Then
oApp. Cells (rSootv1, cSootv1). Font. Bold = True
oApp. Cells (rSootv2, cSootv2). Font. Bold = False
oApp. Cells (rSootvInf, cSootvInf). Value = ""
Else
oApp. Cells (rSootv1, cSootv1). Font. Bold = False
oApp. Cells (rSootv2, cSootv2). Font. Bold = True
oApp. Cells (rSootvInf, cSootvInf). Value = StrSootv
End If
If vbDorab = True Then
oApp. Cells (rDorab1, cDorab1). Font. Bold = True
oApp. Cells (rDorab2, cDorab2). Font. Bold = False
oApp. Cells (rDorabInf, cDorabInf). Value = StrDorab
Else
oApp. Cells (rDorab1, cDorab1). Font. Bold = False
oApp. Cells (rDorab2, cDorab2). Font. Bold = True
oApp. Cells (rDorabInf, cDorabInf). Value = ""
End If
oApp. Cells (rResult, cResult). Value = StrZakl
oApp. Cells (rTDoc, cTDoc). Value = StrTechDoc
oApp. Cells (rPredsName, cPredsName). Value = StrPredsName
oApp. Cells (rPredsDolzh, cPredsDolzh). Value = StrPredsDolzh
oApp. Cells (rChl1Name, cChl1Name). Value = StrChl1Name
oApp. Cells (rChl1Dolzh, cChl1Dolzh). Value = StrChl1Dolzh
oApp. Cells (rChl2Name, cChl2Name). Value = StrChl2Name
oApp. Cells (rChl2Dolzh, cChl2Dolzh). Value = StrChl2Dolzh
oApp. Cells (rPrinName, cPrinName). Value = StrPrinName
oApp. Cells (rPrinDolzh, cPrinDolzh). Value = StrPrinDolzh
oApp. Cells (rDatPrinDay, cDatPrinDay). Value = Format$ (StrPrinDate, "dd")
oApp. Cells (rDatPrinMon, cDatPrinMon). Value = StrMonthPrin
oApp. Cells (rDatPrinYear, cDatPrinYear). Value = Right$ (Format$ (StrPrinDate, "yyyy"),
1)
oApp. Cells (rDatDovDay, cDatDovDay). Value = Format$ (StrDovDate, "dd")
oApp. Cells (rDatDovMon, cDatDovMon). Value = StrMonthDov
oApp. Cells (rDatDovYear, cDatDovYear). Value = Right$ (Format$ (StrDovDate, "yyyy"),
1)
oApp. Cells (rDatDovOsn, cDatDovOsn). Value = StrDovFor
oApp. Cells (rDatDovNomer, cDatDovNomer). Value = StrDovNom
oApp. Cells (rXranName, cXranName). Value = StrXranName
oApp. Cells (rXranDolzh, cXranDolzh). Value = StrXranDolzh
oApp. Cells (rXranNomer, cXranNomer). Value = StrXranNomer
oApp. Cells (rDatXranDay, cDatXranDay). Value = Format$ (StrXranDate, "dd")
oApp. Cells (rDatXranMon, cDatXranMon). Value = StrMonthXran
oApp. Cells (rDatXranYear, cDatXranYear). Value = Right$ (Format$ (StrXranDate, "yyyy"),
1)
oApp. Cells (rNomer2, cNomer2). Value = NomerVnutr
oApp. Cells (rDatSost, cDatSost). Value = Format$ (StrDate, "dd. mm. yyyy")
oApp. Cells (rBuchName, cBuchName). Value = StrGlBuch
ex:
Application. SysCmd acSysCmdRemoveMeter
If Not (oApp Is Nothing) Then oApp. Visible = True
Set Rec = Nothing
Set RecList = Nothing
Set oApp = Nothing
Set db = Nothing
Exit Sub
LblErr:
MsgBox Err. Description, vbCritical + vbOKOnly
GoTo ex
End Sub
Код модуля OS2
Option Compare Database
Option Explicit
Private Const NomerForm As Long = 2
Private Const cFirmName As Byte = 1
Private Const rFirmName As Integer = 7
Private Const cFirmOKPO As Byte = 88
Private Const rFirmOKPO As Integer = 7
Private Const cPodrazdName1 As Byte = 7
Private Const rPodrazdName1 As Integer = 9
Private Const cPodrazdOKPO1 As Byte = 88
Private Const rPodrazdOKPO1 As Integer = 8
Private Const cPodrazdName2 As Byte = 9
Private Const rPodrazdName2 As Integer = 11
Private Const cPodrazdOKPO2 As Byte = 88
Private Const rPodrazdOKPO2 As Integer = 10
Private Const cDateNakl As Byte = 69
Private Const rDateNakl As Integer = 16
Private Const cNomerNakl As Byte = 57
Private Const rNomerNakl As Integer = 16
Private Const cNomer As Byte = 1
Private Const cTovar As Byte = 5
Private Const cYear As Byte = 48
Private Const cInv As Byte = 58
Private Const cKol As Byte = 70
Private Const cCena As Byte = 80
Private Const cSum As Byte = 90
Private Const rSh1_1 As Integer = 24
Private Const rSh1_2 As Integer = 39
Private Const rSh2_1 As Integer = 8
Private Const rSh2_2 As Integer = 19
Private Const cSumItog As Byte = 90
Private Const rSumItog As Integer = 20
Private Const cSotrName1 As Byte = 42
Private Const rSotrName1 As Byte = 31
Private Const cSotrDolzh1 As Byte = 7
Private Const rSotrDolzh1 As Byte = 31
Private Const cSotrNomer1 As Byte = 64
Private Const rSotrNomer1 As Byte = 31
Private Const cDatDay1 As Byte = 79
Private Const rDatDay1 As Byte = 31
Private Const cDatMonth1 As Byte = 83
Private Const rDatMonth1 As Byte = 31
Private Const cDatYear1 As Byte = 96
Private Const rDatYear1 As Byte = 31
Private Const cSotrName2 As Byte = 42
Private Const rSotrName2 As Byte = 34
Private Const cSotrDolzh2 As Byte = 7
Private Const rSotrDolzh2 As Byte = 34
Private Const cSotrNomer2 As Byte = 64
Private Const rSotrNomer2 As Byte = 34
Private Const cDatDay2 As Byte = 79
Private Const rDatDay2 As Byte = 34
Private Const cDatMonth2 As Byte = 83
Private Const rDatMonth2 As Byte = 34
Private Const cDatYear2 As Byte = 96
Private Const rDatYear2 As Byte = 34
Private Const cGlBuch As Byte = 33
Private Const rGlBuch As Byte = 39
Private Const nSymbPrim As Byte = 60
Private Const nSymbPrim2 As Byte = 130
Private Const cPrim As Integer = 51
Private Const rPrim1 As Integer = 22
Private Const cPrim2 As Integer = 1
Private Const rPrim2_1 As Integer = 23