0.00.0100005050NY50000YN1000100-2025/07/02 10:54:36.933-2025/07/02 10:54:36.933H4sIAAAAAAAAAAMAAAAAAAAAAAA=Ndw bi indoteknik (localhost)localhostPOSTGRESQLNativedw_bi_indoteknik5432odooEncrypted 2be98afc82bdfd8dd9a2ca45acc83f6c3FORCE_IDENTIFIERS_TO_LOWERCASENFORCE_IDENTIFIERS_TO_UPPERCASENIS_CLUSTEREDNPORT_NUMBER5432PRESERVE_RESERVED_WORD_CASEYQUOTE_ALL_FIELDSNSUPPORTS_BOOLEAN_DATA_TYPEYSUPPORTS_TIMESTAMP_DATA_TYPENUSE_POOLINGNerp indoteknik production (localhost)10.148.0.3POSTGRESQLNativeerp_indoteknik5432pdiEncrypted 2be989bb20084ca95810197629d9ea18eFORCE_IDENTIFIERS_TO_LOWERCASENFORCE_IDENTIFIERS_TO_UPPERCASENIS_CLUSTEREDNPORT_NUMBER5432PRESERVE_RESERVED_WORD_CASEYQUOTE_ALL_FIELDSNSUPPORTS_BOOLEAN_DATA_TYPEYSUPPORTS_TIMESTAMP_DATA_TYPENUSE_POOLINGNTable inputMerge joinYavg hppMerge joinYcurrent qtyMerge join 2YMerge joinMerge join 2YMerge join 2If field value is nullYIf field value is nullCalculatorYCalculatorIf field value is null 2YIf field value is null 2UpdateYCalculatorCalculatorY1noneYnew_qty_availableSUBTRACTqtyqty_outgoingNone-1-1Nnew_total_valueMULTIPLYnew_qty_availablevalueNone-1-1N512304YIf field value is nullIfNullY1none0YNNnew_aging0Nqty0Nqty_available_current0Nlast_cost0N368304YIf field value is null 2IfNullY1none0YNNnew_qty_available0N656304YMerge joinMergeJoinY1noneLEFT OUTERTable inputavg hppproduct_idproduct_id224192YMerge join 2MergeJoinY1noneLEFT OUTERMerge joincurrent qtyproduct_idproduct_id224304YTable inputTableInputY1nonedw bi indoteknik (localhost)select ld.product_id, 0 as qty_available_current,
(date_part('epoch'::text, age(now()::timestamp, ld.last_in)) / 3600) / 24::numeric as new_aging,
ld.value, b.name as brand, p.parent_category as category
from list_deadstock ld
left join product p on p.product_id = ld.product_id
left join brand b on b.id = p.brand_id
order by product_id0NNNNIntegernormalproduct_id90Table inputproduct_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNIntegernormalqty_available_current90Table inputqty_available_current####0;-####0.,noneNY0NNNen_USAsia/BangkokNNumbernormalnew_aging-1-1Table inputnew_aging####0.0#########;-####0.0#########.,noneNY0NNNen_USAsia/BangkokNBigNumbernormalvalue-1-1Table inputvalue######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokNStringnormalbrand2147483647-1Table inputbrand.,noneNY0NNNen_USAsia/BangkokNStringnormalcategory2147483647-1Table inputcategory.,noneNY0NNNen_USAsia/BangkokN22464YUpdateUpdateY1nonedw bi indoteknik (localhost)N100NNpublic
list_deadstock
product_idproduct_id=total_valuenew_total_valueagingnew_agingqty_available_currentnew_qty_availablebrandbrandcategorycategory816304Yavg hppTableInputY1noneerp indoteknik production (localhost)SELECT
pp.id as product_id,
avg(svl.unit_cost) AS last_cost
FROM
stock_valuation_layer svl
JOIN
product_product pp ON svl.product_id = pp.id
JOIN
product_template pt ON pp.product_tmpl_id = pt.id
LEFT JOIN
stock_move sm ON svl.stock_move_id = sm.id
WHERE
svl.unit_cost > 0
group by pp.id
order by pp.id0NNNNIntegernormalproduct_id90avg hppproduct_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNBigNumbernormallast_cost-1-1avg hpplast_cost######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokN400192Ycurrent qtyTableInputY1noneerp indoteknik production (localhost)select sq.product_id, sum(quantity) as qty, get_qty_outgoing(sq.product_id) as qty_outgoing
from stock_quant sq
join stock_location sl on sl.id = sq.location_id
where sq.location_id in(select id from stock_location where usage = 'internal' and active = true)
group by sq.product_id
order by sq.product_id0NNNNIntegernormalproduct_id90current qtyproduct_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNNumbernormalqty-1-1current qtyqty####0.0#########;-####0.0#########.,noneNY0NNNen_USAsia/BangkokNBigNumbernormalqty_outgoing-1-1current qtyqty_outgoing######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokN80304YN