i would like to perform a scheduled task that would scrap all inventory in a specific PLACE LOCATION.
i know how to create the hierarchy select to get the list of Serial id that i want to scrap but how would i pass this to perform_stock_serial_adjustment?
<hierarchy_select>
<primary_table>stock_serial_id</primary_table>
<attrs>
<attr>stock_serial_id.part_id</attr>
<attr>stock_serial_id.serial_id</attr>
</attrs>
<from>
<table>stock_serial_id</table>
</from>
<where>
<data_constraint>
<constraint>
<left_operand>stock_serial_id.place_id</left_operand>
<operator>eq</operator>
<right_operand>TEST_PLACE</right_operand>
</constraint>
<constraint>
<left_operand>stock_serial_id.location</left_operand>
<operator>eq</operator>
<right_operand>REPAIR</right_operand>
</constraint>
</data_constraint>
</where>
</hierarchy_select>
<perform_stock_serial_adjustment>
<parameters>
<adjustment_reason>SCRAP</adjustment_reason>
<location_from>REPAIR</location_from>
<part_id>@part_id</part_id>
<place_id_from>TEST_PLACE</place_id_from>
<pt_comment>Automatic Scrap of Stock </pt_comment>
<serial_id>@serial_id</serial_id>
<quantity>1</quantity>
</parameters>
</perform_stock_serial_adjustment>