Advertisement
NikolayPaskulov

Untitled

Nov 21st, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.61 KB | None | 0 0
  1.  
  2. //Скриване/показване на празните клетки
  3. document.getElementById('pokupkiHideEmptyCells').onclick = function () {
  4. var strArray = [],
  5. styleTag = document.getElementById('pokupkiStyle'),
  6. newWrapperWidth = document.getElementById('main-wrapper').offsetWidth,
  7. widthArr = [],
  8. headerWidth = 0;
  9.  
  10. //Проверка дали вече не са скрити колоните
  11. if (this.innerHTML == 'Покажи празните колони') {
  12. styleTag.innerHTML = '';
  13. this.innerHTML = 'Скрии празните колони'
  14. return;
  15. }
  16.  
  17. this.innerHTML = 'Покажи празните колони';
  18. for (var a = 0; a < purchFooter.length; a++) {
  19. if (purchFooter[a] == '0.00') {
  20. newWrapperWidth -= table.children[0].children[a + 9].offsetWidth;
  21. styleTag.innerHTML += '#main-wrapper .c' + (a + 10) + '{ width:0px; display:none; }';
  22. }
  23. }
  24.  
  25. for (var z = 0; z < table.children[0].children.length; z++) {
  26. widthArr.push(table.children[0].children[z].offsetWidth);
  27. headerWidth += widthArr[z];
  28. strArray.push('body #main-wrapper .table-row .c' + (z + 1) + ', body #main-wrapper .table-row .table-row .c' + (z + 1) + '{width: ' + ((table.children[0].children[z].offsetWidth / newWrapperWidth) * 100).toFixed(4) + '%;}');
  29. if (z == 5) {
  30. strArray.push('body #main-wrapper .table-row .c1-c6,body #main-wrapper #footer .table-row .c1-c6 { width: ' + ((headerWidth / newWrapperWidth) * 100).toFixed(4) + '%;}');
  31. strArray.push('body #main-wrapper .table-row .c3c4c5 {width: ' + (((headerWidth - (widthArr[z] + widthArr[0] + widthArr[1])) / newWrapperWidth) * 100).toFixed(4) + '%;}')
  32. headerWidth = 0;
  33. }
  34. if (z == table.children[0].children.length - 1) {
  35. strArray.push('body #main-wrapper #nameHeader > .table-cell:nth-child(2), body #main-wrapper #footer > .table-row:last-child > .table-cell:last-child { width: ' + ((headerWidth / newWrapperWidth) * 100).toFixed(4) + '%;}');
  36. strArray.push('body #main-wrapper #footer > .table-row .c8c9 {width: '+ (((widthArr[7] + widthArr[8]) / newWrapperWidth) * 100).toFixed(4) +'%;}')
  37. }
  38. }
  39. strArray.push('body #main-wrapper { width: ' + newWrapperWidth + 'px;} @media print { #main-wrapper > * { font-size: 10px;}}');
  40. styleTag.innerHTML += strArray.join('');
  41. }
  42.  
  43. <div id="main-wrapper">
  44. <div id="nameHeader" class="table-row">
  45. <div class="table-cell c1-c6">
  46. <div>ДНЕВНИК НА ПОКУПКИТЕ</div>
  47. <div>ИН по ЗДДС:</div><div id="InZDDS">&nbsp;</div>
  48. <div>Данъчен период:</div><div id="DanPer">&nbsp;</div>
  49. </div>
  50. <div class="table-cell"><button id="pokupkiHideEmptyCells" class="pokupkiBtns">Скрии празните колони</button></div>
  51. </div>
  52. <div id="tableHeader" class="table-row">
  53. <div class="table-cell c1">N по ред</div>
  54. <div class="table-cell c2">Клон</div>
  55. <div class="table-cell c3c4c5">
  56. <div class="table-cell">Документ</div>
  57. <div class="table-cell c3">Вид</div>
  58. <div class="table-cell c4">Номер</div>
  59. <div class="table-cell c5">Дата</div>
  60. </div>
  61. <div class="table-cell c6">Идентиф. номер на контр. доставчик</div>
  62. <div class="table-cell c7">Име на контрагента (доставчик)</div>
  63. <div class="table-cell c8">Вид на стоката услугата</div>
  64. <div class="table-cell c9">Доставка по чл. 163а от ЗДДС</div>
  65. <div class="table-cell c10">ДО и данък на получ.дост. ВОП, чл.82,ал2-5 ЗДДС и внос без право на дан.кред. или без данък</div>
  66. <div class="table-cell c11">ДО на пол.дост ВОП,чл.82 ал.2-5 ЗДДС,внос, ДО на получ. дост. използвани за дост. по чл.69 ал 2 ЗДДС с право на ПДК</div>
  67. <div class="table-cell c12">ДДС с право на пълен данъчен кредит</div>
  68. <div class="table-cell c13">ДО на пол.дост ВОП,чл.82 ал.2-5 ЗДДС, внос, ДО на получ. дост. използвани за дост.по чл.69 ал.2 ЗДДС с право на ЧДК</div>
  69. <div class="table-cell c14">ДДС с право на частичен данъчен кредит</div>
  70. <div class="table-cell c15">Годишна корекция по чл. 73, ал8 ЗДДС</div>
  71. <div class="table-cell c16">ДО при придобиване на стоки от тристр.операция</div>
  72. </div>
  73. <div id="tableHeadersFooter" class="table-row">
  74. <div class="table-cell c1-c6">&nbsp;</div>
  75. <div class="table-cell c7">&nbsp;</div>
  76. <div class="table-cell c8">&nbsp;</div>
  77. <div class="table-cell c9">ОБЩО:</div>
  78. <div class="table-cell c10">&nbsp;</div>
  79. <div class="table-cell c11">&nbsp;</div>
  80. <div class="table-cell c12">&nbsp;</div>
  81. <div class="table-cell c13">&nbsp;</div>
  82. <div class="table-cell c14">&nbsp;</div>
  83. <div class="table-cell c15">&nbsp;</div>
  84. <div class="table-cell c16">&nbsp;</div>
  85. </div>
  86. <div id="table" class="table-row"></div>
  87. <div id="footer" class="table-row">
  88. <div class="table-row">
  89. <div class="table-cell c1-c6">&nbsp;</div>
  90. <div class="table-cell c7">&nbsp;</div>
  91. <div class="table-cell c8c9">Общо без вид 11,12,13:</div>
  92. <div class="table-cell c10">&nbsp;</div>
  93. <div class="table-cell c11">&nbsp;</div>
  94. <div class="table-cell c12">&nbsp;</div>
  95. <div class="table-cell c13">&nbsp;</div>
  96. <div class="table-cell c14">&nbsp;</div>
  97. <div class="table-cell c15">&nbsp;</div>
  98. <div class="table-cell c16">&nbsp;</div>
  99. </div>
  100. <div class="table-row" id="footerFullSum">
  101. <div class="table-cell c1-c6">&nbsp;</div>
  102. <div class="table-cell c7">&nbsp;</div>
  103. <div class="table-cell c8c9">Общо:</div>
  104. <div class="table-cell c10">&nbsp;</div>
  105. <div class="table-cell c11">&nbsp;</div>
  106. <div class="table-cell c12">&nbsp;</div>
  107. <div class="table-cell c13">&nbsp;</div>
  108. <div class="table-cell c14">&nbsp;</div>
  109. <div class="table-cell c15">&nbsp;</div>
  110. <div class="table-cell c16">&nbsp;</div>
  111. </div>
  112. <div class="table-row">
  113. <div class="table-cell c1-c6">
  114. <span>Длъжност:</span>
  115. <span>Управител:</span>
  116. </div>
  117. <div class="table-cell">
  118. <span>Подпис и печат:</span>
  119. </div>
  120. </div>
  121. </div>
  122. </div>
  123.  
  124. #main-wrapper {
  125. width: 1750px;
  126. border-left: 1px solid #999999;
  127. font-size: 11px;
  128. }
  129.  
  130. .table-row {
  131. width: 100%;
  132. }
  133.  
  134. .table-cell {
  135. border-right: 1px solid #999999;
  136. }
  137.  
  138. #nameHeader, #nameHeader > .table-cell {
  139. height: 60px;
  140. }
  141.  
  142. #nameHeader > .table-cell:first-child, #nameHeader > .table-cell:nth-child(3) {
  143. width: 20%;
  144. }
  145.  
  146. #nameHeader > .table-cell:nth-child(2) {
  147. width: 80%;
  148. }
  149.  
  150. #nameHeader > .table-cell:first-child > div:first-child {
  151. font-size: 20px;
  152. font-weight: bold;
  153. padding-left: 10px;
  154. }
  155.  
  156. #nameHeader > .table-cell:first-child > div:nth-child(2), #nameHeader > .table-cell:first-child > div:nth-child(4) {
  157. width: 51%;
  158. padding-left: 20%;
  159. }
  160.  
  161. #nameHeader > .table-cell, #tableHeader > .table-cell, #tableHeadersFooter > .table-cell {
  162. border-bottom: 1px solid #999999;
  163. }
  164.  
  165. #nameHeader > .table-cell {
  166. border-top: 1px solid #999999;
  167. }
  168.  
  169. #tableHeader > .table-cell {
  170. height: 50px;
  171. }
  172.  
  173. #tableHeader > .table-cell {
  174. text-align: center;
  175. }
  176.  
  177. #tableHeader > .table-cell:first-child, #table > .table-row > .table-cell:first-child {
  178. width: 1.2%;
  179. }
  180.  
  181. #tableHeader > .table-cell:nth-child(2), #table > .table-row > .table-cell:nth-child(2) {
  182. width: 1.8%;
  183. }
  184.  
  185. #tableHeader > .table-cell:nth-child(3) {
  186. width: 11%;
  187. }
  188.  
  189. #tableHeader > .table-cell:nth-child(4), #table > .table-row > .table-cell:nth-child(6) {
  190. width: 6%;
  191. }
  192.  
  193. #tableHeader > .table-cell:nth-child(3) > .table-cell:first-child {
  194. height: 36px;
  195. }
  196.  
  197. #tableHeader > .table-cell:nth-child(3) > .table-cell:nth-child(2), #tableHeader > .table-cell:nth-child(3) > .table-cell:nth-child(3), #tableHeader > .table-cell:nth-child(3) > .table-cell:nth-child(4) {
  198. height: 14px;
  199. }
  200.  
  201. #tableHeader > .table-cell:nth-child(3) > .table-cell:first-child {
  202. width: 100%;
  203. border-right: none;
  204. border-bottom: 1px solid #999999;
  205. }
  206.  
  207. #tableHeader > .table-cell:nth-child(3) > .table-cell:nth-child(2) {
  208. width: 12%;
  209. }
  210.  
  211. #tableHeader > .table-cell:nth-child(3) > .table-cell:nth-child(3) {
  212. width: 50%;
  213. }
  214.  
  215. #tableHeader > .table-cell:nth-child(3) > .table-cell:nth-child(4) {
  216. width: 38%;
  217. border-right: none;
  218. }
  219.  
  220. #tableHeader > .table-cell:nth-child(5), #table > .table-row > .table-cell:nth-child(7), #footer .table-row > .table-cell:nth-child(2), #tableHeadersFooter > .table-cell:nth-child(2) {
  221. width: 10%;
  222. }
  223.  
  224. #tableHeader > .table-cell:nth-child(6), #tableHeader > .table-cell:nth-child(7), #table > .table-row > .table-cell:nth-child(8), #table > .table-row > .table-cell:nth-child(9),
  225. #tableHeadersFooter > .table-cell:nth-child(3),#tableHeadersFooter > .table-cell:nth-child(4) {
  226. width: 4%;
  227. }
  228.  
  229. #tableHeader > .table-cell:nth-child(8), #tableHeadersFooter > .table-cell:nth-child(5), #footer .table-row > .table-cell:nth-child(4), #table > .table-row > .table-cell:nth-child(10) {
  230. width: 10%;
  231. }
  232.  
  233. #tableHeader > .table-cell:nth-child(9), #tableHeadersFooter > .table-cell:nth-child(6), #footer .table-row > .table-cell:nth-child(5), #table > .table-row > .table-cell:nth-child(11) {
  234. width: 14%;
  235. }
  236.  
  237. #tableHeader > .table-cell:nth-child(10), #tableHeadersFooter > .table-cell:nth-child(7), #footer .table-row > .table-cell:nth-child(6), #table > .table-row > .table-cell:nth-child(12) {
  238. width: 5%;
  239. }
  240.  
  241. #tableHeader > .table-cell:nth-child(11), #tableHeadersFooter > .table-cell:nth-child(8), #footer .table-row > .table-cell:nth-child(7), #table > .table-row > .table-cell:nth-child(13) {
  242. width: 13%;
  243. }
  244.  
  245. #tableHeader > .table-cell:nth-child(12), #tableHeadersFooter > .table-cell:nth-child(9), #footer .table-row > .table-cell:nth-child(8), #table > .table-row > .table-cell:nth-child(14) {
  246. width: 5%;
  247. }
  248.  
  249. #tableHeader > .table-cell:nth-child(13), #tableHeadersFooter > .table-cell:nth-child(10), #footer .table-row > .table-cell:nth-child(9), #table > .table-row > .table-cell:nth-child(15) {
  250. width: 8%;
  251. }
  252.  
  253. #tableHeader > .table-cell:nth-child(14), #tableHeadersFooter > .table-cell:nth-child(11), #footer .table-row > .table-cell:nth-child(10), #table > .table-row > .table-cell:nth-child(16) {
  254. width: 7%;
  255. }
  256.  
  257. #tableHeadersFooter > .table-cell:first-child {
  258. width: 20%;
  259. }
  260.  
  261. #tableHeadersFooter > .table-cell {
  262. background: #d8d8ff;
  263. }
  264.  
  265. #tableHeadersFooter > .table-cell:first-child, #tableHeadersFooter > .table-cell:nth-child(2), #tableHeadersFooter > .table-cell:nth-child(3) {
  266. border-right:none;
  267. }
  268.  
  269. #tableHeader > .table-cell:nth-child(5) {
  270. line-height: 50px;
  271. }
  272.  
  273. #footer > .table-row:first-child > .table-cell, #footer .table-row:nth-child(2) > .table-cell {
  274. border-bottom: 1px solid #999999;
  275. height: 15px;
  276. background: #d8d8ff;
  277. }
  278.  
  279. #footer .table-row > .table-cell:first-child {
  280. border-right: none;
  281. width: 20%;
  282. }
  283.  
  284. #footer .table-row > .table-cell:first-child, #footer .table-row > .table-cell:nth-child(2) {
  285. background-color: transparent;
  286. border-bottom: none;
  287. }
  288.  
  289. #footer .table-row > .table-cell:nth-child(3) {
  290. width: 8%;
  291. text-align: right;
  292. padding-right: 5px;
  293. }
  294.  
  295. #footer > .table-row:nth-child(3) > .table-cell {
  296. height: 50px;
  297. line-height: 50px;
  298. }
  299.  
  300. #footer > .table-row:nth-child(3) > .table-cell:first-child, #footer > .table-row:nth-child(3) > .table-cell:nth-child(3) {
  301. width: 20%;
  302. border-right: none;
  303. }
  304.  
  305. #footer > .table-row:nth-child(3) > .table-cell:nth-child(2) {
  306. width: 80%;
  307. text-align: left;
  308. }
  309.  
  310. #footer > .table-row:nth-child(3) > .table-cell:nth-child(2) span {
  311. padding-left: 175px;
  312. }
  313.  
  314. #footer > .table-row:nth-child(3) > .table-cell:first-child span:first-child {
  315. padding-left: 10px;
  316. }
  317.  
  318. #footer > .table-row:nth-child(3) > .table-cell:first-child span:nth-child(2) {
  319. padding-left: 50%;
  320. }
  321.  
  322. #footer > .table-row:last-child > .table-cell {
  323. border-bottom: 1px solid #999999;
  324. }
  325.  
  326. #table > .table-row > .table-cell:nth-child(3) {
  327. width: 1.32%;
  328. }
  329.  
  330. #table > .table-row > .table-cell:nth-child(4) {
  331. width: 5.5%;
  332. }
  333.  
  334. #table > .table-row > .table-cell:nth-child(5) {
  335. width: 4.18%;
  336. }
  337.  
  338. #table > .table-row > .table-cell, #tableHeadersFooter > .table-cell {
  339. border-bottom: 1px solid #999999;
  340. }
  341.  
  342. #table > .table-row > .table-cell {
  343. overflow: hidden;
  344. height: 15px;
  345. }
  346.  
  347.  
  348. @media print {
  349. #main-wrapper {
  350. width: 100%;
  351. }
  352.  
  353. nav, #pokupkiHideEmptyCells {
  354. display: none;
  355. }
  356.  
  357. #main-wrapper > * {
  358. font-size: 7px;
  359. }
  360.  
  361. #main-wrapper #nameHeader > .table-row:first-child > .table-cell:first-child {
  362. font-size: 16.5px;
  363. }
  364. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement