Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- `sbparser_item`.`gen_ledger`,
- SUM(`sbparser_inventoryitemcount`.`amount`) AS `total`
- FROM `sbparser_inventoryitemcount`
- INNER JOIN `sbparser_itemcount`
- ON (`sbparser_inventoryitemcount`.`item_count_id` = `sbparser_itemcount`.`id`)
- INNER JOIN `sbparser_inventorycount`
- ON (`sbparser_itemcount`.`inventory_count_id` = `sbparser_inventorycount`.`id`)
- INNER JOIN `sbparser_inventoryreportingretailtransaction`
- ON (`sbparser_inventorycount`.`inventory_reporting_retail_transaction_id` = `sbparser_inventoryreportingretailtransaction`.`id`)
- INNER JOIN `sbparser_transaction`
- ON (`sbparser_inventoryreportingretailtransaction`.`transaction_id` = `sbparser_transaction`.`id`)
- LEFT OUTER JOIN `sbparser_item`
- ON (`sbparser_itemcount`.`item_id` = `sbparser_item`.`id`)
- WHERE (
- `sbparser_transaction`.`business_day_date` BETWEEN '2011-08-01' AND '2011-08-31'
- AND `sbparser_inventoryitemcount`.`valuation_method` = 'Actual'
- AND `sbparser_transaction`.`store_id` IN ('c750041', 'c750038', 'C750055', 'c750031', 'c750004', 'c750033', 'c750101', 'c750100', 'c750030', 'c750019', 'c750009', 'c750037', 'c750012', 'c750039', 'c750022', 'c750003', 'c750021', 'c750040', 'C750045', 'c750026', 'c759999', 'c750036', 'c750034', 'c750020', 'C750053', 'c750001', 'c750023', 'c750015', 'C750042', 'c750010', 'c750011', 'c750035', 'c750006', 'C750043', 'c750027', 'c750002', 'C750048', 'C750047', 'C750051', 'C750054', 'C750049', 'C750046', 'C750050', 'c750008', 'c750044', 'c750018')
- AND NOT (`sbparser_inventorycount`.`count_type` = 'Physical' )
- )
- GROUP BY `sbparser_item`.`gen_ledger` ORDER BY NULL;
Add Comment
Please, Sign In to add comment