Advertisement
reset_man

Untitled

Apr 18th, 2024
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.97 KB | None | 0 0
  1. Sub formi_e()
  2. Dim ôàéë As Object
  3. Dim end_t As String
  4. Dim tek_ch_zn As String
  5. name_txt = "result.xml"
  6. Set xl_osn = ActiveWorkbook
  7. Set xl_nastr = xl_osn.Sheets("nastr")
  8. Set xl_kontr = xl_osn.Sheets("kontra_list")
  9. Set mDU = CreateObject("scripting.dictionary")
  10. mDU.comparemode = 1 ''ñðàâíåíèå áåç ó÷¸òà ðåãèñòðà
  11. count_xl_kontr = xl_kontr.Cells(Rows.Count, "A").End(xlUp).Row
  12. '-----
  13. Dim wb As Workbook
  14. Dim sSH As Worksheet, t As String
  15. name_open_f = GetFileName("Âûáîð ôàéëà", ThisWorkbook.Path)
  16. If name_open_f = "" Then
  17. MsgBox ("Íå÷åãî îáðàáàòûâàòü")
  18. Exit Sub
  19. End If
  20. 'name_open_f = "D:\all_alex\xls_xml\test.xlsx"
  21. Set wbs = Workbooks.Open(name_open_f)
  22. Set xl_first = wbs.Sheets(1)
  23. For Each ws In wbs.Worksheets
  24. If InStr(1, ws.Name, "ÓÏÄ", vbTextCompare) > 0 Then
  25. Set xl_upd = wbs.Sheets(ws.Name)
  26.  
  27. End If
  28. If InStr(1, ws.Name, "ÊÌ-", vbTextCompare) > 0 Then
  29. Set sSH = wbs.Sheets(ws.Name)
  30.  
  31. End If
  32. Next ws
  33. e = sSH.Range("A" & sSH.Rows.Count).End(xlUp).Row
  34. For xx = 15 To e
  35. t = sSH.Range("I" & xx)
  36. If t <> "" Then mDU(t) = Mid(sSH.Range("A" & xx), 1, 31)
  37. Next
  38. '-----îïðåäåëÿåñ ïîçèöèþ âñåãî ïî óïä
  39. poz_vsego = 15
  40. For i = 15 To 2000
  41. tek_cell = xl_upd.Range("R" & i)
  42. If InStr(1, tek_cell, "Âñåãî ê îïëàòå", vbTextCompare) > 0 Then
  43. poz_vsego = i - 1
  44. Exit For
  45. End If
  46. Next i
  47. '----îïðåäåëÿåì ïî ïåðâîìó ëèñòó
  48. For i = 15 To 2000
  49. tek_cell = xl_first.Range("A" & i)
  50. If Trim(tek_cell) = "" Then
  51. poz_vsego_first = i - 1
  52. Exit For
  53. End If
  54. Next i
  55. '----ýòî âñåãäà 2 ñòðîêà íà ëìèñòå êîíòû
  56.  
  57. id_otpr = xl_kontr.Range("B2") ' ïîñòîÿííî() '"2BM-3702148437-370201001-201709141106289622657"
  58. pîkup_name_org = xl_upd.Range("AB5")
  59. id_pol = "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx"
  60. For rr = 3 To count_xl_kontr
  61. If xl_kontr.Cells(rr, 1) = pîkup_name_org Then
  62. id_pol = xl_kontr.Cells(rr, 2)
  63. Exit For
  64. End If
  65. Next rr
  66. 'id_pol = "2AEE11608B4-C441-48AD-B8D1-4F1751EB7694"
  67. GUID_str = Mid(CreateGuidString(), 2, 36)
  68. Dim tek_date As Date
  69. tek_date = Date
  70. dd = Day(Now)
  71. mm = Month(Now)
  72. If mm <= 9 Then mm_str = "0" & Trim(Str(mm)) Else mm_str = Trim(Str(mm))
  73. gg = Year(Now)
  74. If dd <= 9 Then dd_str = "0" & Trim(Str(dd)) Else dd_str = Trim(Str(dd))
  75.  
  76. time_all = gg & mm_str & dd_str
  77. id_file = "ON_NSCHFDOPPRMARK_" & id_pol & "_" & id_otpr & "_" & time_all & "_" & GUID_str
  78.  
  79. path_tek = xl_osn.Path & "\" & id_file & ".xml" 'name_txt
  80. Set file_l = CreateObject("Scripting.FileSystemObject").CreateTextFile(path_tek, True)
  81.  
  82. xl_osn.Save
  83. file_l.WriteLine "<?xml version=" & Chr(34) & "1.0" & Chr(34) & " encoding=" & Chr(34) & "windows-1251" & Chr(34) & "?>"
  84.  
  85.  
  86.  
  87. file_l.WriteLine "<Ôàéë ÈäÔàéë=" & Chr(34) & id_file & Chr(34) & " ÂåðñÔîðì=" & Chr(34) & "5.01" & Chr(34) & " ÂåðñÏðîã=" & Chr(34) & "Diadoc 1.0" & Chr(34) & ">"
  88. file_l.WriteLine "<ÑâÓ÷ÄîêÎòáîð ÈäÎòïð=" & Chr(34) & id_otpr & Chr(34) & " ÈäÏîë=" & Chr(34) & id_pol & Chr(34) & ">"
  89. file_l.WriteLine "</ÑâÓ÷ÄîêÎòáîð>"
  90. knd = "1115131"
  91. fun_n = "Ñ×ÔÄÎÏ"
  92. pofactHG = "Äîêóìåíò îá îòãðóçêå òîâàðîâ (âûïîëíåíèè ðàáîò), ïåðåäà÷å èìóùåñòâåííûõ ïðàâ (äîêóìåíò îá îêàçàíèè óñëóã)"
  93. NaimDocOPr = "Ñ÷åò-ôàêòóðà è äîêóìåíò îá îòãðóçêå òîâàðîâ (âûïîëíåíèè ðàáîò), ïåðåäà÷å èìóùåñòâåííûõ ïðàâ (äîêóìåíò îá îêàçàíèè óñëóã)"
  94. DateInfPr = "22.03.2024"
  95. VremInfPr = "08.05.28"
  96. prod_name_org = Rep_all(xl_upd.Range("S5"))
  97. NaimEkonSubSost = prod_name_org '"ÎÎÎ &quot;ÀËÜÔÀ-ÒÐÅÉÄ&quot;, ÈÍÍ/ÊÏÏ 3702148437/370201001"
  98. file_l.WriteLine "<Äîêóìåíò ÊÍÄ=" & Chr(34) & knd & Chr(34) & " Ôóíêöèÿ=" & Chr(34) & fun_n & Chr(34) & " ÏîÔàêòÕÆ=" & Chr(34) & pofactHG & Chr(34) & " ÍàèìÄîêÎïð=" & Chr(34) & NaimDocOPr & Chr(34) & " ÄàòàÈíôÏð=" & Chr(34) & DateInfPr & Chr(34) & " ÂðåìÈíôÏð=" & Chr(34) & VremInfPr & Chr(34) & " ÍàèìÝêîíÑóáÑîñò=" & Chr(34) & NaimEkonSubSost & Chr(34) & ">"
  99. num_sf = xl_upd.Range("s2") '"32501"
  100. date_sf = xl_upd.Range("v2") '"25.03.2024"
  101. kod_okv = "643"
  102. file_l.WriteLine "<ÑâÑ÷Ôàêò ÍîìåðÑ÷Ô=" & Chr(34) & num_sf & Chr(34) & " ÄàòàÑ÷Ô=" & Chr(34) & date_sf & Chr(34) & " ÊîäÎÊÂ=" & Chr(34) & kod_okv & Chr(34) & ">"
  103.  
  104. prod_name_org = Rep_all(xl_upd.Range("S5")) '"ÎÎÎ &quot;ÀËÜÔÀ-ÒÐÅÉÄ&quot;"
  105. If InStr(1, xl_upd.Range("S7"), "/", vbTextCompare) > 0 Then
  106. rez1 = Split(xl_upd.Range("S7"), "/")
  107. prod_innul = rez1(0)
  108. prod_kpp = rez1(1)
  109. Else
  110. prod_innul = xl_upd.Range("S7")
  111. prod_kpp = ""
  112. End If
  113. 'prod_innul = "3702148437"
  114. 'prod_kpp = "370201001"
  115. prod_okopo = xl_nastr.Range("B7") '"01154260"
  116. prod_kod_str = xl_nastr.Range("B2") '"643"
  117. prod_adres_txt = xl_upd.Range("S6") '"153005, Èâàíîâñêàÿ îáëàñòü, ã.î. Èâàíîâî, ã Èâàíîâî, óë Ñîñíîâàÿ, ä. 28"
  118. prod_tlf = xl_nastr.Range("B8") '"(4932) 938522"
  119. prod_num_scheta = xl_nastr.Range("B4") '"40702810606200029655"
  120. prod_namebank = xl_nastr.Range("B3") '"ÏÀÎ ÀÊÁ &quot;ÀÂÀÍÃÀÐÄ&quot;"
  121. prod_bik = xl_nastr.Range("B5") '"044525201"
  122. prod_kor_sch = xl_nastr.Range("B6") '"30101810000000000201"
  123. file_l.WriteLine "<ÑâÏðîä ÎÊÏÎ=" & Chr(34) & prod_okopo & Chr(34) & ">"
  124. file_l.WriteLine "<ÈäÑâ>"
  125. file_l.WriteLine "<ÑâÞËÓ÷ ÍàèìÎðã=" & Chr(34) & prod_name_org & Chr(34) & " ÈÍÍÞË=" & Chr(34) & prod_innul & Chr(34) & " ÊÏÏ=" & Chr(34) & prod_kpp & Chr(34) & " />"
  126. file_l.WriteLine "</ÈäÑâ>"
  127. file_l.WriteLine "<Àäðåñ>"
  128. file_l.WriteLine "<ÀäðÈíô ÊîäÑòð=" & Chr(34) & prod_kod_str & Chr(34) & " ÀäðÒåêñò=" & Chr(34) & prod_adres_txt & Chr(34) & " />"
  129. file_l.WriteLine "</Àäðåñ>"
  130. file_l.WriteLine "<Êîíòàêò Òëô=" & Chr(34) & prod_tlf & Chr(34) & " />"
  131. file_l.WriteLine "<ÁàíêÐåêâ ÍîìåðÑ÷åòà=" & Chr(34) & prod_num_scheta & Chr(34) & ">"
  132. file_l.WriteLine "<ÑâÁàíê ÍàèìÁàíê=" & Chr(34) & prod_namebank & Chr(34) & " ÁÈÊ=" & Chr(34) & prod_bik & Chr(34) & " ÊîðÑ÷åò=" & Chr(34) & prod_kor_sch & Chr(34) & " />"
  133. file_l.WriteLine "</ÁàíêÐåêâ>"
  134. file_l.WriteLine "</ÑâÏðîä>"
  135. '---------------ãðóçî îòïðàâèòåëü
  136. If xl_upd.Range("S8") = "îí æå" Then
  137. gruz_otprav_name_org = prod_name_org ' "ÎÎÎ &quot;ÀËÜÔÀ-ÒÐÅÉÄ&quot;"
  138. gruz_otprav_innul = prod_innul ' "3702148437"
  139. gruz_otprav_kpp = prod_kpp ' "370201001"
  140. gruz_otprav_okopo = prod_okopo '"01154260"
  141. gruz_otprav_kod_str = prod_kod_str '"643"
  142. gruz_otprav_adres_txt = prod_adres_txt ' "153005, Èâàíîâñêàÿ îáëàñòü, ã.î. Èâàíîâî, ã Èâàíîâî, óë Ñîñíîâàÿ, ä. 28"
  143. gruz_otprav_tlf = prod_tlf '"(4932) 938522"
  144. End If
  145.  
  146.  
  147. file_l.WriteLine "<ÃðóçÎò>"
  148. file_l.WriteLine "<ÃðóçÎòïð ÎÊÏÎ=" & Chr(34) & gruz_otprav_okopo & Chr(34) & ">"
  149. file_l.WriteLine "<ÈäÑâ>"
  150. file_l.WriteLine "<ÑâÞËÓ÷ ÍàèìÎðã=" & Chr(34) & gruz_otprav_name_org & Chr(34) & " ÈÍÍÞË=" & Chr(34) & gruz_otprav_innul & Chr(34) & " ÊÏÏ=" & Chr(34) & gruz_otprav_kpp & Chr(34) & " />"
  151. file_l.WriteLine "</ÈäÑâ>"
  152. file_l.WriteLine "<Àäðåñ>"
  153. file_l.WriteLine "<ÀäðÈíô ÊîäÑòð=" & Chr(34) & gruz_otprav_kod_str & Chr(34) & " ÀäðÒåêñò=" & Chr(34) & gruz_otprav_adres_txt & Chr(34) & " />"
  154. file_l.WriteLine "</Àäðåñ>"
  155. file_l.WriteLine "<Êîíòàêò Òëô=" & Chr(34) & gruz_otprav_tlf & Chr(34) & " />"
  156. file_l.WriteLine "</ÃðóçÎòïð>"
  157. file_l.WriteLine " </ÃðóçÎò>"
  158. '---------------ãðóçî ïîëó÷àòåëü
  159. gruz_polych_name_org = Rep_all(xl_upd.Range("S9")) '"ÎÎÎ &quot;ÀËÜÔÀ-ÒÐÅÉÄ&quot;"
  160. '--ñ÷èòàåì ÷òî îí æå --ïðîäàâåö
  161. '-------------------ïðîäîâåö
  162. name_org = Rep_all(xl_upd.Range("AB5")) ' "ÎÎÎ &quot;Òðèêîòàæ ÍÀÒÀËÈ&quot;"
  163. If InStr(1, xl_upd.Range("AB7"), "/", vbTextCompare) > 0 Then
  164. rez1 = Split(xl_upd.Range("AB7"), "/")
  165. innul = Replace(rez1(0), "ÈÍÍ", "")
  166. kpp = Replace(rez1(1), "ÊÏÏ", "")
  167. Else
  168. innul = Replace(xl_upd.Range("ab7"), "ÈÍÍ", "")
  169. kpp = ""
  170. End If
  171. okopo = xl_nastr.Range("C7") '"01154260"
  172. 'innul = "3702703225"
  173. 'kpp = "370201001"
  174. kod_str = xl_nastr.Range("c2") '"643"
  175. adress_txt = xl_upd.Range("AB6") ' "153007, Èâàíîâñêàÿ îáë, ã.î. Èâàíîâî, ã Èâàíîâî, óë Ôðóíçå, ä. 97"
  176. num_scheta = xl_nastr.Range("C4") '"40702810917000006966"
  177. namebank = xl_nastr.Range("C3") ' "Èâàíîâñêîå îòäåëåíèå ¹8639 ÏÀÎ Ñáåðáàíê"
  178. bik = xl_nastr.Range("C5") '"042406608"
  179. korr_num = xl_nastr.Range("C6") ' "30101810000000000608"
  180.  
  181. gruz_polych_innul = innul ' "3702148437"
  182. gruz_polych_kpp = kpp '"370201001"
  183. gruz_polych_okopo = okopo '"01154260"
  184. gruz_polych_kod_str = "643"
  185. gruz_polych_adres_txt = xl_upd.Range("v9") '"153005, Èâàíîâñêàÿ îáëàñòü, ã.î. Èâàíîâî, ã Èâàíîâî, óë Ñîñíîâàÿ, ä. 28"
  186. gruz_polych_tlf = "(4932) 938522"
  187. gruz_polych_num_scheta = num_scheta '"40702810606200029655"
  188. gruz_polych_namebank = namebank '"ÏÀÎ ÀÊÁ &quot;ÀÂÀÍÃÀÐÄ&quot;"
  189. gruz_polych_bik = bik '"044525201"
  190. gruz_polych_kor_sch = korr_num '"30101810000000000201"
  191. file_l.WriteLine "<ÃðóçÏîëó÷>"
  192. file_l.WriteLine "<ÈäÑâ>"
  193. file_l.WriteLine "<ÑâÞËÓ÷ ÍàèìÎðã=" & Chr(34) & gruz_polych_name_org & Chr(34) & " ÈÍÍÞË=" & Chr(34) & gruz_polych_innul & Chr(34) & " ÊÏÏ=" & Chr(34) & gruz_polych_kpp & Chr(34) & " />"
  194. file_l.WriteLine "</ÈäÑâ>"
  195. file_l.WriteLine "<Àäðåñ>"
  196. file_l.WriteLine "<ÀäðÈíô ÊîäÑòð=" & Chr(34) & gruz_polych_kod_str & Chr(34) & " ÀäðÒåêñò=" & Chr(34) & gruz_polych_adres_txt & Chr(34) & " />"
  197. file_l.WriteLine "</Àäðåñ>"
  198. file_l.WriteLine "<ÁàíêÐåêâ ÍîìåðÑ÷åòà=" & Chr(34) & gruz_polych_num_scheta & Chr(34) & ">"
  199. file_l.WriteLine "<ÑâÁàíê ÍàèìÁàíê=" & Chr(34) & gruz_polych_namebank & Chr(34) & " ÁÈÊ=" & Chr(34) & gruz_polych_bik & Chr(34) & " ÊîðÑ÷åò=" & Chr(34) & gruz_polych_kor_sch & Chr(34) & " />"
  200. file_l.WriteLine "</ÁàíêÐåêâ>"
  201. file_l.WriteLine "</ÃðóçÏîëó÷>"
  202.  
  203. nameovk = "Ðîññèéñêèé ðóáëü"
  204. ÍàèìÄîêÎòãð = "Ðåàëèçàöèÿ (àêò, íàêëàäíàÿ, ÓÏÄ)"
  205. numdok_otgr = xl_upd.Range("S11") '"ï/ï 1 - 6 ¹ 32501"
  206. date_dok_otgr = xl_upd.Range("w11") '"25.03.2024"
  207. file_l.WriteLine "<ÑâÏîêóï>"
  208. file_l.WriteLine "<ÈäÑâ>"
  209. file_l.WriteLine "<ÑâÞËÓ÷ ÍàèìÎðã=" & Chr(34) & name_org & Chr(34) & " ÈÍÍÞË=" & Chr(34) & innul & Chr(34) & " ÊÏÏ=" & Chr(34) & kpp & Chr(34) & " />"
  210. file_l.WriteLine "</ÈäÑâ>"
  211. file_l.WriteLine "<Àäðåñ>"
  212. file_l.WriteLine "<ÀäðÈíô ÊîäÑòð=" & Chr(34) & kod_str & Chr(34) & " ÀäðÒåêñò=" & Chr(34) & adress_txt & Chr(34) & " />"
  213.  
  214. file_l.WriteLine "</Àäðåñ>"
  215. file_l.WriteLine "<ÁàíêÐåêâ ÍîìåðÑ÷åòà=" & Chr(34) & num_scheta & Chr(34) & ">"
  216. file_l.WriteLine "<ÑâÁàíê ÍàèìÁàíê=" & Chr(34) & namebank & Chr(34) & " ÁÈÊ=" & Chr(34) & bik & Chr(34) & " ÊîðÑ÷åò=" & Chr(34) & korr_num & Chr(34) & " />"
  217. file_l.WriteLine "</ÁàíêÐåêâ>"
  218. file_l.WriteLine "</ÑâÏîêóï>"
  219. file_l.WriteLine "<ÄîïÑâÔÕÆ1 ÍàèìÎÊÂ=" & Chr(34) & nameovk & Chr(34) & " />"
  220. file_l.WriteLine "<ÄîêÏîäòâÎòãð ÍàèìÄîêÎòãð=" & Chr(34) & numdok_otgr & Chr(34) & " ÍîìÄîêÎòãð=" & Chr(34) & numdok_otgr & Chr(34) & " ÄàòàÄîêÎòãð=" & Chr(34) & date_dok_otgr & Chr(34) & " />"
  221. file_l.WriteLine "</ÑâÑ÷Ôàêò>"
  222. '---òàáë òîâàðîâ
  223. file_l.WriteLine "<ÒàáëÑ÷Ôàêò>"
  224.  
  225. sum_kol_vo_tov = 0
  226. For ii = 15 To poz_vsego
  227. '--- áëîê ïî òîâàðó
  228. n_str = xl_upd.Range("q" & ii) '"6"
  229. name_tov = xl_upd.Range("r" & ii) '"Ïðîñòûíÿ Íî÷ü Íåæíà Ãðàíü (ñåðûé) îñí. 7352-2 Ïîïëèí ÅÂÐÎ 240õ215 ïîëîñà íîâàÿ"
  230. tov_price = xl_upd.Range("W" & ii) '"23"
  231. okey_tov = xl_upd.Range("T" & ii) '"786"
  232. kol_vo_tov = (Val(xl_upd.Range("V" & ii))) '"4.0"
  233. tek_bez_nds = CStr(xl_upd.Range("X" & ii)) '"999999.99"
  234. Nalst = CStr(xl_upd.Range("Z" & ii)) '"20%"
  235. St_tov_ych_nal = CStr(xl_upd.Range("AB" & ii)) '"999999.99"
  236. sum_nal_tek = CStr(Val(xl_upd.Range("AA" & ii))) '"3424"
  237. tek_akcis = xl_upd.Range("Y" & ii)
  238. kod_proisx = "643"
  239. num_td = "-"
  240. PrtovRab = "1"
  241. Kod_tek_tov = xl_upd.Range("P" & ii) '"4660056137608"
  242. Name_ed_izm = "øò."
  243. KrnameCountry = "ÐÎÑÑÈß"
  244. sum_kol_vo_tov = sum_kol_vo_tov + kol_vo_tov
  245. file_l.WriteLine "<ÑâåäÒîâ ÍîìÑòð=" & Chr(34) & n_str & Chr(34) & " ÍàèìÒîâ=" & Chr(34) & name_tov & Chr(34) & " ÎÊÅÈ_Òîâ=" & Chr(34) & okey_tov & Chr(34) & " ÊîëÒîâ=" & Chr(34) & kol_vo_tov & Chr(34) & " ÖåíàÒîâ=" & Chr(34) & tov_price & Chr(34) & " ÑòÒîâÁåçÍÄÑ=" & Chr(34) & tek_bez_nds & Chr(34) & " ÍàëÑò=" & Chr(34) & Nalst & Chr(34) & " ÑòÒîâÓ÷Íàë=" & Chr(34) & St_tov_ych_nal & Chr(34) & ">"
  246. file_l.WriteLine "<Àêöèç>"
  247. file_l.WriteLine "<ÁåçÀêöèç>" & tek_akcis & "</ÁåçÀêöèç>"
  248. file_l.WriteLine "</Àêöèç>"
  249. file_l.WriteLine "<ÑóìÍàë>"
  250. file_l.WriteLine "<ÑóìÍàë>" & sum_nal_tek & "</ÑóìÍàë>"
  251. file_l.WriteLine "</ÑóìÍàë>"
  252. file_l.WriteLine "<ÑâÒÄ ÊîäÏðîèñõ=" & Chr(34) & kod_proisx & Chr(34) & " ÍîìåðÒÄ=" & Chr(34) & num_td & Chr(34) & " />"
  253. file_l.WriteLine "<ÄîïÑâåäÒîâ ÏðÒîâÐàá=" & Chr(34) & PrtovRab & Chr(34) & " ÊîäÒîâ=" & Chr(34) & Kod_tek_tov & Chr(34) & " ÍàèìÅäÈçì=" & Chr(34) & Name_ed_izm & Chr(34) & " ÊðÍàèìÑòðÏð=" & Chr(34) & KrnameCountry & Chr(34) & ">"
  254. file_l.WriteLine "<ÍîìÑðåäÈäåíòÒîâ>"
  255. For jj = 15 To poz_vsego_first
  256. If Kod_tek_tov = xl_first.Range("I" & jj) Then
  257.  
  258. tek_ch_zn = CStr(xl_first.Range("a" & jj))
  259. tek_ch_zn = Mid(tek_ch_zn, 1, 31)
  260. tek_ch_zn = Rep_all(tek_ch_zn)
  261. file_l.WriteLine "<ÊÈÇ>" & tek_ch_zn & "</ÊÈÇ>"
  262. End If
  263. Next jj
  264.  
  265. file_l.WriteLine "</ÍîìÑðåäÈäåíòÒîâ>"
  266. file_l.WriteLine "</ÄîïÑâåäÒîâ>"
  267. zn_tved = "&lt;&gt;"
  268. zn_shtrh = Kod_tek_tov '"4660056137608"
  269. file_l.WriteLine "<ÈíôÏîëÔÕÆ2 Èäåíòèô=" & Chr(34) & "òíâýä" & Chr(34) & " Çíà÷åí=" & Chr(34) & zn_tved & Chr(34) & " />"
  270. file_l.WriteLine "<ÈíôÏîëÔÕÆ2 Èäåíòèô=" & Chr(34) & "ID òîâàðà" & Chr(34) & " Çíà÷åí=" & Chr(34) & zn_shtrh & Chr(34) & " />"
  271. t = zn_shtrh
  272. file_l.WriteLine "<ÈíôÏîëÔÕÆ2 Èäåíòèô=" & Chr(34) & "øòðèõêîä" & Chr(34) & " Çíà÷åí=" & Chr(34) & mDU(t) & Chr(34) & " />"
  273. file_l.WriteLine "</ÑâåäÒîâ>"
  274.  
  275. 'end--- áëîê ïî òîâàðó
  276. Next ii
  277. '--------áëîê âñåãî
  278. 'poz_vsego
  279. sttov_bez_nds_all = xl_upd.Range("X" & poz_vsego + 1) '"999999.99"
  280. Sttov_ych_nal_all = xl_upd.Range("AB" & poz_vsego + 1) '"999999.99"
  281. Sum_nal = xl_upd.Range("AA" & poz_vsego)
  282. If Sum_nal <> "" Then
  283. str_Sum_nal = CStr(Val(Sum_nal)) ' "999999.99"
  284. Else
  285. str_Sum_nal = "0"
  286. End If
  287. kol_netto_all = CStr(Round(Val(sum_kol_vo_tov), 2)) ' "31"
  288. file_l.WriteLine "<ÂñåãîÎïë ÑòÒîâÁåçÍÄÑÂñåãî=" & Chr(34) & sttov_bez_nds_all & Chr(34) & " ÑòÒîâÓ÷ÍàëÂñåãî=" & Chr(34) & Sttov_ych_nal_all & Chr(34) & ">"
  289. file_l.WriteLine "<ÑóìÍàëÂñåãî>"
  290. file_l.WriteLine "<ÑóìÍàë>" & Chr(34) & str_Sum_nal & Chr(34) & "</ÑóìÍàë>"
  291. file_l.WriteLine "</ÑóìÍàëÂñåãî>"
  292. file_l.WriteLine "<ÊîëÍåòòîÂñ>" & Chr(34) & kol_netto_all & Chr(34) & "</ÊîëÍåòòîÂñ>"
  293. file_l.WriteLine "</ÂñåãîÎïë>"
  294. file_l.WriteLine "</ÒàáëÑ÷Ôàêò>"
  295.  
  296. '------<ÑâÏðîäÏåð>
  297. file_l.WriteLine "<ÑâÏðîäÏåð>"
  298. file_l.WriteLine "<ÑâÏåð ÑîäÎïåð=" & Chr(34) & "Òîâàðû ïåðåäàíû, ðàáîòû ñäàíû, óñëóãè îêàçàíû" & Chr(34) & ">"
  299. type_zak_doc = xl_nastr.Range("B9") ' "Çàêàç êëèåíòà"
  300. nom_osn = xl_nastr.Range("B10") '"19101"
  301. date_osn = xl_nastr.Range("B11") '"21.03.2024"
  302.  
  303. file_l.WriteLine "<ÎñíÏåð ÍàèìÎñí=" & Chr(34) & type_zak_doc & Chr(34) & " ÍîìÎñí=" & Chr(34) & nom_osn & Chr(34) & " ÄàòàÎñí=" & Chr(34) & date_osn & Chr(34) & " />"
  304. If (type_zak_doc <> "") Or (nom_osn <> "") Or (date_osn <> "") Then
  305. file_l.WriteLine "<ÑâËèöÏåð>"
  306. dolg_prod = xl_nastr.Range("B12") '"Äèðåêòîð"
  307. p_fio_fio = xl_nastr.Range("B13") '"Êóïðèíà"
  308. p_fio_name = xl_nastr.Range("B14") '"Îëüãà"
  309. p_fio_otch = xl_nastr.Range("B15") '"Ñòàíèñëàâîâíà"
  310. file_l.WriteLine "<ÐàáÎðãÏðîä Äîëæíîñòü=" & Chr(34) & dolg_prod & Chr(34) & ">"
  311. file_l.WriteLine "<ÔÈÎ Ôàìèëèÿ=" & Chr(34) & p_fio_fio & Chr(34) & " Èìÿ=" & Chr(34) & p_fio_name & Chr(34) & " Îò÷åñòâî=" & Chr(34) & p_fio_otch & Chr(34) & " />"
  312. file_l.WriteLine "</ÐàáÎðãÏðîä>"
  313. file_l.WriteLine "</ÑâËèöÏåð>"
  314. file_l.WriteLine "</ÑâÏåð>"
  315. End If
  316. file_l.WriteLine "</ÑâÏðîäÏåð>"
  317. '------Ïîäïèñàíò
  318. Status = "1"
  319. osnPoln = "Äîëæíîñòíûå îáÿçàííîñòè"
  320. oblpoln = "6"
  321. file_l.WriteLine "<Ïîäïèñàíò ÎñíÏîëí=" & Chr(34) & osnPoln & Chr(34) & " ÎáëÏîëí=" & Chr(34) & oblpoln & Chr(34) & " Ñòàòóñ=" & Chr(34) & Status & Chr(34) & ">"
  322. innul = prod_innul ' "3702148437"
  323. dolgn = xl_nastr.Range("B16") '"Ñîòðóäíèê"
  324. If dolgn <> "" Then
  325. nameorg = prod_name_org '"ÎÎÎ &quot;ÀËÜÔÀ-ÒÐÅÉÄ&quot;"
  326. file_l.WriteLine "<ÞË ÈÍÍÞË=" & Chr(34) & innul & Chr(34) & " Äîëæí=" & Chr(34) & dolgn & Chr(34) & " ÍàèìÎðã=" & Chr(34) & nameorg & Chr(34) & ">"
  327. fio_f = xl_nastr.Range("B17") '"Áàííîâà"
  328. fio_name = xl_nastr.Range("B18") '"Àííà"
  329. fio_otch = xl_nastr.Range("B19") '"Âëàäèìèðîâíà"
  330. file_l.WriteLine "<ÔÈÎ Ôàìèëèÿ=" & Chr(34) & fio_f & Chr(34) & " Èìÿ=" & Chr(34) & fio_name & Chr(34) & " Îò÷åñòâî=" & Chr(34) & fio_otch & Chr(34) & " />"
  331. file_l.WriteLine "</ÞË>"
  332. End If
  333. file_l.WriteLine "</Ïîäïèñàíò"
  334. file_l.WriteLine "</Äîêóìåíò>"
  335. file_l.WriteLine "</Ôàéë>"
  336. file_l.Close
  337. Set file_l = Nothing
  338.  
  339. xl_osn.Save
  340. wbs.Close SaveChanges:=False
  341. MsgBox ("Ãîòîâî")
  342. End Sub
  343.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement