0.00.0100005050NY50000YN1000100-2025/05/06 13:31:46.218-2025/05/06 13:31:46.218H4sIAAAAAAAAAAMAAAAAAAAAAAA=Nerp 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_POOLINGNoutstanding manufacturing orderjavascript reserve stateYjavascript reserve statescript date reservedYscript date reservedUpdateYUpdateUpdateY1noneerp indoteknik production (localhost)N100NNpublic
mrp_production
production_idid=date_reservednew_date_reserved64048Yjavascript reserve stateScriptValueModY1noneN90Script 1var reserve_state = "waiting"
if(state == "done" && qty_done > 0){
reserve_state = "done"
}
else if(state == "cancel"){
reserve_state = "cancel"
}
else if(qty_reserved-qty_need==0 && qty_reserved > 0){
reserve_state = "ready"
}
else{
reserve_state = "waiting"
}reserve_statereserve_stateString-1-1N33648Youtstanding manufacturing orderTableInputY1noneerp indoteknik production (localhost)select
mp.id as production_id,
mp.state,
NULL as state_reserve,
sum(coalesce(sm.product_uom_qty,0)) as qty_need,
sum(coalesce(sml.product_uom_qty,0)) as qty_reserved,
sum(coalesce(sml.qty_done,0)) as qty_done,
NULL as date_reserved,
now()::timestamp-'7 hours'::interval as current_date
from
mrp_production mp
join
stock_move sm on sm.raw_material_production_id = mp.id
left join
stock_move_line sml on sml.move_id = sm.id
where
1=1
and (mp.state not in ('done', 'cancel'))
and mp.write_date >= (now() - '180 days'::interval)
and mp.name ILIKE '%BU/MO%'
and mp.state in ('confirmed', 'planned', 'progress')
group by mp.id0NNNNIntegernormalproduction_id90outstanding manufacturing orderproduction_id####0;-####0.,noneNY0NNNen_USAsia/BangkokNStringnormalstate2147483647-1outstanding manufacturing orderstate.,noneNY0NNNen_USAsia/BangkokNStringnormalstate_reserve2147483647-1outstanding manufacturing orderstate_reserve.,noneNY0NNNen_USAsia/BangkokNBigNumbernormalqty_need-1-1outstanding manufacturing orderqty_need######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokNBigNumbernormalqty_reserved-1-1outstanding manufacturing orderqty_reserved######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokNBigNumbernormalqty_done-1-1outstanding manufacturing orderqty_done######0.0###################;-######0.0###################.noneNY0NNNen_USAsia/BangkokNStringnormaldate_reserved2147483647-1outstanding manufacturing orderdate_reserved.,noneNY0NNNen_USAsia/BangkokNTimestampnormalcurrent_date6-1outstanding manufacturing ordercurrent_date.,noneNY0NNNen_USAsia/BangkokN12848Yscript date reservedScriptValueModY1noneN90Script 1var new_date_reserved = null
if (reserve_state == "ready" || reserve_state == "done"){
if (!date_reserved){
new_date_reserved = current_date
}else{
new_date_reserved = date_reserved
}
}
else{
new_date_reserved = null
}new_date_reservednew_date_reservedTimestamp-1-1N48048YN