count( dbp.packet_number )+IFNULL((SELECT SUM(quantity) FROM logpm_distribution_reservation_zero_package WHERE reservation_id = dbl.id AND zero_package_status !=2),0) + IFNULL((SELECT SUM(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = dbl.id AND inventory_status != 2),0)AS totalNumber,
IFNULL((SELECT SUM(packet_number) FROM logpm_distrilbution_bill_package WHERE bill_lading_id = dbl.id AND packet_bar_status != 2),0)+IFNULL((SELECT SUM(quantity) FROM logpm_distribution_reservation_zero_package WHERE reservation_id = dbl.id AND zero_package_status !=2),0) + IFNULL((SELECT SUM(quantity) FROM logpm_distribution_delivery_details WHERE bill_lading_id = dbl.id AND inventory_status != 2),0)AS totalNumber,