Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- fp_log_transaction.isstok,
- fp_log_transaction.qty,
- fp_log_transaction.fp_thick,
- fp_log_transaction.fp_width,
- fp_log_transaction.fp_length,
- fp_log_transaction.m3,
- fp_dimention_convert.fp_thick_s,
- fp_dimention_convert.fp_width_s,
- fp_dimention_convert.fp_length_s,
- ( 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
- FROM
- fp_log_transaction
- INNER JOIN `master_item_code` ON `master_item_code`.`id` = `fp_log_transaction`.`itemproduct_id`
- INNER JOIN `pdo` ON `pdo`.`id` = `fp_log_transaction`.`pdo_id`
- 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`
- AND `product_stock`.`itemcode_id` = `fp_log_transaction`.`itemproduct_id`
- INNER JOIN `profiling` ON `profiling`.`id` = `product_stock`.`profiling_id`
- INNER JOIN `owner` ON `owner`.`id` = `fp_log_transaction`.`owner_id`
- INNER JOIN `species` ON `species`.`id` = `master_item_code`.`species_id`
- INNER JOIN `certificate` ON `certificate`.`id` = `fp_log_transaction`.`certificate_id`
- INNER JOIN `quality` ON `quality`.`id` = `master_item_code`.`quality_id`
- LEFT JOIN `fp_dimention_convert` ON `fp_log_transaction`.`owner_id` = `fp_dimention_convert`.`owner_id`
- AND `master_item_code`.`species_id` = `fp_dimention_convert`.`species_id`
- AND `fp_log_transaction`.`certificate_id` = `fp_dimention_convert`.`cert_id`
- AND `master_item_code`.`quality_id` = `fp_dimention_convert`.`quality_id`
- AND `fp_log_transaction`.`fp_thick` = `fp_dimention_convert`.`fp_thick`
- AND `fp_log_transaction`.`fp_width` = `fp_dimention_convert`.`fp_width`
- AND `fp_log_transaction`.`fp_length` = `fp_dimention_convert`.`fp_length`
- WHERE
- `fp_log_transaction`.`isstok` = 0
- AND `profiling`.`profil_code` = 'E2ER3'
- AND `fp_log_transaction`.`tanggal_transaksi` BETWEEN '2022-08-26'
- AND '2022-10-03'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement