Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.67 KB | None | 0 0
  1. <html>
  2.  
  3. <head>
  4. {{-- @include('layouts.printingcss') --}}
  5. {{--
  6. <link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet"> --}}
  7. <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
  8.  
  9. <style>
  10. /* @media print { */
  11. /* body {
  12. width: 816px;
  13. } */
  14.  
  15. #items { /* style for the 3rd table */
  16. font-size: 16px;
  17. clear: both;
  18. margin: 0 auto;
  19. width: 1000px;
  20. /* border: 1px solid black; */
  21. }
  22.  
  23. #items td { /* style for the 3rd table */
  24. /* border: 1px solid black; */
  25. }
  26.  
  27. .table { /* width for the 2nd and 4th table */
  28. width: 1000px;
  29. margin: 0;
  30. }
  31.  
  32. #page-wrap { /* to set the width of the */
  33. width: 1000px;
  34. margin: 0 auto;
  35. }
  36.  
  37. #items th { /* to change the background color of table header */
  38. background: #eee;
  39. padding-top: 20px;
  40. padding-bottom: 20px;
  41. font-size:1px;
  42. }
  43.  
  44. #items td.total-line { /* to align right the extra info in the table 3 */
  45. text-align: right;
  46. }
  47.  
  48. #items td.total-value { /* padding for the td of values in the table 3 */
  49. padding: 0px;
  50. }
  51.  
  52. div,
  53. td,
  54. th,
  55. h1,
  56. h2,
  57. h3,
  58. h4,
  59. h5,
  60. h6,
  61. p,
  62. span {
  63. /* font-size: 12px !important; */
  64. }
  65.  
  66. th, /* for changing the capitalization of the ff. */
  67. h1,
  68. h2,
  69. h3,
  70. h4,
  71. h5,
  72. h6 {
  73. text-transform: capitalize !important;
  74. }
  75.  
  76. .table, /* no border for table */
  77. .table tr,
  78. .table td {
  79. /* border: 1px solid black; */
  80. }
  81.  
  82. .p { /* font size and margin for paragraph */
  83. font-size: 11px !important;
  84. margin-bottom: 5px;
  85. text-transform: none;
  86. }
  87.  
  88. .input-blank-1, /* margin for the div that contains the info of table 2 and 4*/
  89. .input-blank-2 {
  90. margin-bottom: 10px;
  91. position: relative;
  92. }
  93.  
  94. .input-blank-1 .p { /* style for the class p of all the div in the table 2 */
  95. display: inline-block;
  96. background-color: white;
  97. position: relative;
  98. top: 8px;
  99. font-weight: bold;
  100. }
  101.  
  102. .input-blank-1 .span { /* style for the class span of all the div in the table 2 */
  103. display: inline-block;
  104. height: 3px;
  105. border-bottom: 1px solid black;
  106. }
  107.  
  108. .input-blank-2 .p { /* style for the class p of all the div in the table 4 */
  109. display: block;
  110. background-color: white;
  111. font-weight: bold;
  112. }
  113.  
  114. .input-blank-2 .span { /* style for the class span of all the div in the table 4 */
  115. margin-top: 30px;
  116. display: block;
  117. height: 1px;
  118. border-bottom: 1px solid black;
  119. }
  120.  
  121. .smallFont {
  122. font-size:5px;
  123. }
  124.  
  125. .text-center { /* to center the text in the p of the table 4 */
  126. text-align: center;
  127. }
  128.  
  129. .main-content { /* padding for the table 3 */
  130. margin: 0;
  131. }
  132.  
  133. .input-data { /* style for the data of table 3 */
  134. position: absolute;
  135. top: 0;
  136. left: 110px;
  137. }
  138.  
  139. .invisible { /* to hide some text in the table 2 and to hide all text in the table 4 */
  140. opacity: 0;
  141. }
  142.  
  143. .text-right { /* to align the date and terms to the right */
  144. text-align: right;
  145. right: 0;
  146. }
  147.  
  148. * { /* to set the margin and padding of all */
  149. margin: 0;
  150. padding: 0;
  151. }
  152.  
  153. body {
  154. /* font: 14px/1.4 "Times New Roman", Times, sans-serif; */
  155. }
  156.  
  157. table { /* to collapse the table borders into a single border */
  158. /* border-collapse: collapse; */
  159. }
  160.  
  161. .number { /* to set some text in the table 3 to center */
  162. text-align: right !important;
  163. }
  164.  
  165. .pad {
  166. padding-bottom: 10px;
  167. }
  168.  
  169. .date {
  170. text-align: right !important;
  171. padding-right: 10px !important;
  172. }
  173.  
  174. .textLeft {
  175. text-align: left !important;
  176. padding-left: 10px;
  177. }
  178.  
  179. .textRight {
  180. text-align: right !important;
  181. }
  182.  
  183. .bottomFont {
  184. font-size: 12px;
  185. font-weight: bold;
  186. }
  187.  
  188. .padLeft {
  189. padding-left: 20px;
  190. padding-right: 30px;
  191. }
  192.  
  193. </style>
  194. </head>
  195.  
  196. <body>
  197. <div class="content-wrapper">
  198. <section class="content">
  199. <div id="page-wrap">
  200. <table class="table invisible">
  201. <tr>
  202. <td>
  203. <img id="image" src="/images/cdologo.jpg" alt="logo" />
  204. </td>
  205. <td>
  206. <p class="p">SFP Karla's Marketing, Inc.</p>
  207. <p class="p">San Isidro, Bacoor Pampanga</p>
  208. <p class="p">VAT Reg. TIN: 237-672-486-000</p>
  209. <p class="p">Tel. Nos. (045) 455-0862 * Telefax No. (045) 455-0861</p>
  210. </td>
  211. <td>
  212. <h2 style="font-size: 16px !important; margin-bottom: 10px;">SALES INVOICE</h2>
  213. <p style="font-size: 16px !important;">No.</p>
  214. </td>
  215. </tr>
  216. </table>
  217.  
  218. <div style="height: 0px;"></div>
  219. <table class="table">
  220. <tr>
  221. <td class="input-blank-1">
  222. <p class="p invisible">SOLD TO:</p>
  223. <p class="input-data">{{ $customer_info->customer_name }}</p>
  224. <span class="span invisible" />
  225. </td>
  226. <td class="input-blank-1" style="width:500px;">
  227. <p class="p invisible">Terms :</p>
  228. <p class="input-data text-left" style="padding-left: 200px;">{{ $payment_type->payment_type }}</p>
  229. <span class="span invisible" />
  230. </td>
  231. </tr>
  232. <tr>
  233. <td class="input-blank-1" style="width:500px;">
  234. <p class="p invisible">ADDRESS:</p>
  235. <p class="input-data">{{ $customer_info->delivery_address }}</p>
  236. <span class="span invisible" />
  237. </td>
  238. <td class="input-blank-1">
  239. <p class="p invisible">Date :</p>
  240. <?php
  241. $date = date_create($sale_invoice->posting_date);
  242. ?>
  243. <p class="input-data text-left" style="padding-left: 200px;">{{ date_format($date, "m/d/Y") }}</p>
  244. <span class="span invisible" />
  245. </td>
  246. </tr>
  247. <tr>
  248. <td class="input-blank-1">
  249. <p class="p invisible">TIN(BUYER):</p>
  250. <p class="input-data"></p>
  251. <span class="span invisible" />
  252. </td>
  253. <td class="input-blank-1">
  254. <p class="p invisible">OSCA/PWD ID No.:</p>
  255. <p class="input-data"></p>
  256. <span class="span invisible" />
  257. </td>
  258. </tr>
  259. <tr>
  260. <td class="input-blank-1">
  261. <p class="p invisible">BUS. STYLE:</p>
  262. <p class="input-data" style="padding-left:50px;"></p>
  263. <span class="span invisible" />
  264. </td>
  265. <td class="input-blank-1" style="width:500px;">
  266. <p class="p invisible">SC/PWD Signature:</p>
  267. <p class="input-data text-left" style="padding-left: 120px;"></p>
  268. <span class="span invisible" />
  269. </td>
  270. </tr>
  271. </table>
  272.  
  273.  
  274. <div class="main-content">
  275. <table id="items">
  276. <tr><td style="height:25px;" colspan="6"></td></tr>
  277.  
  278. <?php $total_sales = 0; ?>
  279. <?php $total_price = 0; ?>
  280. <?php $total_discount = 0; ?>
  281.  
  282. <?php $total_price_counter=0; ?>
  283. <?php $total_piece = 0; ?>
  284. <?php $total_case = 0; ?>
  285. <?php $total_kilos = 0; ?>
  286. <?php $total_nonVat = 0; ?>
  287. <?php $total_unitPrice = 0; ?>
  288. <?php $total_netAmount = 0; ?>
  289. <?php $total_qty = 0; ?>
  290. <?php $total_net = 0; ?>
  291. <?php $additional_discount = 0; ?>
  292. <?php $total_netPrice = 0; ?>
  293. <?php $net_amount = 0; ?>
  294. <?php $counter = 0; ?>
  295.  
  296.  
  297. @foreach($sale_order_products as $value)
  298.  
  299. <?php
  300. if ($value->uom == 'Case') {
  301. $total_case += $value->product_qty;
  302. }
  303.  
  304. if ($value->uom == 'Piece') {
  305. $total_piece += $value->product_qty;
  306. }
  307. ?>
  308.  
  309.  
  310.  
  311. <tr>
  312. <!-- Code for PROD. ID -->
  313. <td style="height:25px; width:1%; white-space:nowrap;">
  314. <div>{{ $value->product_code }}</div>
  315. </td>
  316.  
  317. <!-- Code for DESCRIPTION -->
  318. <td class="textLeft" style="width:480px;">
  319. <div>{{ $value->product_name }}</div>
  320. </td>
  321.  
  322. <!-- Code for QTY & UNIT-->
  323. <td>
  324. <div>{{ $value->product_qty }} {{ $value->uom }}</div>
  325. </td>
  326.  
  327. <?php $total_qty = $value->product_qty * $value->uom_factor; ?>
  328. <!-- Code for Kilos -->
  329. <td style="width:80px;">
  330. <div>{{ number_format(($value->product_qty * $value->uom_factor) * $value->net_weight, 2) }}</div>
  331. </td>
  332.  
  333.  
  334. <!-- Code for Non-Vat Price and Net Amount -->
  335. <?php
  336. $total_unitPrice = round($value->product_discounted_list_price/1.12,2);
  337. if ($value->uom == 'Case'){
  338. $net_amount = $total_unitPrice * $value->uom_factor;
  339. $total_netAmount = $value->product_qty * $value->uom_factor * $total_unitPrice;
  340. $total_sales += $total_netAmount;
  341. }
  342. if ($value->uom == 'Piece'){
  343. $net_amount = $total_unitPrice;
  344. $total_netAmount = $value->product_qty * $total_unitPrice;
  345. $total_sales += $total_netAmount;
  346. }
  347. ?>
  348.  
  349. <td class="number" style="padding-right:30px;">
  350. <div>{{number_format($net_amount,2)}}</div>
  351. </td>
  352.  
  353. <td class="number" style="padding-right:30px;">
  354. <!-- <div>{{ number_format($value->product_discount_price,2) }}</div> -->
  355. <div>{{number_format($total_netAmount,2)}}</div>
  356. </td>
  357. </tr>
  358.  
  359.  
  360.  
  361. {{-- <td class=" number">
  362. <div>{{ $value->uom_factor }}</div>
  363. </td>
  364. <td class="number">
  365. <div>{{ number_format($total_qty = $value->product_qty * $value->uom_factor) }}</div>
  366. </td> --}}
  367.  
  368. <?php $total_qty = $value->product_qty * $value->uom_factor; ?>
  369.  
  370.  
  371.  
  372. <!-- <?php $total_price=$total_qty*$value->product_discounted_list_price; ?>
  373. {{number_format($total_price,2)}}
  374. <?php
  375. $percent = 0;
  376. $test_discount = DB::table('sale_invoice_detail')
  377. ->where('sale_invoice_id', $sale_invoice->id)
  378. ->where('product_id', $value->product_id)
  379. ->leftJoin('products', 'sale_invoice_detail.product_id', '=', 'products.id')
  380. ->first();
  381.  
  382. $product_discount = $total_price - $test_discount->product_discount_price;
  383. if($product_discount!=0)
  384. {
  385. $percent = $total_price / $product_discount;
  386. $product_discount = $total_sales / $percent;
  387. } else if ($product_discount == 0) {
  388. $product_discount = 0;
  389. }
  390. ?>
  391.  
  392. {{ number_format($product_discount,2)}} -->
  393. </tr>
  394.  
  395.  
  396. <?php $total_price_counter += $total_price; ?>
  397.  
  398. <?php $total_kilos += ($value->product_qty * $value->uom_factor) * $value->net_weight; ?>
  399.  
  400. <?php $total_discount = $product_discount;
  401. $counter = $counter + 1;
  402. ?>
  403.  
  404. @endforeach
  405.  
  406. <?php
  407. while($counter < 25)
  408. {
  409. $counter = $counter + 1;
  410. echo "<tr><td class='invisible' style='height:30px;' colspan='6'>$counter</td></tr>";
  411. }
  412. ?>
  413.  
  414. <tr>
  415. <td style="height:10px;"></td>
  416. </td>
  417. <tr>
  418. <td class="number pad" colspan="2">
  419. <div align="left" style="padding-left:250px;">Total Kilos: {{ number_format($total_kilos, 2) }}</div>
  420. </td>
  421. <td class="total-line pad bottomFont invisible" colspan="3">Total Sales(VAT Inclusive)</td>
  422. <td class="pad padLeft">
  423. <div class="number">₱{{ number_format($total_sales, 2) }}</div>
  424. </td>
  425. </tr>
  426. <tr>
  427. <td class="number pad" colspan="2">
  428. <div align="left" style="padding-left:250px;">Total Case: {{ number_format($total_case) }}</div>
  429. </td>
  430. <td class="total-line pad bottomFont invisible" colspan="3">Less: VAT</td>
  431. <td class="pad padLeft">
  432. <?php
  433. $vat = 0;
  434. $vat = $total_sales - ($total_sales/1.12);
  435. ?>
  436. <div class="number">₱{{ number_format($vat, 2) }}</div>
  437. </td>
  438. </tr>
  439.  
  440. <tr>
  441. <td class="number pad" colspan="2">
  442. <div align="left" style="padding-left:250px;">Total Piece: {{ number_format($total_piece) }}</div>
  443. </td>
  444. <td class="total-line pad bottomFont invisible" colspan="3">Amount: Net of VAT</td>
  445. <td class="pad padLeft">
  446. <?php
  447. $netVat = 0;
  448. $netVat = ($total_sales/1.12);
  449. ?>
  450. <div class="number">₱{{ number_format($netVat, 2) }}</div>
  451. </td>
  452. </tr>
  453.  
  454. <tr>
  455. <td class="total-line pad bottomFont invisible" colspan="5">Total Discount</td>
  456. <td class="pad padLeft">
  457.  
  458. <div class="number">₱{{ number_format($total_discount, 2) }}</div>
  459. </td>
  460. </tr>
  461.  
  462. <tr>
  463. <td class="total-line pad bottomFont invisible" colspan="5">Amount Due</td>
  464. <td class="pad padLeft">
  465. <?php
  466. $amountDue = 0;
  467. $amountDue = $netVat - $total_discount;
  468. ?>
  469. <div class="number">₱{{ number_format($amountDue, 2) }}</div>
  470. </td>
  471. </tr>
  472. <tr>
  473. <td class="total-line pad" colspan="2" style="padding-right:30px;"><b>Encoded by:</b> Clerk</td>
  474. <td class="total-line pad bottomFont invisible" colspan="3">Add VAT</td>
  475. <td class="pad padLeft">
  476.  
  477. <div class="number">₱{{ number_format($vat, 2) }}</div>
  478. </td>
  479. </tr>
  480. <tr>
  481. <?php
  482. $salesmen = DB::table('salesmen')
  483. ->where('id', $customer_info->salesman_id)
  484. ->first();
  485.  
  486. $warehouses = DB::table('warehouses')
  487. ->where('id', $salesmen->warehouse_id)
  488. ->first();
  489. ?>
  490.  
  491. <td class="total-line pad" colspan="2" style="padding-right:30px;"><b>Warehouse:</b> {{ $warehouses->warehouse }}</td>
  492.  
  493. <td class="total-line pad invisible" colspan="3"><b>Total Amount Due</b></td>
  494. <td class="pad padLeft">
  495. <?php
  496. $total = 0;
  497. $total = $amountDue + $vat;
  498. ?>
  499. <div class="number">₱{{ number_format($total, 2) }}</div>
  500. </td>
  501. </tr>
  502. </table>
  503. </div>
  504.  
  505.  
  506. <table class="table invisible">
  507. <tr>
  508. <td>
  509. <div class="input-blank-2">
  510. <p class="p">Prepared by :</p>
  511. <span class="span" />
  512. </div>
  513. </td>
  514. <td>
  515. <div class="input-blank-2">
  516. <p class="p">Checked by :</p>
  517. <span class="span" />
  518. </div>
  519. </td>
  520. <td>
  521. <p class="text-center" style="margin-bottom: 15px !important;">Received the above items in good order and
  522. condition:</p>
  523. <div class="input-blank-1">
  524. <p class="p">By :</p>
  525. <span class="span" />
  526. </div>
  527. <p class="text-center">Authorized Signature</p>
  528. </td>
  529. </tr>
  530. </table>
  531. </div>
  532. </section>
  533. </div>
  534. </body>
  535.  
  536. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement