VoucherTicket.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template lang="pug">
  2. .voucher-ticket
  3. .voucher-ticket-wrapper
  4. form.voucher-ticket-from
  5. .voucher-ticket-from-separator
  6. h3 Detalles de pagos
  7. hr
  8. .voucher-ticket-from-item
  9. label.voucher-ticket-from-label Cliente
  10. label.voucher-ticket-from-input {{ getPartner() }}
  11. .voucher-ticket-from-item
  12. label.voucher-ticket-from-label Factura número
  13. label.voucher-ticket-from-input {{ getInvoice() }}
  14. .voucher-ticket-from-grid-header
  15. label.voucher-ticket-from-grid-header-left Vencimiento
  16. label.voucher-ticket-from-grid-header-right Monto
  17. .voucher-ticket-from-grid
  18. .voucher-ticket-from-grid-item(v-for="(line, index) in addMove")
  19. label.voucher-ticket-from-grid-item-left {{ formatDate(line.date_maturity) }}
  20. label.voucher-ticket-from-grid-item-right {{ formatNumber(line.amount_residual) }} {{ getSymbol() }}
  21. .voucher-ticket-from-item-total
  22. label.voucher-ticket-from-label-total Total
  23. label.voucher-ticket-from-input-total {{ getTotal() }}
  24. .voucher-ticket-from-item-total
  25. label.voucher-ticket-from-label-total Pagado
  26. label.voucher-ticket-from-input-total {{ getpagado() }}
  27. .voucher-ticket-from-item-total
  28. label.voucher-ticket-from-label-total Saldo
  29. label.voucher-ticket-from-input-total {{ formatResidual() }}
  30. </template>
  31. <script>
  32. import { mapGetters, mapActions } from 'vuex'
  33. export default {
  34. computed: {
  35. ...mapGetters([
  36. 'selectedPartner',
  37. 'selectedInvoices',
  38. 'addMove',
  39. 'total',
  40. 'paymentAmount',
  41. 'companySymbol'
  42. ])
  43. },
  44. methods: {
  45. getPartner() {
  46. return !!this.selectedPartner ? this.selectedPartner.display_name : ''
  47. },
  48. getInvoice() {
  49. return !!this.selectedInvoices ? this.selectedInvoices.number : ''
  50. },
  51. formatDate(date) {
  52. return moment(date).format('DD-MM-YYYY');
  53. },
  54. formatNumber(amount) {
  55. return accounting.format(amount, 0,'.', ',')
  56. },
  57. getSymbol() {
  58. return this.selectedInvoices ? this.selectedInvoices.currency_symbol : ''
  59. },
  60. getTotal() {
  61. return accounting.formatMoney(this.total,this.companySymbol, 0,'.', ',')
  62. },
  63. getpagado() {
  64. let pagado = this.paymentAmount
  65. pagado = this.paymentAmount <= this.total ? this.paymentAmount : this.total
  66. return accounting.formatMoney(pagado,this.companySymbol, 0,'.', ',')
  67. },
  68. formatResidual() {
  69. let residual = 0
  70. residual = this.paymentAmount <= this.total ? this.total - this.paymentAmount : 0
  71. return accounting.formatMoney(residual, this.companySymbol, 0,'.',',')
  72. },
  73. }
  74. }
  75. </script>
  76. <style lang="sass">
  77. .voucher-ticket
  78. width: 500px
  79. height: 100%
  80. font-size: 8pt
  81. display: flex
  82. .voucher-ticket-wrapper
  83. width: 100%
  84. height: 460px
  85. margin: 10px
  86. border: 1px solid #d3d3d3
  87. .voucher-ticket-from
  88. width: 100%
  89. height: 100%
  90. .voucher-ticket-from-separator
  91. h3
  92. color: #9e9e9e
  93. font:
  94. size: 16pt
  95. margin-left: 10px
  96. margin-right: 10px
  97. text-align: center
  98. hr
  99. margin-top: 3px
  100. margin-left: 10px
  101. margin-right: 10px
  102. .voucher-ticket-from-item
  103. width: 100%
  104. height: 40px
  105. margin-bottom: 5px
  106. .voucher-ticket-from-label
  107. width: 150px
  108. height: 35px
  109. font:
  110. size: 10pt
  111. weight: bold
  112. padding-left: 10px
  113. .voucher-ticket-from-input
  114. width: 290px
  115. height: 25px
  116. font:
  117. size: 10pt
  118. weight: bold
  119. border-left: 0px
  120. border-top: 0px
  121. border-right: 0px
  122. border-bottom: 1px solid #dedede
  123. .voucher-ticket-from-grid-header
  124. width: calc(100% - 20px)
  125. height: 30px
  126. margin: 0px 10px
  127. border: 1px solid #d3d3d3
  128. background: #f5f5f5
  129. .voucher-ticket-from-grid-header-left, .voucher-ticket-from-grid-header-right
  130. width: 213px
  131. height: 30px
  132. font:
  133. size: 10pt
  134. padding-left: 10px
  135. margin-top: 5px
  136. .voucher-ticket-from-grid-header-left
  137. margin-left: 5px
  138. text-align: left
  139. .voucher-ticket-from-grid-header-right
  140. margin-right: 5px
  141. text-align: center
  142. .voucher-ticket-from-grid
  143. width: calc(100% - 20px)
  144. height: 160px
  145. overflow-y: auto
  146. margin: 0px 10px
  147. border: 1px solid #d3d3d3
  148. .voucher-ticket-from-grid-item
  149. width: calc(100% - 10px )
  150. height: 30px
  151. padding-top: 1px
  152. border-bottom: 1px solid #dedede
  153. margin-left: 5px
  154. margin-right: 5px
  155. .voucher-ticket-from-grid-item-left, .voucher-ticket-from-grid-item-right
  156. width: 205px
  157. height: 30px
  158. font:
  159. size: 10pt
  160. padding-left: 10px
  161. margin-top: 5px
  162. .voucher-ticket-from-grid-item-left
  163. text-align: left
  164. .voucher-ticket-from-grid-item-right
  165. text-align: right
  166. padding-right: 15px
  167. .voucher-ticket-from-item-total
  168. width: 100%
  169. height: 25px
  170. .voucher-ticket-from-label-total
  171. width: 300px
  172. height: 25px
  173. margin-top: 15px
  174. font:
  175. size: 10pt
  176. weight: bold
  177. text-align: right
  178. padding-right: 15px
  179. .voucher-ticket-from-input-total
  180. width: 150px
  181. height: 25px
  182. margin-top: 15px
  183. text-align: right
  184. padding-right: 15px
  185. font:
  186. size: 10pt
  187. weight: bold
  188. border-bottom: 1px solid #dedede
  189. </style>