Advertisement
Guest User

Untitled

a guest
Nov 26th, 2012
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.23 KB | None | 0 0
  1.  
  2.  
  3. = form_for @penjualan do |f|
  4. -if @penjualan.errors.any?
  5. #error_explanation
  6. %h2= "#{pluralize(@penjualan.errors.count, "error")} prohibited this penjualan from being saved:"
  7. %ul
  8. - @penjualan.errors.full_messages.each do |msg|
  9. %li= msg
  10.  
  11. .row
  12. .span6
  13. .field
  14. = f.label :kode_transaksi
  15. = f.text_field :kode_transaksi
  16. = text_field :penjualan, :kode_transaksi, :type => "hidden", :id=>"input-barang"
  17. .span6
  18. .field
  19. Kustomer
  20. %br
  21. = text_field :customer, :name
  22. = f.text_field :customer_id, :type=>"hidden"
  23. = button_tag "...", :class => "btn", :id =>"select_customer", :"data-toggle" => "modal", :href=>"#customerModal"
  24. .row
  25. .span6
  26. .field.tanggal_transaksi
  27. = f.label :tanggal_transaksi
  28. = f.date_select :tanggal_transaksi, {:order => [:day, :month, :year], :use_month_names => [:Januari, :Februari, :Maret, :April, :Mei, :Juni, :Juli, :Agustus, :September, :Oktober, :November, :December]}
  29. .span6
  30. .field
  31. Alamat Kustomer
  32. %br
  33. = text_field :customer, :to_s
  34.  
  35. .row
  36. .span12
  37. .row
  38. .span4
  39. = button_tag "Input Barang", :class => "btn add-bottom-10", :id =>"select_barang", :"data-toggle" => "modal", :href=>"#barangModal"
  40. .span4.offset4
  41. = button_tag "Hapus Barang", :class => "btn", :id=>"delete_barang"
  42. = text_field_tag "temp","", :id =>"delete_barang_id", :type=>"hidden"
  43. .transaction-details
  44. %table.table#transaction-table
  45. %tbody
  46. %tr
  47. %th Kode barang
  48. %th Nama Barang
  49. %th Jumlah
  50. %th Harga Satuan
  51. %th Harga Total
  52. %th Diskon / Unit
  53. %th Diskon Total
  54. %th Total
  55.  
  56.  
  57.  
  58. .row
  59. .span12.center
  60. %h3.center
  61. Cara Bayar
  62. .row
  63. .span2.offset4
  64. %h3
  65. Hutang
  66. = radio_button_tag 'status_pembayaran', 'hutang'
  67. .span2
  68. %h3
  69. Kartu Kredit
  70. = radio_button_tag 'status_pembayaran', 'kartu_kredit'
  71. .span2
  72. %h3
  73. Kartu Debit
  74. = radio_button_tag 'status_pembayaran', 'kartu_debit'
  75. .span2
  76. %h3
  77. Cash
  78. = radio_button_tag 'status_pembayaran', 'cash', :selected => true
  79. .row
  80. .span4
  81. .field.tanggal_jatuh_tempo.tanggal_transaksi
  82. = f.label :jatuh_tempo
  83. = f.date_select :jatuh_tempo, {:order => [:day, :month, :year], :use_month_names => [:Januari, :Februari, :Maret, :April, :Mei, :Juni, :Juli, :Agustus, :September, :Oktober, :November, :December]}
  84. .span4.offset8.creditcard
  85. .field
  86. Nomor Kartu Kredit
  87. %br
  88. = f.text_field :kartu_kredit, :id=>"nomor_kartu_kredit"
  89. .span4.offset8.debitcard
  90. .field
  91. Nomor Kartu Debit
  92. %br
  93. = f.text_field :kartu_debit, :id=>"nomor_kartu_debit"
  94. %hr
  95. .row
  96. .span4
  97. = f.submit 'Proses', :class=>"btn btn-large btn-primary", :disable_with => "Processing..."
  98. .span4.offset4
  99. .field
  100. TOTAL DISCOUNT
  101. %br
  102. = text_field_tag :total_discount, "0", :id=>"total_discount", :class=>"right", :readonly=>true
  103. .row
  104. .span4
  105. = f.submit 'Batal', :class=>"btn btn-large btn-danger", :id=>"cancel_transaction"
  106. .span4.offset4
  107. .field
  108. SUB TOTAL
  109. %br
  110. = f.text_field :total, :id=>"sub_total", :class=>"right", :readonly=>true
  111. .row
  112. .span4.offset8
  113. .field
  114. ONGKOS / BIAYA HANDLING
  115. %br
  116. = text_field_tag :ongkos, "", :id=>"ongkos", :class => "calculate-grand-total right"
  117. .row
  118. .span4.offset8
  119. .field
  120. GRAND TOTAL
  121. %br
  122. = text_field_tag :grand_total, "", :id=>"grand_total", :class=>"right", :readonly=>true
  123. .row.cash
  124. .span4.offset8
  125. .field
  126. CASH
  127. %br
  128. = text_field_tag :total, "", :id=>"cash_total", :class => "calculate-cash right", :name=>"cash_total"
  129. .row.cash
  130. .span4.offset8
  131. .field
  132. Kembali
  133. %br
  134. = text_field_tag :total, "", :id=>"kembali", :class=>"right", :name=>"kembali"
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142. .modal.hide#customerModal
  143. .modal-header
  144. = button_tag "x", :type=>"button", :class=> "close", :"data-dismiss" =>"modal"
  145. %h3
  146. Pilih Kustomer
  147. .modal-body
  148. %table.table.table-bordered.table-striped.center#table-customer-penjualan
  149. %tr
  150. %th Kode kustomer
  151. %th Nama kustomer
  152. %th Nama contactperson
  153. %th Alamat
  154. %th Kota
  155. %th Phone1
  156. %th Phone2
  157.  
  158.  
  159. - @customers.each do |customer|
  160. %tr.data{:"data-id"=> customer.id}
  161. %td.kode_kustomer= customer.kode_kustomer
  162. %td.nama_kustomer= customer.nama_kustomer
  163. %td= customer.nama_contactperson
  164. %td.alamat= customer.alamat
  165. %td= customer.kota
  166. %td= customer.phone1
  167. %td= customer.phone2
  168. .modal-footer
  169. %a{:href=>"#", :class=>"btn", :"data-dismiss"=>"modal", :id=>"close-customer-modal"}
  170. Batal
  171.  
  172. .modal.hide#barangModal
  173. .modal-header
  174. = button_tag "x", :type=>"button", :class=> "close", :"data-dismiss" =>"modal"
  175. %h3
  176. Pilih Barang
  177. .modal-body
  178. .detail-barang
  179. .row
  180. .span12
  181. %h3 Detail Barang
  182. .row
  183. .span3
  184. Kode Barang
  185. .span3
  186. = text_field :barang, :kode_barang, :id => "kode_barang", :class=>"kode_barang_input"
  187. .span2
  188. Nama Barang
  189. .span3
  190. = text_area :barang, :nama_barang, :size=>"25x3", :readonly=>true, :id => "nama_barang"
  191. .row
  192. .span3
  193. Jumlah Barang
  194. .span3
  195. = text_field :barang, :jumlah_barang, :class=> "calculate"
  196. .span2
  197. Satuan
  198. .span3
  199. = label_tag '','',:id=>"barang_satuan", :readonly=>true
  200. .row
  201. .span3
  202. Discount Per Unit
  203. .span3
  204. = text_field :detil_penjualan, :discount, :class=> "calculate"
  205. .span2
  206. Harga Jual
  207. .span3
  208. = text_field :barang, :harga_jual, :id => "harga_jual", :readonly=>true
  209. .row
  210. .span3
  211. Extra Cost
  212. .span3
  213. = check_box_tag 'tambahan'
  214. = text_field :detil_penjualan, :tambahan, :class=> "calculate", :readonly => true
  215. .span2
  216. Kode Mesin / Rangka / No. Seri
  217. .span3
  218. = check_box_tag 'kode_mesin'
  219. = text_field :detil_penjualan, :kode_mesin, :readonly => true
  220. .row
  221. .span3
  222. Total Discount
  223. .span3
  224. = text_field :detil_penjualan, :total_discount, :readonly => true
  225. .span2
  226. Total
  227. .span3
  228. = text_field :detil_penjualan, :total, :readonly=>true, :id=>"total_harga"
  229. .row
  230. .span3.offset9
  231. .field
  232. Gambar
  233. %br
  234. = image_tag("no_image.jpg", :id=> 'barang_gambar_barang')
  235. %hr.add-bottom-10
  236. .row
  237. .span4
  238. = button_tag "Proses",:class=>"btn btn-large", :id=>"proses-barang"
  239. .span4
  240. = button_tag "Batal" ,:class=>"btn btn-large", :id=>"batal-proses-barang"
  241. .span4
  242. = button_tag "Keluar",:class=>"btn btn-large", :"data-dismiss"=>"modal", :id=>"close-barang-modal"
  243. %hr.add-bottom-10
  244. .row
  245. .span12
  246. = form_tag "/barangs/search/", :method => :get, :class=> "search-barang-form-modal" do
  247. Search
  248. = text_field :barang, :search, :id => "search-barang" ,:class => "search-query search-field", :name => "query"
  249. = button_tag "Search", :class => "btn btn-large search-barang", :id =>"search-barang-button-modal"
  250. = button_tag "Clear", :class => "btn btn-large clear-search-barang", :id =>"clear-search-barang-button-modal"
  251. %hr
  252. = form_tag "/barang/set/limit", :method => :get do
  253. Tampilkan
  254. = text_field :barang, :limit, :id=>"limit-hasil", :name=> "limit" ,:size =>"4", :value => cookies[:limit]
  255. item sekaligus
  256. = button_tag "refresh", :class => "btn"
  257. %hr
  258. .table-barang-wrapper
  259. #table-barang
  260. %table.table.table-striped.table-condensed.center#table-barang-inside.table-barang-modal-inside
  261. %tr.center
  262. %th Kode barang
  263. %th Nama barang
  264. %th Satuan
  265. %th Harga Jual
  266. %th Quantity
  267. %th Kode rak
  268. %th Keterangan
  269.  
  270.  
  271.  
  272. - @barangs.each do |barang|
  273. %tr.data{generate_row_attribute(barang)}
  274. %td.kode_barang= barang.kode_barang
  275. %td.nama_barang= barang.nama_barang
  276. %td.satuan= barang.satuan.nama
  277. %td.right.harga_jual{:"harga_jual"=> barang.harga_jual.to_i}= number_with_delimiter(barang.harga_jual.to_i, :delimiter => ' ')
  278. %td.right= number_with_delimiter(barang.quantity, :delimiter => ' ')
  279. %td= barang.kode_rak
  280. %td= truncate(barang.keterangan)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement