Advertisement
aantamimmaarif

nonstock

Oct 2nd, 2022 (edited)
1,132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.06 KB | None | 0 0
  1. SELECT
  2.     fp_log_transaction.isstok,
  3.     fp_log_transaction.qty,
  4.     fp_log_transaction.fp_thick,
  5.     fp_log_transaction.fp_width,
  6.     fp_log_transaction.fp_length,
  7.     fp_log_transaction.m3,
  8.     fp_dimention_convert.fp_thick_s,
  9.     fp_dimention_convert.fp_width_s,
  10.     fp_dimention_convert.fp_length_s,
  11.     ( fp_dimention_convert.fp_thick_s * fp_dimention_convert.fp_width_s * fp_dimention_convert.fp_length_s * fp_log_transaction.qty )/ 1000000000 AS m3_s
  12. FROM
  13.     fp_log_transaction
  14.     INNER JOIN `master_item_code` ON `master_item_code`.`id` = `fp_log_transaction`.`itemproduct_id`
  15.     INNER JOIN `pdo` ON `pdo`.`id` = `fp_log_transaction`.`pdo_id`
  16.     LEFT JOIN ( SELECT pdo_detail.* FROM pdo_detail GROUP BY pdo_detail.id_pdo, pdo_detail.itemcode_id ) AS product_stock ON `product_stock`.`id_pdo` = `fp_log_transaction`.`pdo_id`
  17.     AND `product_stock`.`itemcode_id` = `fp_log_transaction`.`itemproduct_id`
  18.     INNER JOIN `profiling` ON `profiling`.`id` = `product_stock`.`profiling_id`
  19.     INNER JOIN `owner` ON `owner`.`id` = `fp_log_transaction`.`owner_id`
  20.     INNER JOIN `species` ON `species`.`id` = `master_item_code`.`species_id`
  21.     INNER JOIN `certificate` ON `certificate`.`id` = `fp_log_transaction`.`certificate_id`
  22.     INNER JOIN `quality` ON `quality`.`id` = `master_item_code`.`quality_id`
  23.     LEFT JOIN `fp_dimention_convert` ON `fp_log_transaction`.`owner_id` = `fp_dimention_convert`.`owner_id`
  24.     AND `master_item_code`.`species_id` = `fp_dimention_convert`.`species_id`
  25.     AND `fp_log_transaction`.`certificate_id` = `fp_dimention_convert`.`cert_id`
  26.     AND `master_item_code`.`quality_id` = `fp_dimention_convert`.`quality_id`
  27.     AND `fp_log_transaction`.`fp_thick` = `fp_dimention_convert`.`fp_thick`
  28.     AND `fp_log_transaction`.`fp_width` = `fp_dimention_convert`.`fp_width`
  29.     AND `fp_log_transaction`.`fp_length` = `fp_dimention_convert`.`fp_length`
  30. WHERE
  31.     `fp_log_transaction`.`isstok` = 0
  32.     AND `profiling`.`profil_code` = 'E2ER3'
  33.     AND `fp_log_transaction`.`tanggal_transaksi` BETWEEN '2022-08-26'
  34.     AND '2022-10-03'
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement